Time tick for syslog

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Time tick for syslog

955件の閲覧回数
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! 

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 返信

869件の閲覧回数
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 件の賞賛
返信