Using PPI trace with Timer0

Hi,

I tried to implement PPI for a very timing sensitive application. The sample PPI_trace uses the RTC but it is too slow for my application so I'd want ot use timer0 but it seems its instances are in nrfx dependencies. Is there a clean way to use it ?

Best reagrds,

Charles

Parents
  • Hi,

    You will need to replace the  #define RTC NRF_RTC2 with #define TIMER NRF_TIMER2 (or another TIMER instance that is not used).

    Then replace the references in ppi_trace_setup() to use the TIMER instead of the RTC:

    e.g.: nrf_rtc_event_address_get(TIMER, NRF_TIMER_EVENT_COMPARE_0)

    Note: Remember to add #include <hal/nrf_timer.h> from main.c

    Hope this helps.

    Regards,

    Swathy

Reply
  • Hi,

    You will need to replace the  #define RTC NRF_RTC2 with #define TIMER NRF_TIMER2 (or another TIMER instance that is not used).

    Then replace the references in ppi_trace_setup() to use the TIMER instead of the RTC:

    e.g.: nrf_rtc_event_address_get(TIMER, NRF_TIMER_EVENT_COMPARE_0)

    Note: Remember to add #include <hal/nrf_timer.h> from main.c

    Hope this helps.

    Regards,

    Swathy

Children
Related