Setup: CAN bus with 2 nodes each with a microcontroller (CC26X2R1 LaunchXL evaluation board) and CAN controller with an integrated transceiver (MCP25625 click board).
I used the libraries for the MCP25625 click board from here. I made changes to the libraries as needed to integrate with the SPI driver files for CC2652R. I am sure that the SPI worked as I can read and write the registers of MCP25625 with the SPI commands mentioned in the datasheet.
I tested each node in loopback mode. Initially only one of the nodes worked. I used the RESET pin before initialising and got the second node to work. So this should mean that the CAN controller works. To put the CAN transceiver in Normal mode, I applied low-level to the STBY pin as mentioned in the datasheet. And I set the CAN controller by writing to the register. The nodes are connected via the RS232 ports.
I tried sending a message from one node to the other but the Transmit error flag goes up. This is my first time working with CAN bus, so multiple things could be wrong. Following are some of the questions I have. I would also appreciate any pointers to help me figure out what could be wrong.
- Why am I having Transmit errors? I looked through this but it is a little too much at the moment for me.
- The TEC goes up to 136. Why didn't it increase further from error-passive to 255 and bus-off?
- The REC doesn't increase. If the message made it to the bus, for every 8 increases in TEC, the REC should have increased by 1. Could node 2 be not working?
- How do I know if the transceiver on each node is indeed activated and put into normal mode?
Note: I did check the termination resistors.