S32K144 FlexCAN

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

S32K144 FlexCAN

2,263 Views
yashwanthk
Contributor II

Hi,

I am working on FLEX CAN in S32K144 EVB. I configured CAN bus to 500 Kbps. I am getting Synchronization error while participating in bus. I configured CAN as per example code given in S32K design studio. I am actually participating in CAN bus with simulator (Other controller) which is configured to 500 kbps. When I communicates with simulator with other controller, I'm getting response from simulator. But when I communicating with S32K144, it is giving synchronization error. I am thinking that S32K144 EVB is not configured to 500 Kbps.

I selected 8 MHz crystal oscillator as CAN clock source.

PSEG2 = 3

PSEG1 = 3

RJW = 3

PROPSEG = 6

PRESDIV = 0

Is there Any modification I have to do in CAN bit parameters to calculate exact baud rate. Please help me. Waiting for your response.

Thanks & Regards,

Yashwanth

2 Replies

1,283 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Yashwanth,

The Bit timing is correct.

Not sure what is Synchronization error. Do you mean FlexCAN is not synchronized to the bus; ESR1[SYNCH]=0.

What is the value of ESR1 and ECR registers?

Do you have the EVB powered by external 12V voltage source, the SBC on the EVB requires external supply.

BR, Petr

1,283 Views
yashwanthk
Contributor II

Hi Stancik,

Thanks for replay...

In ESR1 register SYNCH bit is showing 0 that means CAN is not synchronized with the bus. Actually I'm not using SBC chip as CAN transceiver. I am using other transceiver that is working fine when I tested with other micro controller. 

The ESR1 and ECR values are

ESR1 = 0x00010112

ECR = 00008100

In example interrupts are not enabled but I enabled error interrupts and Bus off interrupts. I am using interrupt method.

When I writing 0x7E0 CAN ID in RAM register in 18 th position. It is storing like

Data Byte 0(DB-0) =  0x01

DB1 = 0xE0

DB2 = 0x00

DB3 = 0x00

but I'm think that it should store like

DB0 = 0x01

DB1 = 0xF0

DB2 = 0x00

DB3 = 0x00

When I write 0x7E8 also it is storing like 0x1EA but it should store like 0x1FA. Why it is storing like that i'm not understanding. 

Please help me. Waiting for your response.

Regards,

Yashwanth

0 Kudos
Reply