2025-01-06 07:12 AM - last edited on 2025-01-07 06:33 AM by SofLit
Hi
I am trying to communicate CAN. I am using two boards Nucleo-G474RE and Nucleo-H755ZI-Q and two MCP2551 as transceiver.
On either side, program works for External loop back configuration. ( I did step by step debug to ensure the transmitting data is getting received or not).
But I am not getting the interrupt when in normal mode. I also tried using a single board with shorting tx and rx of the transceiver and also using two boards.
What might be the issue?
I have only attached the IOC file and main.c file for Nucleo-H755ZI-Q and it is similar for Nucleo-G474RE also.
2025-01-12 09:51 AM
2025-01-12 10:51 AM
You only show TX/RX connected to the MCP2551.
Is the MCP2551 VDD connected to 5V and VSS connected to ground? Is the Rs pin connected to ground as well?
2025-01-12 11:00 AM
Yes, since MCP2551 powering connections are obvious I didn't mention in the connection drawing.
VCC is connected to 5V and GND pins are shorted along with the board GND.
You did mention about Rs pin: There is no Rs pin ; is it a typo for 'Rx' - if yes then I didnt connect it to the ground
2025-01-12 11:07 AM
The MCP2551 does indeed have an Rs pin. You didn't mention that you are using a custom PCB board with the MCP2551 on it. If you look at the schematic for that PCB board, the Rs pin is grounded.
The next step is to get a oscilloscope to see if you are getting CAN bus messages transmitted. Then you can determine if it's an Rx or Tx issue.
2025-01-12 11:46 AM
OK. Let me try using oscilloscope.
Can you please confirm whether I am using the right pin or not?
In the manual, I can only find 2 pins for CAN. Initially i used it for FDCAN1 and later on I was confused which pin i will be using for FDCAN2.
Then when i configured it, by default it was gave me PB12 and PB11 pins. I did try with that. Then I searched in the CUBE IDE itself for alternative pins (Ctrl + hold mouse - alternative pin configuration will blink in the pinout). It showed me PB5 and PB6. I did try with that but it didnt help.
2025-01-13 12:07 AM
1- In the manual gives you an example of CAN pin usage (PD0 and PPD1) and it's not a restriction:
To find the CAN pin usage possibilities the datasheet is the right document to refer to:
Many possibilities for FDCAN1 and FDCAN2 offer to you (make a search in the document). But you need to select a pin not used in the board i.e. it's a free pin and not connected to nothing else in the schematics.
2- And this transceiver pin needs to be pulled to the ground:
I see from your screen shot you are using shields but better to double check with a multimeter (in continuity mode with transceivers are powered off).