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.
- 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 15.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.