This application note describes how to use the STM8S microcontroller's analog-to-digital converter, including how to configure the ADC registers and microcontroller resources, and how to use the different operating modes of the ADC.
This document provides a comprehensive guide on utilizing the Analog to Digital Converter (ADC) implemented within the STM8S family of microcontrollers. It details the configuration of ADC registers and resources required for various operational modes.
The note covers both basic (ADC2) and extended (ADC1) ADC types, explaining features such as resolution, clock selection, conversion triggers, data storage options including buffers, and special functions like analog watchdogs and scan modes. It also includes practical application examples involving hardware connections and firmware implementation.
| Resolution | 10-bit |
|---|---|
| Clock speed range | 1 to 4 or 6 MHz |
| Number of input channels | Up to 16 |
| Data format alignment | Optional left or right |
The ADC can operate in single mode, where it stops after one conversion, or continuous mode, where it continues converting.
The reference voltage must be between 2.75V and Vppa, though some packages use internal references.