Question about Flexcan TDCVAL on the S32k148

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

Question about Flexcan TDCVAL on the S32k148

852 Views
sumityadav
Contributor II

Hello,

I am working with the s32k148evb and trying to get CAN FD working with brs enabled. CAN FD works with aribitration phase set to 125Kbps and data phase set to 250kbps. However, when I go higher than 250kbps on the data I start getting errors on the CAN bus. 

BTW: CAN FD with brs disabled works fine at 1mbps. It is only when I enable brs I start seeing errors at any speeds over 250kbps.

After some reading I figured it might have something to do with the transceiver delay compensation. So I enabled it and I used the formulas recommended in the reference manual (Offset=PSEG1+PROGSEG+2) but it still didn't work. I started looking at the TDCVAL and I thought that this value shall measure the same irrespective of the baud rate since it is just measuring the propagation delay through the transceiver. But what I saw was that I was seeing different values with different baud rates. The value got bigger with slower baud rates. Is this expected?

What else should I be looking at to make this work?

I am using Vector CANoe. Also, the external 8MHz oscillator as my PE clock.

Thanks,

Sumit

0 Kudos
1 Reply

723 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Sumit,

the TDCVAL holds the value of measured transceiver loop delay plus TDCOFF value. So if you calculate TDCOFF based on PROPSEG and PSEG1, which obviously vary for different bitrates, then you can see different TDCVAL values for various bitrates. If TDCOFF is still same then TDCVAL should be same. Loop delay is measured and TDCOFF is calculated in PE clock periods.

Generally TDC is not needed if bit time is longer than transceiver propagation delay. If it is enabled then TDCOFF must be properly calculated.   

So be sure both nominal and data bit time is correctly calculated. It is recommended to have same prescaler in nominal and data phase. A CAN tool should be configured to have same sample points as it is on MCU side.

BR, Petr

0 Kudos