cancel
Showing results for 
Search instead for 
Did you mean: 

Beep Function in STM8S003k3

cv-chung
Associate
Posted on September 30, 2015 at 05:06

Dear All

I have a STM8S Discovery board. I want to config PD4 with Beep function.

/*Initialize PD4 for beep signal */

GPIO_Init(GPIOD, GPIO_PIN_4, GPIO_MODE_OUT_PP_HIGH_FAST);

BEEP_Init(BEEP_FREQUENCY_1KHZ);

BEEP_Cmd(ENABLE);

 

When I check signal of PD4 but don't have output frequency with 1Khz.

Please help me.

Thanks

2 REPLIES 2
ranajay
Associate
Posted on March 09, 2016 at 06:35

Thomas G
Associate II
Posted on August 30, 2017 at 21:54

Hi

I'm didn't look up the code behind BEEP_Init(), but I guess that the STM8 library requires

BEEP_AutoLSICalibration() (or similar) to be used for setting the BEEPDIV[4:0] bits in BEEP_CSR.

It's also likely that the GPIO_Init() line is unnecessary.

the following STM8EF code is known to work on the STM8S003F3:

https://github.com/TG9541/stm8ef/wiki/Board-W1401#beeper