 Hello, and welcome to this presentation of the STM32 Analog-to-Digital converter block. It will cover the main features of this block, which is used to convert the external analog voltage-like sensor outputs to digital values for further processing in the digital domain. The Analog-to-Digital converter inside the STM32G0 microcontroller allows the microcontroller to accept an analog value, like from a sensor output, and convert the signal for use in the digital domain. There are up to 19 Analog inputs. The ADC module itself is a 12-bit successive approximation converter with additional oversampling hardware. The oversampling unit pre-processes the data to offload the main processor. It can handle multiple conversions and average them into a single data with an increased data width up to 16 bits. The sampling speed is 2.5 mega-samples per second for 12-bit resolution. The data can be made available either through DMA movement or interrupts. This ADC is designed for low power and high performance. There are a number of triggering mechanisms and the data management can be configured to minimize the CPU workload. The ADC module also integrates an Analog watchdog. The input channel is connected to up to 19 channels capable of converting signals in either single-end or differential mode. The ADCs can convert signals at 2.5 mega-samples per second in 12-bit mode. There are several functional modes which will be explained later. There are also several different triggering methods. In order to offload the CPU, the ADC has an Analog watchdog for monitoring thresholds. The ADC also offers oversampling to extend the number of bits presented in the final conversion value. For power-sensitive applications, the ADC offers a number of low power features. This slide shows the general block diagram of the ADC. The left part describes the Analog front-end based on the Analog multiplexer and the embedded sampling capacitor of the ADC. This sampling time must be enough for the input voltage source to charge the sample and hold capacitor to the input voltage level. The right part is the digital back-end. Samples are stored into a data register that's either read by software or transferred to memory via a DMA channel. Three Analog watchdogs monitor the voltage of selected Analog input with regard to high and low thresholds. When the voltage is not within the guard range, an interrupt may be generated and a trigger event may be signalled to the timer units. Note that the Analog front-end can be power-gated when the ADC is not used and also between acquisitions by using the auto-off function. The ADC supports a deep power down mode. When the ADC is not used, it can be disconnected by a power switch to further reduce the leakage current. When weight mode is active, the ADC's wait until the last conversion data is read or the end of conversion flag is cleared before starting the next conversion. This avoids unnecessary conversions and thus reduces power consumption. The ADC has an automatic power management feature which is called auto-off mode. When auto-off mode is enabled, the ADC is always powered off when not converting and automatically wakes up when a conversion is started by a software or by a hardware trigger. A start-up time is automatically inserted between the trigger event which starts the conversion and the sampling time of the ADC. The ADC is then automatically disabled once the sequence of conversions is complete. Auto-off mode can be combined with the wait mode conversion for applications clocked at low frequency. This combination can provide significant power savings if the ADC is automatically powered off during the wait phase and restarted as soon as the ADCDR register is read by the application. The power consumption is in function of the sampling frequency. For low sampling rates, the current consumption is reduced almost proportionately. The ADC includes the oversampling hardware which accumulates data and then divides without CPU help. The oversampler can accommodate from two to 256 time samples and right shift from one to eight binary digits. The sequencer allows the user to convert either up to 19 channels in ascending or descending order or up to 8 channels in a user-defined order. Two sampling periods can be programmed. Each channel is assigned one of these two values. The ADC offers a self-calibration mechanism for the offset. It's recommended to run the offset calibration on the application if the reference voltage changes more than 10%, so this would include emerging from reset or from a low power state where the analog voltage supply has been removed and reinstated. High temperature excursion may also require to run the offset calibration. The ADC needs a minimum of 1.5 clock cycles for the sampling and 12.5 clock cycles for conversion for 12-bit mode. With a 35 MHz ADC clock it can achieve 2.5 MHz per second. For a higher sampling speed it's possible to reduce the resolution down to 10, 8 or 6 bits. The sampling times listed in this slide in ADC clock cycles are available. Longer sample times ensure that signals having a higher impedance are correctly converted. At a given time, only a pair of possible sampling times is active. For each analog channel, the user is free to select one of these two selected values. The ADC has a selectable clock source. When the system needs to run synchronously, the APB clock source is the best selection. If a slow CPU speed is required but the ADC needs a higher sampling rate, the dedicated ADC clock can be selected. In this case the ADC implements 2 clock domains, P clock and ADC clock and delays are needed to perform the re-synchronization between them. The ADC supports several conversion modes. Single mode which converts only one channel in single shot or continuous mode. Scan mode which converts a complete set of predefined programmed input channels in single shot or continuous mode. This continuous mode converts only a single channel at each trigger signal from the list of predefined programmed input channels. The ADCs support hardware over sampling. They can sample by two to 256 times without CPU support. The converted data is accumulated in a register and the output can be processed by the data shifter and the truncator. This functionality can be used as an averaging function or for data rate reduction and signal-to-noise ratio improvement as well as for basic filtering. Each ADC has three integrated 12-bit analog watchdogs with high and low threshold settings. The ADC conversion value is compared to this window threshold. If the result exceeds the threshold, an interrupt or timer trigger signal can be asserted without CPU intervention. The ADC conversion result is stored in a 16-bit data register. The system can use CPU polling, interrupts or the DMA controller to make use of the conversion data. An overrun flag can be generated if data is not read before the next conversion data is ready. In case of overrun, either the new sample is dropped or the previous sample is overwritten. Each ADC can generate eight different interrupts, ADC ready, end of conversion, end of sequence, end of calibration, analog watchdog, end of sampling, data overrun and channel configuration ready. DMA requests can be generated at each end of conversion when the ADC output data is ready. The ADCs are active in run and sleep modes. In stop mode, the ADCs are not available but the contents of their registers are kept. In standby mode, the ADCs are powered down and must be re-initialized when returning to a higher power state. There's a deep power down mode in each ADC itself which reduces leakage by turning off an on-chip power switch. This is the recommended mode whenever an ADC is not used. The following table shows performance parameters for the ADC. All values are preliminary. This table summarizes the differences between the STM32F0 ADC and the STM32G0 ADC. These peripherals may need to be specifically configured for correct use with the ADCs. Please refer to the corresponding peripheral training modules for more information. Several application notes dedicated to analog to digital converters are available. To learn more about ADCs, you can visit a wide range of webpages discussing successive approximation analog to digital converters.