Skip to main content
Visitor II
September 30, 2015
Question

Beep Function in STM8S003k3

  • September 30, 2015
  • 2 replies
  • 1077 views
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

    This topic has been closed for replies.

    2 replies

    Visitor II
    March 9, 2016
    Posted on March 09, 2016 at 06:35

    Visitor II
    August 30, 2017
    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