Time tick for syslog

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Time tick for syslog

440 Views
dotangoldberg
Contributor II

Hello,

I'm building a small syslog task on FRDM64F board

For each input string i want to add a time stamp with higher resolution then the RTOS time tick (1 msec)

What is the optimal way to get the highest resolution time stamp? (preferably higher then micro seconds)

Thanks! 

Tags (1)
0 Kudos
1 Reply

354 Views
mjbcswitzerland
Specialist V

Hi

I find a very high resolution time stamp can be easily generated by letting a PIT timer channel run with a reload value of 0xffffffff.

The time stamp value is

unsigned long time_tamp = (0xffffffff - PIT_CVALn); // n is the PIT channel

The PIT runs from the bus clock so you have the same resolution as that (eg. 16.667ns at 60MHz).

The PIT will of course overflow after 71.58s (at this speed) but you can also add an overflow counter (PIT interrupt) to make an unsigned long long value for the time stamp which will run for 9'775 years.....(with 16.667ns resolution).

Regards

Mark

0 Kudos