CAN接口不能正常发送CAN消息,MCU CAN引脚到CAN Transceiver使用示波器不能抓取到正确的波形。最终收发器也不能正常发送出去波形。
2、MCU:TMS570LS2135 PGE封装
3、CAN接口逻辑电路设计:
CAN收发器相关设计(如下为CAN1的收发器,与上稍有差异)
3、Halcogen设置:
1)Halcogen上仅使能CAN1和CAN2 Driver
2)设置CAN2邮箱,仅测试MessageBox1,波特率设置500Kbps
4 测试代码:仅在sysmain中使用如下代码:
5、单步跟踪发送函数后其寄存器的值如下:
Ctrl 0x00031402 Config register [Memory Mapped]
ErrStat 0x00000007 Status register [Memory Mapped]
ErrCnt 0x00000000 Error Counter Register [Memory Mapped]
Btr 0x00001453 Bit Timing_BRP Extension Register [Memory Mapped]
IntR 0x00000000 Interrupt Register [Memory Mapped]
Test 0x00000080 Test Register [Memory Mapped]
ParErr 0x00000140 Parity Error Code Register [Memory Mapped]
Rel 0xA3170504 Core Release Register [Memory Mapped]
AboT 0x00000000 Auto Bus On Time [Memory Mapped]
TrReqX 0x00000000 Transmission Request X [Memory Mapped]
TrReq12 0x00000000 Transmission Request 2-1 [Memory Mapped]
TrReq34 0x00000000 Transmission Request 4-3 [Memory Mapped]
TrReq56 0x00000000 Transmission Request 6-5 [Memory Mapped]
TrReq78 0x00000000 Transmission Request 8-7 [Memory Mapped]
NewDatX 0x00000000 New Data X [Memory Mapped]
NewDat12 0x00000000 New Data 2-1 [Memory Mapped]
NewDat34 0x00000000 New Data 4-3 [Memory Mapped]
NewDat56 0x00000000 New Data 6-5 [Memory Mapped]
NewDat78 0x00000000 New Data 8-7 [Memory Mapped]
IntPenX 0x00000000 Interrupt Pending X [Memory Mapped]
IntPen12 0x00000000 Interrupt Pending 2-1 [Memory Mapped]
IntPen34 0x00000000 Interrupt Pending 4-3 [Memory Mapped]
IntPen56 0x00000000 Interrupt Pending 6-5 [Memory Mapped]
IntPen78 0x00000000 Interrupt Pending 8-7 [Memory Mapped]
MsgValX 0x00000001 Message Valid X [Memory Mapped]
MsgVal12 0x00000001 Message Valid 2-1 [Memory Mapped]
MsgVal34 0x00000000 Message Valid 4-3 [Memory Mapped]
MsgVal56 0x00000000 Message Valid 6-5 [Memory Mapped]
MsgVal78 0x00000000 Message Valid 8-7 [Memory Mapped]
IntPndMx12 0x00000000 IntPndMux 2-1 [Memory Mapped]
IntPndMx34 0x00000000 IntPndMux 4-3 [Memory Mapped]
IntPndMx56 0x00000000 IntPndMux 6-5 [Memory Mapped]
IntPndMx78 0x00000000 IntPndMux 8-7 [Memory Mapped]
If1Cmd 0x00870001 If1 Command Mask / Command Request Register [Memory Mapped]
If1Msk 0xE00007FF If1 Mask Register [Memory Mapped]
If1Arb 0xE0000001 If1 Arbitation Register [Memory Mapped]
If1MsgCtrl 0x00001008 If1 Message Control Register [Memory Mapped]
If1DatA 0x00000000 If1 Data A Register [Memory Mapped]
If1DatB 0x00000000 If1 Data B Register [Memory Mapped]
If2Com 0x00170001 If2 Command Mask / Command Request Register [Memory Mapped]
If2Msk 0xFFFFFFFF If2 Mask Register [Memory Mapped]
If2Arb 0x00000000 If2 Arbitation Register [Memory Mapped]
If2MsgCtrl 0x00000000 If2 Message Control Register [Memory Mapped]
If2DatA 0x00000000 If2 Data A Register [Memory Mapped]
If2DatB 0x00000000 If2 Data B Register [Memory Mapped]
If3Obs 0x00000000 If3 Observation Register [Memory Mapped]
If3Msk 0xFFFFFFFF If3 Mask Register [Memory Mapped]
If3Arb 0x00000000 If3 Arbitation Register [Memory Mapped]
If3MsgCtrl 0x00000000 If3 Message Control Register [Memory Mapped]
If3DatA 0x00000000 If3 Data A Register [Memory Mapped]
If3DatB 0x00000000 If3 Data B Register [Memory Mapped]
If3Upd12 0x00000000 Update enable 2-1 Register [Memory Mapped]
If3Upd34 0x00000000 Update enable 4-3 Register [Memory Mapped]
If3Upd56 0x00000000 Update enable 6-5 Register [Memory Mapped]
If3Upd78 0x00000000 Update enable 8-7 Register [Memory Mapped]
IoCtrlTx 0x0004000E TX IO Control Register [Memory Mapped]
IoCtrlRx 0x00040009 RX IO Control Register [Memory Mapped]
6、对比测试:
1)我们现在测试的两块板子都有如此问题,不能正常发送CAN。使用内部还回测试是正常的。
2)使用3137开发板,按照如上方式建立最简单的工程,测试是成功的。