2023-02-09 03:09 PM
Hy, I'm currently working on a project that requires CAN and that information needs to be sent via wireless, for that reason, I chose the NUCLEO stm32WL board. To make the CAN work I have to use the MCP2515 module, that converts CAN to SPI so that the uC can read it. The problem I'm facing is that there's not much content about this board and much less about the matter. The only library I found is this one: https://github.com/eziya/STM32_SPI_MCP2515).
For the project, I need mainly to receive CAN data from another circuit board, and the baudrate of the bus is 500Kbps, which I set on the SPI configuration. However, I'm having troubles receiving such messages, since I can't read any data that is sent. I'm currently using that library, and altered the "stm32f1xx_hal." library for the "stm32wlxx_hal.h" one and with that it should be working. I could use some help to know if I'm configuring something wrong, or if I need to make some changes on the library, or if there's something about the board that needs to be done that I don't know about.
Appreciate the answers!!
2023-02-10 04:13 AM
Are you using a CAN Bus Transceiver ? MCP2515 is a CAN Controller and thus needs a transceiver after, in order to be able to communicate on the bus (CAN Bus Transceiver datasheets usually offer an implementation recommendation circuit). Since you are already using a Microchip product, you can use the MCP2551 CAN Bus Transceiver, or you can opt for the MCP25625 which is a CAN Controller with an integrated Transceiver so that you have one IC instead of two.
Disclaimer !!
Of course there are many option from a variety of manufacturers and I only suggest Microchip products since you are saying you are already using one.
2023-02-10 05:05 AM
Yes, I am using a module, so they're already together, the transceiver is the TJA1050.