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

How do I create a random square wave by use pwm?

Hi , Dear Nordic supports:

  I am using NRF52832 for the iterative development of a product.In the previous generation of products, I used a PWM control LED flashing, whose flashing frequency is fixed and regular.However, in the current latest product, I need it to flash at an unfixed frequency. How can I make the PWM cycle random?

My sdk version: 14.2.0.

Thank you in advance!

  • Hello,

    However, in the current latest product, I need it to flash at an unfixed frequency. How can I make the PWM cycle random?

    Have you seen the PWM Driver example or the PWM Library example?
    From you ticket, it sounds like you will have to change the PWM channel's configuration every so often.
    The former contains multiple demos for generating different PWM functionality, and it sounds like demo 1 might be exactly what you are looking for.

    Please do not hesitate to ask if anything still should be unclear, or in the case that you are experiencing any issues with this.

    Best regards,
    Karl

Related