This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM driving a Buzzer

I am using SDK V15 with an nRF52DK and Keil compiler.

I have difficulty finding an example to use a GPIO to drive a Piezo Buzzer. The requirement is very simple: use a GPIO to generate a sound frequency of about 18 Khz to the Buzzer.

The PWM examples in the SDK are so convoluted and difficult to understand. I looked at other examples in the forum and many are outdated, some cannot be compiled, others are compiled but crashed, etc..

I would appreciate if someone can provide a simple example to drive a Buzzer at 18 Khz.

Related