330
XMEGA B [DATASHEET]
8291B–AVR–01/2013
26.6
Conversion Result
The result of the analog-to-digital conversion is written to the channel result register. The ADC is either in signed or
unsigned mode. This setting is global for the ADC and for the ADC channel.
In signed mode, negative and positive results are generated. Signed mode must be used when the ADC channel is set
up for differential measurements. In unsigned mode, only single-ended or internal signals can be measured. With 12-bit
resolution, the TOP value of a signed result is 2047, and the results will be in the range -2048 to +2047 (0xF800 -
0x07FF).
The ADC transfer function can be written as:
VINP and VINN are the positive and negative inputs to the ADC.
For differential measurements, GAIN is 1/2 to 64. For single-ended and internal measurements, GAIN is always 1 and
VINP is the internal ground.
In unsigned mode, only positive results are generated. The TOP value of an unsigned result is 4095, and the results will
be in the range 0 to +4095 (0x0 - 0x0FFF).
The ADC transfer functions can be written as:
VINP is the single-ended or internal input.
The ADC can be configured to generate either an 8-bit or a 12-bit result. A result with lower resolution will be available
faster. See the
“ADC Clock and Conversion Timing” on page 331
for a description on the propagation delay.
The result register is 16 bits wide, and data are stored as right adjusted 16-bit values. Right adjusted means that the
eight least-significant bits (lsb) are found in the low byte. A 12-bit result can be represented either left or right adjusted.
Left adjusted means that the eight most-significant bits (msb) are found in the high byte.
When the ADC is in signed mode, the msb represents the sign bit. In 12-bit right adjusted mode, the sign bit (bit 11) is
padded to bits 12-15 to create a signed 16-bit number directly. In 8-bit mode, the sign bit (bit 7) is padded to the entire
high byte.
to
show the different input options, the signal input range, and the
result representation with 12-bit right adjusted mode.
Figure 26-9. Signed differential input (with gain), input range, and result representation.
RES
VINP - VINN
VREF
---------------------------------- GAIN
TOP +1
=
RES
VINP - (-
V
VREF
----------------------------------
TOP +1
=
2047
2046
2045
...
3
2
1
0
-1
...
-2045
-2046
-2047
-2048
7FF
7FE
7FD
...
3
2
1
0
FFF
FFE
...
803
802
801
800
Dec
Hex
0111 1111 1111
0111 1111 1110
0111 1111 1101
...
0000 0000 0011
0000 0000 0010
0000 0000 0001
0000 0000 0000
1111 1111 1111
1111 1111 1110
...
1000 0000 0011
1000 0000 0010
1000 0000 0001
1000 0000 0000
Binary
0000 0111 1111 1111
0000 0111 1111 1110
0000 0111 1111 1101
...
0000 0000 0000 0011
0000 0000 0000 0010
0000 0000 0000 0001
0000 0000 0000 0000
1111 1111 1111 1111
1111 1111 1111 1110
...
1111 1000 0000 0011
1111 1000 0000 0010
1111 1000 0000 0001
1111 1000 0000 0000
16-bit result register
VREF
GAIN
-VREF
GAIN
0 V
VINN
RES
VINP
-2
Содержание XMEGA B
Страница 320: ...320 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 12 7 segments Character Table...
Страница 321: ...321 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 13 14 segments Character Table...
Страница 322: ...322 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 14 16 segments Character Table...
Страница 412: ...412 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 413: ...413 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 414: ...414 XMEGA B DATASHEET 8291B AVR 01 2013...