timer and ppi on nrf connect sdk

hello Nordic

i work with nrf52832, nrf52840 with ncs 1.9

i have 2 issues, is there some example or guid fo using 2 ppi channels for the same gpiote, one timer pullup the gpio and the other timer pulls the same gpio down .. what functions are a must ?  gpioite_channel allocation is a must or ppi_channel_allocations are enough etc.

second issue is that i use three timers in my code and it looks like one of them does not work ok, 

also if i look at pin toggle in ppk power profiler i see that if i light a led while the sampling then i the gpio (pulled up by ppi and pulled down by spi_done handler) sometimes miss some toggling every some time .. any ideas why ?

hope to read from you soon

best regards

Ziv

Parents
  • Hi,

    i have 2 issues, is there some example or guid fo using 2 ppi channels for the same gpiote, one timer pullup the gpio and the other timer pulls the same gpio down .. what functions are a must ?  gpioite_channel allocation is a must or ppi_channel_allocations are enough etc.

    You will have to define one GPIOTE channel and tow PPI channels. One PPI channel will connect to the TASKS_SET[n] register of the GPIOTE, and the other PPI channel will connect to TASKS_CLR[n].

    second issue is that i use three timers in my code and it looks like one of them does not work ok, 

    Can you elaborate more on what is not working? How do you configure/use the timers? Note that some timer instances are used by protocol stacks (BLE/Thread/Zigbee, etc) if that is used.

    also if i look at pin toggle in ppk power profiler i see that if i light a led while the sampling then i the gpio (pulled up by ppi and pulled down by spi_done handler) sometimes miss some toggling every some time .. any ideas why ?

    Hard to say without more details. Will both set and clear be missed, or only clearing from the spi_done event? In that case it could be some interrupt issues, for instance the interrupt is blocked by other high-priority tasks. Please also post your code to show how the PPI is configured and how you clear the pin in the spi handler.

    Best regards,
    Jørgen

  • ok .. 

    a bit different approach that i am trying .. i wish to have the same timer compare the SET, without clearing the timer and then the second compare event for the CLR will clear the timer (so for example first compare will be for 80 microsec, the second compare will be for 100 microsec and then clearing the timer so actually both events happen every 100 microsec with a small shift between them)

    any idea how to do it ?

    hope to read from you soon

    best regards

    Ziv

Reply
  • ok .. 

    a bit different approach that i am trying .. i wish to have the same timer compare the SET, without clearing the timer and then the second compare event for the CLR will clear the timer (so for example first compare will be for 80 microsec, the second compare will be for 100 microsec and then clearing the timer so actually both events happen every 100 microsec with a small shift between them)

    any idea how to do it ?

    hope to read from you soon

    best regards

    Ziv

Children
No Data
Related