www.geehy.com Page 315
Interrupt event
Event flag
Enable control
End of sequence conversion
EOSEQFLG
EOSEQIEN
End of sampling phase
EOSMPFLG
EOSMPIEN
ADC ready
ADCRDYFLG
ADCRDYIEN
Overrun
OVREFLG
OVRIEN
Analog watchdog state reset
AWDFLG
AWDIEN
ADC Overrun
ADC overrun means when the converted data is not read by DMA or CPU on
time, another converted data will take effect.
When EOCFLG bit is 1 but another new conversion has been completed, an
overrun event will occur, and OVREFLG bit of register ADC_STS will be set to 1;
if OVRIEN bit is set to 1, an overrun interrupt will be generated.
It is determined by OVRMAG bit of configuration register ADC_CFG1 that the
data in the ADC data register are held or covered when an overrun event occurs:
OVRMAG is 0: When an overrun event is detected, old data will be
held in ADC_DATA register
OVRMAG is set to 1: When an overrun event is detected, ADC_DATA
register will cover the data by the last converted data
Data Conversion Management
24.3.10.1
No DMA participating in data conversion management
The software controls data conversion. Every time the conversion is completed,
EOCFLG will be set to 1, and the conversion results will be read from
ADC_DATA register. Then OVRMAG bit in ADC_CFG1 register should be 0.
24.3.10.2
No DMA and overrun participating in data conversion management
When one or more channels are converted and each conversion result does not
need to be read, OVRMAG bit will be set to 1, overrun event cannot prevent ADC
conversion and the register ADC_Data only saves the last converted data.
24.3.10.3
DMA management of data conversion
DMA transmission can be used to transmit the conversion results from the data
register to the memory in time to prevent loss of the conversion results in the
ADC_DATA register.
DMA can be enabled by setting DMAEN bit of the register ADC_CFG1 to 1. After
each conversion, a DMA request will be generated to transmit the converted data
of data register to the memory.
When DMA fails to respond to DMA request in time, an overrun event will be
generated, and OVREFLG bit will be set to 1. After that, ADC will not generate
DMA request and DMA will not transmit new conversion results. DMA will start to
work again when OVREFLG bit is cleared.