Hi,
I want to set up a set of four PWM signals that are delayed at a specified interval, just like how the stepper motors are run but the falling edge of the previous channel signal does not need to be in sync with the rising edge of the next channel signal.
So far, I was able to toggle multiple GPIO pins using a single timer task and multiple GPIO pin events, but those pins always toggle on and off simultaneously. I found this Github repo, but this is for the PPI interface on the nRF52 series. Do you have a similar sample/example for the DPPI interface on the nRF5340? I am having trouble switching the SUBSCRIBE_OUT to SUBSCRIBE_SET and SUBSCRIBE_CLR in the DPPI channel...
In summary, my question is:
1. Can I use a single timer to make four synchronized PWM signals spaced out at a specific interval, or do I need to use all individual timers for each I/O?
2. In the DPPI interface, I am having trouble enabling multiple timer compare channels... Can I use this line to set multiple channels on the same timer?
nrfx_timer_extended_compare(&timer1, NRF_TIMER_CC_CHANNEL0, nrfx_timer_us_to_ticks(&timer1, 1000000), NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false); nrfx_timer_extended_compare(&timer1, NRF_TIMER_CC_CHANNEL1, nrfx_timer_us_to_ticks(&timer1, 1000), NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, false); nrfx_timer_extended_compare(&timer1, NRF_TIMER_CC_CHANNEL2, nrfx_timer_us_to_ticks(&timer1, 500), NRF_TIMER_SHORT_COMPARE2_CLEAR_MASK, false);
3. My biggest concern is how to start each PWM channel in a synchronized way. Is there any helper layer that allows this?
Thanks!
Ted