Where can get Arduino Registers examples?

Specially the ADC relative.
Thanks for help please.
Adam

source code for analogRead() ?

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

1 Like

Great!
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.


Figure-1:

2. ADC Related Register Description
(1)


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

(2)


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.
Figure-3:

(3)

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

(4)

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

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