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

Issues with PWM on nRF52

I have encountered two issues while using the NRF PWM driver on the nRF52 DK, with or without SoftDevice S132, along with SDK v11.0.0

The first one is the use of the NRF_DRV_PWM_PIN_INVERTED flag. Looking at the oscilloscope, I don't see the waveform's polarity changed, whether I OR the pin output number with the flag or not.

The second is stepping through a looped sequence. I never see the last duty value of my sequence being applied.

What could be going wrong, or what could I be missing here?

Below is the main.c I used to produce the issues without SoftDevice. It should run by just replacing main.c in peripheral\pwm_driver example. main.c

Parents
  • Hi,

    I have still the same problem. I am using a similar PWM_driver example and no matter if I use | 0x8000 or the NRF_DRV_PWM_PIN_INVERTED flag, the polarity of my pin do not change and I cannot see any polarity change in the oscilloscope. I am using an nrf52840 dongle.

    I plan two build two PWM signals that the user is able to change not only the duty cycle of that but also make an arbitrary phase-shift between the two signals.

    Could you guys help me with the polarity problem?
    Besides, any suggestion regarding the phase shift and how to build that would be appreciated.

    Thanks,

Reply
  • Hi,

    I have still the same problem. I am using a similar PWM_driver example and no matter if I use | 0x8000 or the NRF_DRV_PWM_PIN_INVERTED flag, the polarity of my pin do not change and I cannot see any polarity change in the oscilloscope. I am using an nrf52840 dongle.

    I plan two build two PWM signals that the user is able to change not only the duty cycle of that but also make an arbitrary phase-shift between the two signals.

    Could you guys help me with the polarity problem?
    Besides, any suggestion regarding the phase shift and how to build that would be appreciated.

    Thanks,

Children
Related