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

PWM NEXTSTEP event

Say I have the PWM Decoder set to NRF_PWM_STEP_TRIGGERED.  If I use NRF_PWM_TASK_NEXTSTEP to step through a PWM sequence, will an event be generated for each step? I would like to step a servo 5 degrees, perform ADC conversion, then repeat for a total of say 180 degrees.

  • I liked the PPI based PWM signal example you provided. I wanted to use it in my project. I need higher frequency PWM signals, in MHz. With Time Reload value equal to 2, I was able to generate PWM signals of 8MHz (which was impossible to achieve using the pwm drive module).

    Duty cycle doesn't matter, so I used fixed 50% duty-cycle for both signals. Now, what I want to achieve is phase shifting between the two PWM signals. Could you give me a hint how to apply a 90 degree phase shifting between the two PWM signals?

  • Hello,

    I don't think you will be able to do this, because the timer has a base frequency of 16MHz. Hence, you have a tick every 16MHz, which makes it impossible to toggle a pin with period shorter than 8MHz, which is what you are seing now. The problem is that you don't have any shorter time resolution than this. What you describe, with a 90 degrees phase shift would require that you have a resolution of 32MHz (4 ticks per 8MHz period). That is not possible with a 16MHz clock, unfortunately.

    BR,

    Edvin

  • Thanks for the reply.

    How about 4MHz using the 16MHz clock(4 ticks per 4MHz), TIMER_RELOAD = 4? Would that enable us to achieve the 90 degree phase shift? I need to generate the signals just only for 100ms

Related