SNIU028E February 2016 – February 2025 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The following example code demonstrates how to configure ADC12 to initiate a sequence of conversions triggered by software.
Requirement: 10 conversions need to be sequenced during a single session with triggering done via firmware. The required channels are as follows: Conversions = 09, 10, 02, 02, 02, 04, 04, 04, 12 and 14. Here the maximum number of conversion is set to 9 and the ADC Sequence Select Register is configured to:
| Bits | Field Name | Channel Select Value | |
|---|---|---|---|
| SEQCHSEL0 | 4:0 | SEQ00 | 9 |
| 9:5 | SEQ01 | 10 | |
| 14:10 | SEQ02 | 2 | |
| SEQCHSEL1 | Bits | Field Name | Channel Select Value |
| 4:0 | SEQ03 | 2 | |
| 9:5 | SEQ04 | 2 | |
| 14:10 | SEQ05 | 4 | |
| SEQCHSEL2 | Bits | Field Name | Channel Select Value |
| 4:0 | SEQ06 | 4 | |
| 9:5 | SEQ07 | 4 | |
| 14:10 | SEQ08 | 12 | |
| SEQCHSEL3 | Bits | Field Name | Channel Select Value |
| 4:0 | SEQ09 | 14 | |
| 9:5 | SEQ10 | X | |
| 14:10 | SEQ11 | X |
A conversion session is initiated by firmware writing to the software start bit (SW_START) in the ADC control register. When the sequence completes all the requested conversions, the sequencer sits idle waiting for another software start bit transition from 0 to 1. The conversion results are placed in the ADC result buffers.
| Buffer Registers | ADC Conversion Result |
|---|---|
| RESULT-00 | ADC-09 |
| RESULT-01 | ADC-10 |
| RESULT-02 | ADC-02 |
| RESULT-03 | ADC-02 |
| RESULT-04 | ADC-02 |
| RESULT-05 | ADC-04 |
| RESULT-06 | ADC-04 |
| RESULT-07 | ADC-04 |
| RESULT-08 | ADC-12 |
| RESULT-09 | ADC-14 |
| RESULT-10 | X |
| RESULT-11 | X |
| RESULT-12 | X |
| RESULT-13 | X |
| RESULT-14 | X |
| RESULT-15 | X |