Indicate the role of registers ADCCONO ADCCON1 ADRESH and AD
Solution
ANSWER:
The ADCCON0 and ADCCON1 registers are for controlling the behaviour of the ADC which is inside the PIC microcontroller. ADRESL and ADRESH are the registers which have the result - the digital value corresponding to the analog input supplied on a pin of the PIC.
ADCON0:
The size of this register is one byte (8 bits). Each bit has an associated functionality.They let us choose, the frequency at which sampling and conversion to digital will be done, channel select. We have to start conversion by writing a 1 to bit 0 of this register and can poll bit 2 to know the conversion status whether it is completed ornot.
ADCON1:
This tells whether the 10 bit digital output should be right or left justified. By configuring this register, we can also map a port as analog or a digital one.
ADRESH, ADRESL:
These registers contain the digital output of the ADC. They are filled in by the ADC based on whether the endresult has to be right or left justified.
