The buzzer pin of STM8L051 shares the same pin with the swin debugging port. Although the debugging function cannot be used when beep is used (after the program is downloaded, disconnect the debugging swin and restart it to output), the program can still be burned into the MCU. (**Note** You can use the beep function without setting the option bit)
Here is the code for the library function:
void BeepInit()
{
// BEEP_LSClockToTIMConnectCmd(ENABLE);
CLK_PeripheralClockConfig(CLK_Peripheral_BEEP,ENABLE);
// BEEP_LSICalibrationConfig(38000);
CLK_BEEPClockConfig(CLK_BEEPCLKSource_LSI);
BEEP_Init(BEEP_Frequency_1KHz);
BEEP_Cmd(ENABLE);
}
Previous article:STM8L051 ADC+DMA two-channel data sampling misalignment problem
Next article:stm8L051 uses the library to build a project
Recommended ReadingLatest update time:2024-11-23 15:17
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Hand-drawn illustrations revealing the secrets of communication circuits and sensor circuits (Mims III)
- Hand-drawn revealing the basic principles and symbols of electronic circuits
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- DSP's various lords
- Hong Kong CSF car entertainment system becomes the global hot spot for purchasing electronic products.
- Unboxing K210 and ESP32S2
- What is the name of this insulation sheet?
- cpld realizes phase-locked loop frequency synthesis
- LCD1502 Driver
- Power conversion type analysis
- Please help me write a testbench
- The difference between immersion gold plate and gold-plated plate
- ModBus CRC check code calculation program