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

PWM Sequence loop

Hi,

I read in the documentation that one can loop a complex playback. The way I understood, one could load a first sequence (say seq1) and a second sequence (say seq2) and then loop the whole thing. So this should happen:

seq1->seq2->seq1->seq2->seq1->seq2....

But if I set playback_count=1 I get:

seq1->seq1->seq1.....

if I set playback_count=2 I get:

seq1->seq2->seq1->seq1->seq2->seq1.....

How should I set it up to get continuous alternation between seq1 and seq2 forever?

UPDATE: it only happens like this when the seq2 has only one element. If I add a second element to it, it works as expected with playback_count=1. Is this some kind of bug?

Thanks

Parents
  • Im seeing behavior that may be related. With the goal of playing a series of sequences, the product I'm working on first calls a nrf_drv_pwm_complex_playback then on the NRF_DRV_PWM_EVT_FINISHED event a nrf_drv_pwm_simple_playback is called and given a sequence with length 1. It then does this again for a different third sequence with a longer length. The result is that the sequence with length 1 is called for a very small amount of time (~75 ms). I am toggling GPIOs on NRF_DRV_PWM_EVT_FINISHED, NRF_DRV_PWM_EVT_END_SEQ0, and NRF_DRV_PWM_EVT_END_SEQ1 to indirectly debug the timing. When I change it to length 2 and reduce the repeat counts accordingly the system behaves as expected. Have you tried measuring the timing from those events?

Reply
  • Im seeing behavior that may be related. With the goal of playing a series of sequences, the product I'm working on first calls a nrf_drv_pwm_complex_playback then on the NRF_DRV_PWM_EVT_FINISHED event a nrf_drv_pwm_simple_playback is called and given a sequence with length 1. It then does this again for a different third sequence with a longer length. The result is that the sequence with length 1 is called for a very small amount of time (~75 ms). I am toggling GPIOs on NRF_DRV_PWM_EVT_FINISHED, NRF_DRV_PWM_EVT_END_SEQ0, and NRF_DRV_PWM_EVT_END_SEQ1 to indirectly debug the timing. When I change it to length 2 and reduce the repeat counts accordingly the system behaves as expected. Have you tried measuring the timing from those events?

Children
No Data
Related