The key ADC registers and flags
In this section, we will explore the characteristics and functions of some of the crucial registers within the ADC peripheral.
Let’s start with ADC Control Register 1 (ADC_CR1
).
ADC Control Register 1 (ADC_CR1)
This is one of the main control registers that’s used to configure the ADC’s operational settings. It provides various configuration options, such as resolution, scan mode, discontinuous mode, and interrupt enable.
The following are the key bits in this register:
- RES[1:0] (resolution bits): These bits set the resolution of the ADC (12-bit, 10-bit, 8-bit, or 6-bit)
- SCAN (scan mode): Setting this bit enables scan mode, allowing the ADC to convert multiple channels in sequence
- DISCEN (discontinuous mode): When set, this bit enables discontinuous mode on regular channels
- AWDEN (Analog Watchdog enable): This bit enables the Analog Watchdog on all regular channels
- EOCIE (end of conversion interrupt...