STMicroelectronics AN3252 STM8L-DISCOVERY Wave Generator Application Note

This application note provides a short description of how to use the STM8L-DISCOVERY as a basic wave generator for various waveforms such as sine, sinc (sin(x)/x), square, ramp and sawtooth signals. More generally, this document describes STM8L on-chip DAC (digital-to-analog converter) peripheral settings when used with the DMA (direct memory access) controller.


STMicroelectronics AN3252 STM8L-DISCOVERY Wave Generator Application Note - cover page
Brand
STMicroelectronics
Document type
Application Note
Language
English
Pages
21
File format
PDF
File size
272 KB
Published
06 August, 2012
Updated
30 September, 2023
MD5 checksum
5FAB7B43D54AD2428B15ED94CE49D1A8

About this manual

This document explains how to configure the STM8L-DISCOVERY evaluation board to generate various periodic waveforms such as sine, sinc (sin(x)/x), square, ramp, and sawtooth signals. The application utilizes the microcontroller's on-chip Digital-to-Analog Converter (DAC) peripheral in conjunction with the Direct Memory Access (DMA) controller.

What's inside

  • Application description
  • Hardware required
  • STM8L-DISCOVERY hardware settings
  • Waveform generation and frequency ranges
  • Known limitations
  • Using the wave generator
  • Software description
  • STMB8L peripherals used

Specifications

Supported WaveformsRamp, Square, SineC (sin(x)/x), Sine, Sawtooth
Frequency Range30 Hz to 22.5 kHz
Resolution Tables65 and 130 samples
Output Voltage Range0 to 3 V

Frequently asked questions

What hardware is required for this application?

The STM8L-DISCOVERY evaluation board, specifically using its on-board LEDs, LCD display, and USER push-button.

How are the waveforms generated?

Waveforms are generated by storing sample tables in Flash memory and sending them cyclically to the DAC using a DMA transaction synchronized by TIM4 timer.

What is the formula for calculating the DAC output value?

The DAC output is calculated as Vout = 3V * (DOR / 4096), where DOR is the 12-bit digital sample value.

Download PDF (272 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →