CAN Timestamp

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,923件の閲覧回数
fernando_barrio
Contributor III

Hi,

I am trying to create a function that will check when the last CAN message was received, and if it has not been received within x amount of time an action will be take. My question is how do I get the current time, to be able to see the difference between the CAN Timestamp and current time? Also is this timestamp in seconds?

Thank you in advance,

Fernando

タグ(1)
1 解決策
2,733件の閲覧回数
constantinrazva
NXP Employee
NXP Employee

Hello fernando.barrios@uwaterloo.ca‌, dumitru-daniel.popa‌,

Sorry for the delayed answer on this topic, I missed it; I think it was answered here . To answer the question, here is the output of the CAN block:

pastedImage_1.png

This timestamp is part of the MB structure (2B long), and is a value that the free running timer returns.

pastedImage_2.png

The TIMER_SRC bit (from CAN_CTRL2) is negated, thus the free running timer is clocked by the CAN bit-clock (the one that defines the baud rate on the CAN bus). This timer increments by one after each bit (received/transmitted); when there is no message on the bus, it counts using the programmed baud rate.

You can find out more details in the reference manual, in FlexCAN -> Functional description -> CAN protocol related features -> Timestamp. 

Kind regards,

Razvan.

元の投稿で解決策を見る

3 返答(返信)
2,732件の閲覧回数
dumitru-daniel_
NXP Employee
NXP Employee

constantinrazvan.chivu‌,

Please have a look over this. Is it still an issue ?

0 件の賞賛
2,734件の閲覧回数
constantinrazva
NXP Employee
NXP Employee

Hello fernando.barrios@uwaterloo.ca‌, dumitru-daniel.popa‌,

Sorry for the delayed answer on this topic, I missed it; I think it was answered here . To answer the question, here is the output of the CAN block:

pastedImage_1.png

This timestamp is part of the MB structure (2B long), and is a value that the free running timer returns.

pastedImage_2.png

The TIMER_SRC bit (from CAN_CTRL2) is negated, thus the free running timer is clocked by the CAN bit-clock (the one that defines the baud rate on the CAN bus). This timer increments by one after each bit (received/transmitted); when there is no message on the bus, it counts using the programmed baud rate.

You can find out more details in the reference manual, in FlexCAN -> Functional description -> CAN protocol related features -> Timestamp. 

Kind regards,

Razvan.

2,733件の閲覧回数
fernando_barrio
Contributor III

Hi constantinrazvan.chivu‌,

Yes you did answer it on my other post, this explanation is helpful though I really appreciate it.

Thank you,

Fernando

0 件の賞賛