On Paper: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers

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. Both left adjusted (ADLAR = 1) and right adjusted (ADLAR = 0) will be shown.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.