Skip to main content
Visitor II
April 19, 2011
Question

Beep function with STM8L Discovery

  • April 19, 2011
  • 1 reply
  • 653 views
Posted on April 19, 2011 at 21:39

Hello,

I want to use the beep function with my STM8L Discovery.

After writing the program to STM8L, I connect the a piezo speaker between PA0 and GND.

The program is as following:

// Initialize

    BEEP_LSICalibrationConfig(16000000);

    BEEP_Init(BEEP_Frequency_1KHz);

//Beep

    BEEP_Cmd(ENABLE);

    delay_ms(200);

    BEEP_Cmd(DISABLE);

But it doesn't work.

Do I need something another command on Initialization process ?

I know the PA0 is connected to the SWIM. Is it affect something bad for the beeper function?
    This topic has been closed for replies.

    1 reply

    Visitor II
    June 1, 2011
    Posted on June 01, 2011 at 11:46

    Perhaps you need something like this:

    CLK_PeripheralClockConfig(CLK_Peripheral_BEEP, ENABLE);