cancel
Showing results for 
Search instead for 
Did you mean: 

Beep function with STM8L Discovery

infiniium
Associate
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?
1 REPLY 1
lowpowermcu
Associate II
Posted on June 01, 2011 at 11:46

Perhaps you need something like this:

CLK_PeripheralClockConfig(CLK_Peripheral_BEEP, ENABLE);