STMicroelectronics AN2979 Application Note Implementing a simple ADC using the STM8L101xx comparator

This document describes how to build a simple ADC using the STM8L101xx comparator.


STMicroelectronics AN2979 Application Note Implementing a simple ADC using the STM8L101xx comparator - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
12
File format
PDF
File size
292 KB
Published
07 August, 2012
Updated
30 September, 2023
MD5 checksum
CDB53E864B2B8A10D9E10BD8DD6DB972

About this manual

The document details a method for creating an analog-to-digital converter (ADC) by utilizing the internal zero-crossing comparators found in the STM8L101xx family. This approach requires only one external resistor and one capacitor to generate a reference voltage, simplifying the hardware design significantly compared to traditional ADC implementations.

The guide covers both hardware configuration and software implementation. It explains how to connect the comparator inputs to measure an analog signal against an exponentially charging capacitor voltage. The provided software uses Timer 2 to generate a PWM signal for charging the capacitor and interrupts to capture the time when the input voltage exceeds the reference, calculating the digital value based on the RC charge equation.

What's inside

  • Application description
  • Comparator features
  • ADC implementation
  • Software description
  • Hardware description
  • Measurements and calibration

Frequently asked questions

What external components are required to implement the ADC?

The method requires a minimum of one resistor and one capacitor.

What are the resistor and capacitor values used in the demonstration?

The demonstration uses a resistor of 10 kΩ and a capacitor of 100 nF.

Download PDF (292 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →