PWM Tolerance

nRF52840

NCS V 2.2.0

Using the NRFX drivers natively trying to set the PWM to 333uS.

over 20 different units i am seeing this vary form 326 to 335

what is the expected accuracy (tolerance) of the PWM output.

Is there an example of the PWM in NCS that uses the NRFX drivers and not the Zephyr Drivers

Parents
  • Hi Wes,

    Can you check what HFCLK source the PWM is using? Is it HFINT or HFXO? You can check the HFSTAT register to what hf clock source that is used and if the HFCLK is running or not. At least in nRF5SDK, the PWM module would use the less accurate HFINT if the HFXO wasn't started explicitly beforehand. The tolerance of the PWM depends on the clock source that is used. 

    Examples using the nrfx drivers directly can be found here.

    regards

    Jared 

Reply
  • Hi Wes,

    Can you check what HFCLK source the PWM is using? Is it HFINT or HFXO? You can check the HFSTAT register to what hf clock source that is used and if the HFCLK is running or not. At least in nRF5SDK, the PWM module would use the less accurate HFINT if the HFXO wasn't started explicitly beforehand. The tolerance of the PWM depends on the clock source that is used. 

    Examples using the nrfx drivers directly can be found here.

    regards

    Jared 

Children
Related