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

How to adjust PWM frequency (SDK11 nRF52)

I would like write music box by buzzer. So I need adjust the PWM frequency continuously. But i don't find the sample cede which is about adjust PWM frequency in SDK. Where can i get the related information ? thanks a lot.

Parents
  • Hi Climent

    If I understand you correctly what you are looking for is just a function to make a square wave on a certain frequency?

    If so I think it might be easiest to do without using the PWM driver, rather by hooking up a timer to a GPIO using the PPI and GPIOTE peripherals. Then you can control the frequency by adjusting the CC registers of the timer directly.

    Best regards

Reply
  • Hi Climent

    If I understand you correctly what you are looking for is just a function to make a square wave on a certain frequency?

    If so I think it might be easiest to do without using the PWM driver, rather by hooking up a timer to a GPIO using the PPI and GPIOTE peripherals. Then you can control the frequency by adjusting the CC registers of the timer directly.

    Best regards

Children
No Data
Related