2
\$\begingroup\$

In the loopback mode of the CAN MCP25625, if we load and send data on the TXB0 buffer, are we supposed to receive a RXB0 buffer ready and filled with data in the TXB0 buffer?

If yes, the following are the steps I use:

  1. Set the MCP25625 to LOOPBACK MODE by setting the bits 7:5 for sequence 010, given in the datasheet. I reverify by checking up the CAN Status bits and the bits 7:5 show me a 010.
  2. After I successfully load and send the data onto TXB0, I don't receive a message-ready signal which is why I am unable to check the RXB0 buffer. On force checking it I find that the data is junk, i.e. the loopback functionality did not work.

What else I should check to debug this?

The way I am checking this is with the USB MCP2210 SPI behaving as master and using that to drive the MCP25625 slave device.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

I'm using this controller.

Did you put the controller on normal mode after configuration? Are you able to transmit to other nodes when using the normal mode (no loopback). What is your message ready signal? An interrupt pin? Are the interrupts correctly configured in the controller?

Please check that every step in your configuration is sucessful, if you want more help post your configuration steps.

I don't have access nor experience with a MCP2210, so I cannot help with it.

PD: I don't recomment this CAN controller. The datasheet says that the filters are not available when listen only mode is used and that in this mode the controller passes all messages, including corrupted messages. I found that the filters work on listen only mode but the controller still accept corrupted messages (I tested sending messages with different bitrate).

If you want to build an USB to CAN interface better look for a microcontroller with USB and CAN peripherals, the STM32F105 or STM32F042 are good choices.

\$\endgroup\$
1
  • \$\begingroup\$ Hi Totoxa, Can you post your initialization steps/code? It would help me move past this blockade. So I do the init by sending into config mode setting the txctrl and rxctl regs. Also then I set the mode to listen only and then look at the data. The data seems almost right, by that I mean I can't figure any ascii of it but the number of bytes seems correct. Now I'm worried if I missed any key initialization steps. Need help. \$\endgroup\$
    – Siddhant
    Commented Jun 26, 2017 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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