MPC5634M Flex Can send error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5634M Flex Can send error

1,145 次查看
413515651
Contributor I

When I send one message The CAN module Send one more frame:

pastedImage_1.png

My Send Code is:

if( CAN_C.BUF[ch].CS.B.CODE ==0x8 
|| CAN_C.BUF[ch].CS.B.CODE ==0x0 
) //发送缓冲为空或者未使用的话
{
CAN_C.BUF[ch].CS.B.IDE = ide; /* Use standard ID length */
if(ide == 1)
{
CAN_C.BUF[ch].ID.R = id; /* Transmit ID is 555 */
}
else
{
CAN_C.BUF[ch].ID.B.STD_ID = id; 
}
CAN_C.BUF[ch].CS.B.RTR = 0; /* Data frame, not remote Tx request frame */
CAN_C.BUF[ch].CS.B.LENGTH = length ; /* # bytes to transmit w/o null */
for (i=0; i<length; i++) {
CAN_C.BUF[ch].DATA.B[i] = *(data+i); /* Data to be transmitted */
}
CAN_C.BUF[ch].CS.B.SRR = 1; /* Tx frame (not req'd for standard frame)*/
//CAN_C.IFRL.B.BUF01I = 1;
CAN_C.BUF[ch].CS.B.CODE =0xC; /* Activate msg. buf. to transmit data frame */
//while(CAN_C.IFRL.B.BUF01I ==0);

}
else 
{
;
}

The memory:

pastedImage_1.png

I found ,when the first byte to be sent is 0xff、0xfe.... The error ;other byte will be ok!

0 项奖励
回复
1 回复

1,019 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

From the description it is not clear what is the issue in fact.

From the memory window it looks single message buffer is used to transmit extended ID frame with 8 byte payload.

You wrote “When I send one message The CAN module Send one more frame”. Does it mean you see 2 frames on the bus?

Do you have scope picture to see bus signals?

The analyzer (USBCAN1) window shows quite strange data, it is properly configured?

BR, Petr

0 项奖励
回复