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

Reply
  • 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

Children
Related