2024-03-04 02:17 PM - last edited on 2024-03-06 02:48 AM by SofLit
Hi I'm new in working with CAN-bus. My project involves two stm32 boards (both are nucleo-l433rc-p) and I want to get CAN-bus communication between them. The code is supposed to make a build in LED blink each time the blue button on the main nucleo board is pressed (although I would be happy to get any CAN communication at all).
Relevant code:
Main:
Relevant code secondary:
Hardware:
Solved! Go to Solution.
2024-03-06 02:46 AM - edited 2024-03-06 03:30 AM
Hello,
You need to connect STBY pin of the transceiver to the ground.
Also becarefull about VIH min parameter: your MCU VDD = 3.3V while your transceiver is powered with 5V and it does not have VIO pin to adapt the voltage levels:
From the transceiver's datasheet:
VIO = VDD in your case.
-> Tx VIH min = 5V x 0.7 = 3.5V which is > 3.3V!
So you need a transceiver config with VIO pin (instead of SPLIT pin) or another transceiver having VIH min < 3.3V or simply a 3.3V transceiver.
2024-03-05 12:33 PM
You haven't made clear what the issue is? Are you not getting an interrupt on the button press? Or that you know you're getting an interrupt on button pressed and you know you're sending a CAN message, but not receiving a CAN message on the 2nd board? Assuming you've used a scope to see actual CAN activity?
Your images are so low resolution that you can't make anything out. Based off the drawing, that looks to be a TJA1049 CAN transceiver? Is the STB pin grounded on the TJA1049?
I don't know if you have a ground reference to both boards? Are the two dev boards connected by USB to the same computer so they both have a ground reference to each other?
2024-03-05 03:11 PM
I'm sorry for not giving enough information. At the moment I'm trying to just scope the CAN-signal using an oscilloscope. E.G. I don't think any CAN-signal is being sent out. The transceivers used are MCP2561 PDIP, SOIC. The STBY pin isn't used at all.
Both boards are connected by USB to the same computer, so they do have a ground reference to each other.
Thank you for your help.
2024-03-06 02:19 AM
Hi,
in the Datasheet is the "standy pin" pullup internal.
You have to pulldoen the pin to GND.
hth
padawan
2024-03-06 02:46 AM - edited 2024-03-06 03:30 AM
Hello,
You need to connect STBY pin of the transceiver to the ground.
Also becarefull about VIH min parameter: your MCU VDD = 3.3V while your transceiver is powered with 5V and it does not have VIO pin to adapt the voltage levels:
From the transceiver's datasheet:
VIO = VDD in your case.
-> Tx VIH min = 5V x 0.7 = 3.5V which is > 3.3V!
So you need a transceiver config with VIO pin (instead of SPLIT pin) or another transceiver having VIH min < 3.3V or simply a 3.3V transceiver.