AT90PWM216-16SE ATMEL [ATMEL Corporation], AT90PWM216-16SE Datasheet - Page 249

no-image

AT90PWM216-16SE

Manufacturer Part Number
AT90PWM216-16SE
Description
8-bit Microcontroller with 16K Bytes In-System Programmable flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
21.8
21.8.1
7710D–AVR–08/09
ADC Register Description
ADC Multiplexer Register – ADMUX
Table 21-2.
Example 1:
Example 2:
The ADC of the AT90PWM216/316 is controlled through 3 different registers. The ADCSRA and
The ADCSRB registers which are the ADC Control and Status registers, and the ADMUX which
allows to select the Vref source and the channel to be converted.
The conversion result is stored on ADCH and ADCL register which contain respectively the most
significant bits and the less significant bits.
Bit
Read/Write
Initial Value
• Bit 7, 6 – REFS1, 0: ADC Vref Selection Bits
V
V
V
...
V
V
V
...
V
V
V
ADCn
ADCm
ADCm
ADCm
ADCm
ADCm
ADCm
ADCm
ADCm
– ADMUX = 0xED (ADC3 - ADC2, 10x gain, 2.56V reference, left adjusted result)
– Voltage on ADC3 is 300 mV, voltage on ADC2 is 500 mV.
– ADCR = 512 * 10 * (300 - 500) / 2560 = -400 = 0x270
– ADCL will thus read 0x00, and ADCH will read 0x9C.
– ADMUX = 0xFB (ADC3 - ADC2, 1x gain, 2.56V reference, left adjusted result)
– Voltage on ADC3 is 300 mV, voltage on ADC2 is 500 mV.
– ADCR = 512 * 1 * (300 - 500) / 2560 = -41 = 0x029.
– ADCL will thus read 0x40, and ADCH will read 0x0A.
+ 0.999 V
+ 0.998 V
+ 0.001 V
- 0.001 V
- 0.999 V
- V
Writing zero to ADLAR right adjusts the result: ADCL = 0x70, ADCH = 0x02.
Writing zero to ADLAR right adjusts the result: ADCL = 0x00, ADCH = 0x29.
+ V
REF
REF
/GAIN
/GAIN
Correlation Between Input Voltage and Output Codes
REF
REF
REFS1
REF
REF
REF
R/W
7
0
/GAIN
/GAIN
/GAIN
/GAIN
/GAIN
REFS0
R/W
6
0
ADLAR
R/W
Read code
5
0
0x1FF
0x1FF
0x1FE
0x3FF
0x001
0x000
0x201
0x200
...
...
4
0
-
-
Corresponding decimal value
511
511
510
...
1
0
-1
...
-511
-512
MUX3
R/W
3
0
MUX2
AT90PWM216/316
R/W
2
0
MUX1
R/W
1
0
MUX0
R/W
0
0
ADMUX
249

Related parts for AT90PWM216-16SE