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

High frequency PWM shifts phase when radio is active

image description

When setting up a 1Mhz square wave using NRF_PWM on the NRF52 or GPIOTE on the NRF51 while BLE is advertising, the PWM stops when the radio is active. The problem doesn't happen when the frequency is below 6khz. No PWM interrupt is enabled. Is this an unavoidable limitation with high PWM frequencies?

Parents
  • Well as PWM is basically digital interface could you use some fast digital analyzer e.g. Saleae Logic PRO? They are cheap (usually available at each bigger lab) and they can sample at >8MHz frequency for longer time (I routinely use Saleae Logic PRO at 50MHz to capture >5min sequences). You should then see where and how PWM output is corrupted. I'd still say that your "bare metal" example (writing directly to the registers) above isn't enough. PWM on nRF52 is able to "play" set of values in the loop thanks to the "decoder" and 2 "sequence" buffers but I don't see it used in your code (which is probably compatible with nRF51?). I'd suggest to look on nRF52 specific driver as suggested in my answer.

    Cheers

Reply
  • Well as PWM is basically digital interface could you use some fast digital analyzer e.g. Saleae Logic PRO? They are cheap (usually available at each bigger lab) and they can sample at >8MHz frequency for longer time (I routinely use Saleae Logic PRO at 50MHz to capture >5min sequences). You should then see where and how PWM output is corrupted. I'd still say that your "bare metal" example (writing directly to the registers) above isn't enough. PWM on nRF52 is able to "play" set of values in the loop thanks to the "decoder" and 2 "sequence" buffers but I don't see it used in your code (which is probably compatible with nRF51?). I'd suggest to look on nRF52 specific driver as suggested in my answer.

    Cheers

Children
No Data
Related