High-accuracy timing for long periods

Technical discussions around xCORE processors (e.g. General Purpose (L/G), xCORE-USB, xCORE-Analog, xCORE-XA).
Experienced Member
Posts: 106
Joined: Wed May 31, 2017 6:55 pm

High-accuracy timing for long periods

Postby CousinItt » Sat Mar 02, 2019 1:52 pm

Hi all,

I need to measure the periods between successive rising (or falling) edges on a single-bit port. I'd like to use input timestamps for maximum accuracy, but the port counters are only 16 bits wide and so can only work for intervals that are too short. Timers are 32-bits wide but, there are delays between the triggering event and the timer being read, leading to more uncertainty than with timestamping. Reducing the clock rate would give an unacceptable loss of precision.

I'm wondering if combining a timer with input timestamping would solve this. The port counter can roll over any number of times between edges, but the edges are precisely timestamped. The timer can provide the nearest multiple of the rollover period and the timestamps can be used fine-tune the result.

Has anyone tried something similar? Is there an alternative approach I've missed?

Who is online

Users browsing this forum: No registered users and 0 guests