0
\$\begingroup\$

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.

  1. Why am I having Transmit errors? I looked through this but it is a little too much at the moment for me.
  2. The TEC goes up to 136. Why didn't it increase further from error-passive to 255 and bus-off?
  3. 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?
  4. 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.

\$\endgroup\$
4
  • \$\begingroup\$ Generally, nobody cares about which board you've got but which CAN controller IC you've got. I'm assuming MCP2510 - that's the main relevant information to give. Anyway, you can start by going through this checklist: What are the most common causes of CAN bus communication errors? \$\endgroup\$
    – Lundin
    Commented Jul 5, 2022 at 10:13
  • \$\begingroup\$ If you have a CAN bus, what does it mean if they are connectes via RS-232 ports. How do CAN and RS-232 relate here if the problem is with CAN? \$\endgroup\$
    – Justme
    Commented Jul 16, 2022 at 21:18
  • \$\begingroup\$ @Lundin: Well, your assumption is wrong. The IC is indeed MCP25625 and is the relevant information. \$\endgroup\$
    – Maria
    Commented Jul 16, 2022 at 21:19
  • \$\begingroup\$ @Justme: The board also has RS232 ports (DB-9) apart from the pins for CAN H and CAN L. After a while I decided to use the pins instead of the port for the bus. \$\endgroup\$
    – Maria
    Commented Jul 16, 2022 at 21:25

2 Answers 2

3
\$\begingroup\$

For anybody else facing this. I figured out the issue.

When I looked at the bus with an oscilloscope, I noticed that the CAN lines were 0 as opposed to the 2.5V expected in an idle state. This made me wonder if the transceiver was in 'Normal' operating mode even after giving the STBY pin a low level. I was sure that the controller was in 'Normal mode' from the registers. To verify this, I checked if the voltages at the pins of the IC were as per the datasheet.

What I understood from the data sheet of the click board was that I needed to provide only 3.3V (as the jumper to choose the voltage was at 3.3 for my boards). But on checking the voltage, I noticed that the VDDA (input to transceiver) was 0 when it should have been between 4.5V - 5V. The bus worked after I supplied both 3.3V and 5V to the board.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you for following up with us. \$\endgroup\$
    – Bryan
    Commented Jul 16, 2022 at 21:18
1
\$\begingroup\$

It looks like no messages are being acknowledged. The REC not increasing indicates the transmitter is able to put the messages on the bus. It's just that no other node receives them. The transmitter repeats this until it backs off.

For a functioning CAN bus you need at least two active nodes, not silent, and both ends of the bus require a 120 ohm termination resistor to prevent reflections.
If nodes are isolated CAN_GND is also required.

I'm not familiar with the MCP25625, but it must have a status register of some sort where you check what mode it's in. But based on the information you've given now, either the wiring is incorrect or no other nodes are listening.

If you look at the bus with an oscilloscope the fault is probably easy to spot by one continuous stream of messages.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you @Jeroen3 for your useful input. \$\endgroup\$
    – Maria
    Commented Jul 16, 2022 at 21:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.