22.3.15 ADC Programming Model
The ADC configuration registers are considered static and can only be updated when (1) ADC is in SYNC mode and (2) ADC is idle.
ADC is considered busy when it is doing conversions (either the SINGLEACT or SCANACT status flag is high) or when it is warmed up
(one of the following status flags is high: WARM, SINGLEREFWARM, SCANREFWARM). The following registers are considered ADC
configuration registers: CMU_ADCCTRL, ADCn_CTRL, ADCn_SINGLECTRL, ADCn_SINGLECTRLX, ADCn_SCANCTRL,
ADCn_SCANCTRLX, ADCn_SCANINPUTSEL, ADCn_SCANNEGSEL, ADCn_IEN, ADCn_BIASPROG, ADCn_SCANMASK,
ADCn_CAL and ADCn_CMPTHR.
From reset, the ADC is in SYNC mode by default. The user can program the configuration registers as needed. If PRS is to be used,
PRSEN in ADCn_SINGLECTRL/ADCn_SCANCTRL should be set after all other configuration is complete. Once configuration is com-
plete, the ADC is ready to receive triggers.
After the ADC has been used to perform conversions, the user must ensure that the ADC is idle before updating the configuration regis-
ters. The first step is to ensure that no new triggers (PRS) are being issued. It can take a few cycles from when a trigger is received to
when SINGELACT/SCANACT flags go high due to synchronization requirement. If it is unclear when the triggers were issued and if
those are under synchronization or not, the user should add a small delay before checking the status flags. If the SINGLEACT/
SCANACT status flags are high, the corresponding STOP command should be issued and the user should wait until the SINGLEACT/
SCANACT flags go low. If the ADC was warmed up, then the WARMUPMODE should be changed to NORMAL and then the user
should wait on WARM, SINGLEREFWARM and SCANREFWARM flags until those go low. Now the ADC is idle.
Note:
When switching ADCCLKMODE in the ADCn_CTRL register, use the appropriate sequence below:
• SYNC to ASYNC:
1. Disable ADC interrupts
2. Clear the FIFOs
3. Switch the ADCCLKMODE
• ASYNC TO SYNC:
1. Disable ADC interrupts
2. Switch the ADCCLKMODE
3. Clear the FIFOs
The FIFOs are cleared by writing 1 to the ADCn_SCANFIFOCLEAR and ADCn_SINGLEFIFOCLEAR registers.
When switching from ASYNC to SYNC, ensure that the ASYNC clock is turned off before doing the switch.
EFM32JG1 Reference Manual
ADC - Analog to Digital Converter
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 740