Result: ADC (Analog to Digital Conversion) Getting the 10-bit number from the ADCH and ADCL Registers (Right Adjusted)
The ADLAR is not set in this program because it is 0 (right adjusted) by default.
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.
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.