To configure ADC oversampling or
undersampling using the trigger repeater module, follow this procedure:
- Set up the SOC by writing to
ADCSOCxCTL. Specify one of the two repeater modules (REP1TRIG or REP2TRIG)
as the trigger source.
- Configure the repeater module
by writing to the REPxCTL register:
- Configure
oversampling or undersampling mode using the MODE bit.
- Specify the desired
SOC trigger source in the TRIGGER field.
- If desired, configure
a sync source for the repeater module in the SYNCINSEL field. A sync
event resets all repeater registers to a ready and waiting state,
while preserving NSEL, PHASE and MODE. A software-initiated sync is
also possible by writing 1 to the SWSYNC bit. Table 18-7 contains a list of possible sync sources for the trigger
repeater.
- If desired, clear any
previously set phase and trigger overflow flags by writing to the
PHASEOVF and TRIGGEROVF bits.
- Configure the trigger repeat
count by writing to the REPxN.NSEL register. The repeater module supports up
to 128 repeats for each trigger.
- Configure the repeater phase
delay by writing to the REPxPHASE.PHASE register.
- To configure a re-trigger
spread delay in oversampling mode, write the desired delay value in SYSCLK
cycles to the REPxSPREAD.SPREAD register.
- Configure the PPBLIMIT
register. This register defines how many samples the post-processing block
accumulates before loading the partial sum value in ADCPPBxPSUM into
ADCPPBXSUM.
- The post-processing block
(PPB) and trigger repeater module have independent sync source
configurations. To configure the PPB sync source, write to the
ADCPPBxCONFIG2 register. For more information on how to configure the ADC
post-processing block, see Section 18.8.
Note: When NSEL = 0, the repeater module
essentially acts as a pass-through for SOC triggers, but is still useful for
applying phase delay. SOC triggers are passed through in both oversampling mode and
undersampling mode, even if there are still pending SOCs. In this scenario, the ADC
sets a trigger overflow flag for the individual SOC (ADCSOCOVF1.SOCx), not the
repeater module. When oversampling with NSEL > 0, the ADC sets the oversampled
trigger overflow flag (REPxCTL.TRIGGEROVF) if a trigger arrives while there are
pending SOCs.
When NSEL = 0, the
repeater module does not set the REPxCTL.MODULEBUSY indicator. In this scenario,
the application must make sure that all associated SOC flags have completed
before enabling oversampling or undersampling mode by setting NSEL >
0.
Table 18-7 ADC SYNC Input
ADCPPBxCONFIG2. SYNCINSEL |
Connection from |
0
|
Disable Syncin to PPBx
|
1
|
EPWM1SYNCOUT
|
2
|
EPWM2SYNCOUT
|
3
|
EPWM3SYNCOUT
|
4
|
EPWM4SYNCOUT
|
5
|
EPWM5SYNCOUT
|
6
|
EPWM6SYNCOUT
|
7
|
EPWM7SYNCOUT
|
8
|
EPWM8SYNCOUT
|
9
|
EPWM9SYNCOUT
|
10
|
EPWM10SYNCOUT
|
11
|
EPWM11SYNCOUT
|
12
|
EPWM12SYNCOUT
|
13
|
EPWM13SYNCOUT
|
14
|
EPWM14SYNCOUT
|
15
|
EPWM15SYNCOUT
|
16
|
EPWM16SYNCOUT
|
17
|
EPWM17SYNCOUT
|
18
|
EPWM18SYNCOUT
|
19
|
ECAP1SYNCOUT
|
20
|
ECAP2SYNCOUT
|
21
|
ECAP3SYNCOUT
|
22
|
ECAP4SYNCOUT
|
23
|
ECAP5SYNCOUT
|
24
|
ECAP6SYNCOUT
|
25
|
ECAP7SYNCOUT
|
26
|
INPUTXBAR5
|
27
|
INPUTXBAR6
|
28
|
EtherCATSYNC0
|
29
|
EtherCATSYNC1
|
30-31
|
Reserved
|