Programming: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers
Share
When a 10-bit number is desired from the ADC conversion, both the ADCH and ADCL must be used to get the full 10-bit number. The ADC stores the conversion in the ADCH and ADCL registers. First, the ADCL register must be accessed and saved into another variable. The is a rule that must be followed when trying to get the 10-bit number. Second, a variable will be needed to store the 10-bit conversion. A 16-bit variable is used. A bitwise shift operation will be used to get the data into the variable correctly. The Right Adjusted method ADLAR = 0 is shown in this case.