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

Can I use the same compare to generate 2 gpio ppi event?

Can I initial like below to generate 2 opposition PWM waves on 2Pins?

/* Configure PPI channel 0 to toggle PWM_OUTPUT_PIN on every Timer 2 COMPARE[0] match. */
NRF_PPI->CH[0].EEP  = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[0];
NRF_PPI->CH[0].TEP  = (uint32_t)&NRF_GPIOTE->TASKS_OUT[0];

/* Configure PPI channel 1 to toggle PWM_OUTPUT_PIN on every Timer 2 COMPARE[0] match. */
NRF_PPI->CH[1].EEP  = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[0];
NRF_PPI->CH[1].TEP  = (uint32_t)&NRF_GPIOTE->TASKS_OUT[1];

Thanks!

Parents
  • In short yes. This quote is from the end of section 15.1 of the Reference Manual:

    One event can trigger multiple tasks by using multiple channels and one task can be triggered by multiple events in the same way.

Reply
  • In short yes. This quote is from the end of section 15.1 of the Reference Manual:

    One event can trigger multiple tasks by using multiple channels and one task can be triggered by multiple events in the same way.

Children
No Data