STMicroelectronics AN3280 Application Note STM8S-DISCOVERY LED Display

This application note provides a short description of how to use the ADC, Timer and GPIO peripherals to display a variable voltage on a bar of LEDs. It introduces the main features of the STM8S-DISCOVERY development board and provides information on hardware requirements, application principle, and software description.


STMicroelectronics AN3280 Application Note STM8S-DISCOVERY LED Display - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
13
File format
PDF
File size
154 KB
Published
06 August, 2012
Updated
29 September, 2023
MD5 checksum
85E0FE2FF842EB4789E0F6AB632B2B9C

About this manual

The document details an application where the average voltage from a variable resistor (RV1) is measured using the ADC1 peripheral triggered by TIM1. The resulting measurement is visually represented by lighting up LEDs (LD2-LD5) based on specific voltage thresholds.

The software implementation avoids standard libraries, configuring ADC1 for single conversion mode with external triggering and left alignment. TIM1 manages the wake-up of the ADC to allow stabilization time before conversion starts. GPIO pins control the output state of the four LEDs.

What's inside

  • Application description
  • Hardware requirements
  • Application schematic
  • Application principle
  • Software description
  • ADC1 configuration
  • TIM1 configuration
  • GPIO configuration
  • Revision history

Specifications

External LEDs required4LEDs: LD2, LD3, LD4, LD5
Filter capacitor value100 nF
ADC Clock SpeedFmaster/8

Frequently asked questions

What voltage range corresponds to no LEDs being on?

No LEDs are switched on when the input voltage is between 0.0V and 0.7V.

Which LEDs light up at a voltage of 3-4V?

At a voltage between 3V and 4V, LEDs LD2, LD3, and LD4 are switched on.

Download PDF (154 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →