Other Parts Discussed in Thread: HALCOGEN
Hi,
I just started with this LAUNCHXL2-TMS57012 eval board. I'm using CCS v8.1 and Halcogen 4.07.00. I was able to test DIO before.
Now I'm trying to understand the working of CAN and test CAN interfaces on board.
I first wanted to try simple loopback of CAN1 RX to TX and learnt later that CAN is not that simple. Need to have minimum two nodes to test it.
So in Halcogen I did:
Activated MSGBOXes 1 and 2 on both CAN1 and CAN2:
CAN1 Mbox1: Tx, EOB, DLC=8
CAN1 Mbox2: Rx, EOB, DLC=8
CAN2 Mbox1: Tx, EOB, DLC=8
CAN2 Mbox2: Rx, EOB, DLC=8
All the Mbox's are set with Mask = 0x0000077f.
Other Can port, bit-rate, timing, etc parameters are same for both busses. Enabled CAN1 and CAN2 drivers as well.
Hardware connections with male-male connectors:
CAN1_Tx -> CAN2_Rx
CAN2_Tx -> CAN1_Rx
My application main code in CCS:
{
canInit ();
/*transmit data*/
canTransmit (canREG1, canMESSAGE_BOX1, tx_data);
/*check for data on rx line*/
while (!canIsRxMessageArrived (canREG2, canMESSAGE_BOX1));
canGetData (canREG2, canMESSAGE_BOX1, rx_data);
}
I could not get the transfer happen. I've tried Debug session and observed after canTransmit that CAN1 Error/Status register is updated with 0xE5, saying it's encountered Bit0 Error; and CAN2 status doesn't change after init to indicate any new message rx.
My questions:
1. Is this hardware setup even correct? If not, any pointer to how I can test CAN interface on my Launchpad board?
2. Is there a need to terminate the bus with 120 Ohm resistor? I didn't think it's necessary as I don't see a CAN_H/CAN_L pair for the bus as per schematic.
3. Am I missing some configuration to succeed in having CAN1 and CAN2 to communicate?
Sorry for any silly points or bad formatting. And thanks in advance.