AT32WB415
Series Reference Manual
2022.04.13
Page 256
Ver 2.00
18.4.5 Voltage monitoring
The OCVMEN bit or PCVMEN bit in the ADC_CTRL1 register is used to enable voltage monitoring based
on the converted data.
The VMOR bit will be set if the converted result is outside the high threshold (ADC_VMHB register) or
less than the low threshold (ADC_VMLB register).
The VMSGEN bit in the ADC_CTRL1 register is used to enable voltage monitor on either a single
channel or all the channels. The VMCSEL bit is used to select a specific channel that requires voltage
monitoring.
Voltage monitoring is based on the comparison result between the original converted data and the 12-
bit voltage monitor boundary register, irrespective of the PCDTOx and DTALIGN bits.
18.4.6 Status flag and interrupts
Each of the ADCs has its dedicated ADCx_STS reisters, that is, OCCS (ordinary channel conversion
start flag), PCCS (preempted channel conversion start flag), PCCE (preempted channel conversion end
flag), OCCE (ordinary channel conversion end flag) and VMOR (voltage monitor out of range).
PCCE, CCE and VMOR have their respective interrupt enable bits. Once the interrupt bits are enabled,
the corresponding flag is set and an interrupt is sent to CPU.
18.5 ADC registers
lists ADC register map and their reset values.
These peripheral registers must be accessed by word (32 bits).
Table 18-2 ADC register map and reset values
Register name
Offset
Reset value
ADC_STS
0x000
0x0000 0000
ADC_CTRL1
0x004
0x0000 0000
ADC_CTRL2
0x008
0x0000 0000
ADC_SPT1
0x00C
0x0000 0000
ADC_SPT2
0x010
0x0000 0000
ADC_PCDTO1
0x014
0x0000 0000
ADC_PCDTO2
0x018
0x0000 0000
ADC_PCDTO3
0x01C
0x0000 0000
ADC_PCDTO4
0x020
0x0000 0000
ADC_VMHB
0x024
0x0000 0FFF
ADC_VMLB
0x028
0x0000 0000
ADC_OSQ1
0x02C
0x0000 0000
ADC_OSQ2
0x030
0x0000 0000
ADC_OSQ3
0x034
0x0000 0000
ADC_PSQ
0x038
0x0000 0000
ADC_PDT1
0x03C
0x0000 0000
ADC_PDT2
0x040
0x0000 0000
ADC_PDT3
0x044
0x0000 0000
ADC_PDT4
0x048
0x0000 0000
ADC_ODT
0x04C
0x0000 0000