This application note describes how to use the STM8S-DISCOVERY touch sensing key and the Beeper peripheral to adjust the frequency of the buzzer. When the STM8S105C6T6 is powered up through a USB cable connected to the host PC, the LED LD1 turns on, indicating that the programming has been successfully completed. Each time the TS1 key is pressed, the Beeper emits a beep at different frequencies (1kHz, 2kHz, and 4kHz). The Beeper stops emitting sound when TS1 is pressed for the fourth time, and it can be restarted by pressing TS1 again.
This document explains how to configure the STM8S105C6T6 microcontroller on the STM8S-DISCOVERY evaluation board to create a 3-beep application. The system uses the touch sensing key TS1 to trigger the Beeper peripheral, which outputs sound at increasing frequencies (1 kHz, 2 kHz, and 4 kHz) with each press. After the third press, the beeper stops, and the cycle restarts on the next press. The LED LD1 indicates successful programming at startup.
| Beeper frequency range | 1 KHz to 4 KHz |
|---|---|
| Microcontroller model | STM8S105C6T6 |
| Touch sensing key | TS1 |
| LED indicator | LD1 |
| Beeper output pin | Port D4 |
Each press triggers the Beeper to emit a beep at a different frequency: 1 KHz, 2 KHz, and 4 KHz respectively.
The buzzer beeps three times in a cycle and stops on the fourth press.
The LED LD1 switches on when the STM8S105C6T6 is powered up.