Where can get Arduino Registers examples?

Specially the ADC relative.
Thanks for help please.

source code for analogRead() ?

there are also many on line tutorials, here is a first hit (did not read it)

1 Like

Thank you.

1. Internal structure of the ADC Module (Fig-1) of ATmega328P MCU, which shows the placement and role of ADC related few registers: ADMUX, ADCSR, ADCH, ADCL, SREG.


2. ADC Related Register Description

This register selects "ADC channel (MUX3 -MUX0)", "Vref value for ADC (REFS1-REFS0)", etc.


This register enables "ADC Module (ADEN)", selctes "division factor of ADC clock prescaler (APS2-APS0)", issues "start command to ADC (ADSC)", monitors "end of conversion status (ADIF)", enables "local interrupt enable switch (ADIE)", etc.


These two registers hold the "ADC value (ADC9-ADC8, ADC7-ADC0)" after conversion. The upper 6--bit of ADCH register are always 0s.


This register enables the "global interrupt enable switch (I) of the ADC Module", etc.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.