33.4.2.4 Output Formats
- An 8-bit ADC provides 256 discrete levels (from 0 to 255)
- A 10-bit ADC provides 1024 discrete levels (from 0 to 1023)
- A 12-bit ADC provides 4096 discrete levels (from 0 to 4095)
- A 13-bit ADC provides 8192 discrete levels (from 0 to 8191)
A single-ended conversion measures one input voltage against ground. The result of an n-bit single-ended conversion is an unsigned (positive) integer between 0 and the maximum value 2n - 1:
The result of an n-bit single-ended conversion, as provided in the Result (RESULT) register, is given by the following equation:
- VINP: Input voltage from the positive input multiplexer
- VREF: Voltage reference
A differential conversion measures the difference between two input voltages. The result of an n-bit differential conversion is a signed (positive or negative) integer between -2n - 1 and 2n - 1 - 1:
The result of an n-bit differential conversion, as provided in the Result (RESULT) register, is given by the following equation:
- VINP: Input voltage from the positive input multiplexer
- VINN: Input voltage from the negative input multiplexer
- VREF: Voltage reference
Single-ended conversions are represented as unsigned values, while differential conversions
use signed values in two’s complement form. When the conversion result does not occupy the
whole register, the unused bits are set to ‘0’. However, for differential
conversion results, the unused bits to the left of the result replicate the sign bit. This
process, known as sign extension, ensures that the value retains its correct positive or
negative sign when interpreted as a larger bit-width number.
The ADC has two output registers: The Sample (SAMPLE) and Result (RESULT) registers. The SAMPLE register is always updated with the latest ADC conversion output (one sample). In series and burst accumulation modes, samples are added together in an internal sample accumulator, which is configured by the Sample Accumulation Number Select bit field in the Control D register (CTRLD.SAMPNUM). The accumulated result is automatically transferred to the RESULT register when all samples are completed. In single conversion modes, the RESULT register is updated with the latest sample, making it identical to the SAMPLE register.
The Result Scaling bit field in the Control D register (CTRLD.SCALING) determines how data are presented in the SAMPLE and RESULT registers, as shown in the following table.
| Description | SAMPLE | RESULT |
|---|---|---|
| None | LSb at bit 0 | Accumulated value with LSb at bit 0 |
| Left Adjust | MSb at bit 15 | Accumulated value is scaled corresponding to the number of samples. Up to 16 bits available, with MSb at bit 15. |
| Average | LSb at bit 0 | Accumulated value divided by the number of samples, with LSb at bit 0 |
The data format for a single-ended conversion sample is an unsigned number, where
0x0000 represents zero and 0x0FFF represents the largest
value (full scale). For differential conversions, the data format is two's complement with
sign extension.
The following tables show the RESULT register output formats for single-ended and differential conversions, based on mode of operation, scaling, and resolution.
| MODE | SCALING | RES | RESULT | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||
| SINGLE | NORMAL AVERAGE | 8 | 0x00 | Conversion[7:0] | ||||||||||||||||||||||||||||||
| 10 | 0x00 | Conversion[9:0] | ||||||||||||||||||||||||||||||||
| 12 | 0x00 | Conversion[11:0] | ||||||||||||||||||||||||||||||||
| 13 | 0x00 | Conversion[12:0] | ||||||||||||||||||||||||||||||||
| LEFTADJ | 8 | 0x00 | Conversion[7:0] | 0x00 | ||||||||||||||||||||||||||||||
| 10 | 0x00 | Conversion[9:0] | 0x00 | |||||||||||||||||||||||||||||||
| 12 | 0x00 | Conversion[11:0] | 0x00 | |||||||||||||||||||||||||||||||
| 13 | 0x00 | Conversion[12:0] | 0x00 | |||||||||||||||||||||||||||||||
SERIES BURST | NORMAL | X | 0x00 | Accumulation[23:0] | ||||||||||||||||||||||||||||||
| AVERAGE | 8 | 0x00 | Average[7:0] | |||||||||||||||||||||||||||||||
| 10 | 0x00 | Average[9:0] | ||||||||||||||||||||||||||||||||
| 12 | 0x00 | Average[11:0] | ||||||||||||||||||||||||||||||||
| 13 | 0x00 | Average[12:0] | ||||||||||||||||||||||||||||||||
| LEFTADJ | X | 0x00 | Left Adjusted Accumulation[15:0] | |||||||||||||||||||||||||||||||
| MODE | SCALING | RES | RESULT | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |||
| SINGLE | NORMAL AVERAGE | 8 | Sign Extension | Conversion[7:0] | ||||||||||||||||||||||||||||||
| 10 | Sign Extension | Conversion[9:0] | ||||||||||||||||||||||||||||||||
| 12 | Sign Extension | Conversion[11:0] | ||||||||||||||||||||||||||||||||
| 13 | Sign Extension | Conversion[12:0] | ||||||||||||||||||||||||||||||||
| LEFTADJ | 8 | Sign Extension | Conversion[7:0] | 0x00 | ||||||||||||||||||||||||||||||
| 10 | Sign Extension | Conversion[9:0] | 0x00 | |||||||||||||||||||||||||||||||
| 12 | Sign Extension | Conversion[11:0] | 0x00 | |||||||||||||||||||||||||||||||
| 13 | Sign Extension | Conversion[12:0] | 0x00 | |||||||||||||||||||||||||||||||
SERIES BURST | NORMAL | X | Sign Extension | Accumulation[23:0] | ||||||||||||||||||||||||||||||
| AVERAGE | 8 | Sign Extension | Average[7:0] | |||||||||||||||||||||||||||||||
| 10 | Sign Extension | Average[9:0] | ||||||||||||||||||||||||||||||||
| 12 | Sign Extension | Average[11:0] | ||||||||||||||||||||||||||||||||
| 13 | Sign Extension | Average[12:0] | ||||||||||||||||||||||||||||||||
| LEFTADJ | X | Sign Extension | Left Adjusted Accumulation[15:0] | |||||||||||||||||||||||||||||||
| MODE | DIFF | SCALING | RES | SAMPLE | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||||
| X | 0 | NORMAL AVERAGE | 8 | 0x00 | Conversion[7:0] | ||||||||||||||
| 10 | 0x00 | Conversion[9:0] | |||||||||||||||||
| 12 | 0x00 | Conversion[11:0] | |||||||||||||||||
| 13 | 0x00 | Conversion[12:0] | |||||||||||||||||
| 1 | 8 | Sign Extension | Conversion[7:0] | ||||||||||||||||
| 10 | Sign Extension | Conversion[9:0] | |||||||||||||||||
| 12 | Sign Extension | Conversion[11:0] | |||||||||||||||||
| 13 | Sign Extension | Conversion[12:0] | |||||||||||||||||
| X | LEFTADJ | 8 | Conversion[7:0] | 0x00 | |||||||||||||||
| 10 | Conversion[9:0] | 0x00 | |||||||||||||||||
| 12 | Conversion[11:0] | 0x00 | |||||||||||||||||
| 13 | Conversion[12:0] | 0x00 | |||||||||||||||||
