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
  • Hi, are you using PWM peripheral with EasyDMA properly? I'm running 8-bit PWM at maximum frequency (16MHz) without any problems even during BLE connection, nrf_drv_pwm driver seems to work well (see nrf_drv_pwm_complex_playback function for how to set up 2-buffer swing). If you will be driving PWM "manually" by SW interrupts (e.g. by combination of timers and GPIO states) then you'll obviously experience glitches due to higher interrupt priority of BLE stack (and that's logical, you've purchased nRF52 because of radio, didn't you;) Cheers Jan

  • Sorry I need to be more specific: I can imagine that you will have problems with some PWM playback configurations (e.g. having some "silent" windows like you show on screenshot above) on nRF51 when extensive BLE activity happens. Guys from Nordic could suggest the most optimal way of using PPI, TIMER and GPIOTE to achieve your goal but this is out of my scope. However on nRF52 with its specific driver (which is using PWM peripheral existing only on nRF52 not nRF51) you can make it work easily through nrf_drv_pwm in the latest SDK. At least this is what I see on my demo project.

Reply
  • Sorry I need to be more specific: I can imagine that you will have problems with some PWM playback configurations (e.g. having some "silent" windows like you show on screenshot above) on nRF51 when extensive BLE activity happens. Guys from Nordic could suggest the most optimal way of using PPI, TIMER and GPIOTE to achieve your goal but this is out of my scope. However on nRF52 with its specific driver (which is using PWM peripheral existing only on nRF52 not nRF51) you can make it work easily through nrf_drv_pwm in the latest SDK. At least this is what I see on my demo project.

Children
No Data
Related