Abstract

PIC16 C Analog Input focuses on analog input display, voltage measurement, and ADC setup codes. A microcontroller analog input allows an external voltage to be converted to digital form, stored, and processed. This type of input occurs in data loggers, control systems, digital audio, and signal processors, to mention just a few. The dsPIC range is designed specifically for high-speed analog signal processing. A basic setup to demonstrate analog input is shown. The PIC16F877 has eight analog inputs, which are accessed via RA0, RA1, RA2, RA3, RA5, RE0, RE1, and RE2, being renamed AN0 to AN7 in this mode. All these pins default to analog operation, but a combination of analog and digital inputs can be selected using a system function. Interrupts allow an external event to initiate a control sequence that takes priority over the current MCU activity. The interrupt service routine (ISR) carries out some operation associated with the port or internal device that requested the interrupt. Interrupts are frequently used with hardware timers, which provide delays, timed intervals, and measurement. The PIC 16F877 has three hardware timers built in: Timer0 (originally called RTCC, the real-time counter clock), Timer1, and Timer2. The principal mode of operation of these registers is as counters for external events or timers using the internal clock. The serial peripheral interface master controller uses hardware slave selection to identify a peripheral device with which it wishes to exchange data.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call