Migrating from PPI to DPPI

I'm trying to port a PPI application to an nrf5340. I'm quite puzzled, as it would appear there is no obvious way to achieve what I'm trying to do.

In short, I have a setup where the events E should trigger tasks T accordingly to the relation below. Events originate by timers (E1-4 TIM3, E5 TIM4), and the tasks are simple GPIOTE clear/set

e1 --> t1,t5
e2 --> t2,t6
e3 --> t3,t5
e4 --> t4,t6
e5 --> t2,t4,t6

I'm using the gppi API, as I would like to support both nrf52 and nrf53 families. As far as I understand DPPI does not allow to associate multiple channels to the same task/event. This seems to make it impossible to achieve, as either tasks or events need to be connected to multiple channels.

I think I'm missing something since this was feasible with PPI and does not seem like a very strange use case to me :D

Thanks!

Parents Reply
  • I think you should be able to use an EGU peripheral to form additional "edges" between channels (up to 16 per EGU instance). From what I see, DPPI groups as Maria suggests are more meant as a way to be able to enable/disable channels also from DPPI events, but not a way to give flexibility to event/task connectivity.

    Example:

    DPPI channel 0: e1 -> t1 & EGU.TASKS[0]

    DPPI channel 1: e2 & EGU.EVENTS[4] -> t2 & EGU.TASKS[1]

    DPPI channel 2: e3 -> t3 & EGU.TASKS[2]

    DPPI channel 3: e4 & EGU.EVENTS[5] -> t4 & EGU.TASKS[3]

    DPPI channel 4: EGU.EVENTS[0] & EGU.EVENTS[2] -> t5

    DPPI channel 5: EGU.EVENTS[1] & EGU.EVENTS[3] -> t6

    DPPI channel 6: e5 -> TIMER3->CLEAR & EGU.TASKS[4] & EGU.TASKS[5]

    Then also configure a SHORTS from your TIMER4 CC0 to TIMER4 CLEAR.

    See the following illustrature. Circles are DPPI channels and the horizontal lines are EGU task/events pairs.

Children
Related