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

Capture Address and End event in timer0

Hi,

What is the minimum time needed between two capture tasks for the same CC register?

I would like to timestamp the Address and End event of a packet in the same TIMER0->CC register. Currently I have setup the PPI to do this but if I do a readout of the register after each event, it will give the same value.

I use the pre-programmed PPI (channel 26) for Address Event -> Capture CC0 and made a PPI for End Event -> Capture CC0.

  • Hi CR,

    There is no minimum time needed between two capture tasks for the same CC register, as it does not take any time from the task_trigged to capture into CC. Which means that in the way you have configured your PPI, these two events can happen just one timer tick away to have two different values captured.

    There is one catch though, the CPU takes time to read your captured value in the handler (say Tus) and your events must happen atleast Tus away to allow the CPU to read twice without interruption from same timer interrupt handler. If not that distance apart then the below might happen.

    1. entered interrupt due to Address Event
    2. after clearing the event register but before reading CC[0] value End event occured
    3. now you read the CC[0] value in the handler caused by End event and return.
    4. returned to interrupt handler that was caused by Address Event which will now read the latest captured CC value (caused by END event)

    Just use two different CC registers to capture.

Related