LPC55S06 MCAN Driver - TimeStamp issue

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

LPC55S06 MCAN Driver - TimeStamp issue

ソリューションへジャンプ
571件の閲覧回数
clkunde
Contributor II

Hello everyone!

I am working in a project using the follow environment:
- LPC55S06JHI48 MCU
- MCUXpresso IDE v11.7.1 [Build 9221] [2023-03-28]
- SDK_2.x_LPC55S06 v3.10

I can not read the timestamp value inside the CAN protocol registers. My project is setup to use CAN 2.0B (extended frame - 29bits ID). At this time I am not working with CAN-FD.

I am using the mcan driver implementation to read the CAN RX buffer.
The User Manual UM11424 says that the timestamp value can be read in the RXTS field (page 779).

clkunde_0-1685652583657.png

I know it is necessary to configure the Timestamp counter configuration resgister (TSCC) as follow on the page 753.

clkunde_1-1685652680477.png

But, looking into the fsl_mcan.c implementation, I could not find any reference to TSCC register. It seems that the mcan driver not initialize this register and there are not any method to configure it.

Looking into LPC55S06.h file, I found the TSCC register declaration, as follow:

clkunde_2-1685653385373.png

I tried to setup the timestamp using direct calls on the registers, but without success. I always read zero for timestamp. 

My question is: mcan driver does not implement timestamp initialization steps?
How can I use CAN timestamp in my received packages, without external timer/counter block in the MCU?

Thank you everyone!!!

Claudio Kunde.

0 件の賞賛
1 解決策
547件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to use the code to read the timestamp value:

CAN0->TSCC=0x01;

......................................
uint32_t temp=CAN0->TSCV&0xFFFF;

Hope it can help you

BR

XiangJun Rong

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
548件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to use the code to read the timestamp value:

CAN0->TSCC=0x01;

......................................
uint32_t temp=CAN0->TSCV&0xFFFF;

Hope it can help you

BR

XiangJun Rong

0 件の賞賛
530件の閲覧回数
clkunde
Contributor II

Hi XiangJun Rong,

Thank you for the support.

The code works fine. But the declaration CAN0->TSCC=0x01; should be used before the CAN interrupts enable and MCAN_EnterNormalMode function.

Now, I am able to read the timestamp counter correctly.

Thank you XiangJun Rong. l wish all the best for you!

0 件の賞賛