Analog-to-digital converter (ADC) RM0033
238/1381 RM0033 Rev 9
10.11 Battery charge monitoring
The VBATE bit in the ADC_CCR register is used to switch to the battery voltage. As the
V
BAT
voltage could be higher than V
DDA
, to ensure the correct operation of the ADC, the
V
BAT
pin is internally connected to a bridge divider by 2. This bridge is automatically enabled
when VBATE is set, to connect V
BAT
/2 to the ADC1_IN18 input channel. As a consequence,
the converted digital value is half the V
BAT
voltage. To prevent any unwanted consumption
on the battery, it is recommended to enable the bridge divider only when needed, for ADC
conversion.
10.12 ADC interrupts
An interrupt can be produced on the end of conversion for regular and injected groups,
when the analog watchdog status bit is set and when the overrun status bit is set. Separate
interrupt enable bits are available for flexibility.
Two other flags are present in the ADC_SR register, but there is no interrupt associated with
them:
• JSTRT (Start of conversion for channels of an injected group)
• STRT (Start of conversion for channels of a regular group)
Table 37. ADC interrupts
Interrupt event Event flag Enable control bit
End of conversion of a regular group EOC EOCIE
End of conversion of an injected group JEOC JEOCIE
Analog watchdog status bit is set AWD AWDIE
Overrun OVR OVRIE