2024-04-11 11:28 AM - last edited on 2024-04-12 01:08 AM by SofLit
Hello,
Hope you all doing well..!!
I am using two microcontrollers i.e., for transmitting data I have to use STM32F407VET6 and for receiving I have to use STM32F407VGT6 also I have to connect MCP2551 CAN Transceiver. I am transmitting data from one board and receiving data from another board through CAN Bus Protocol Communication.
However, the data is not transmitted and received. I have properly checked the hardware connections and terminated the bus at both ends with 120-ohm resistors.
IDE: STM32CubeIDE
Which step should I follow for communication between boards?
Thank You in advance!!
2024-04-11 11:42 AM
>>Which step should I follow for communication between boards?
The F407 hardware side should work.
Guess you'll want to start debugging things.
Check register settings and clocks. Perhaps inspect the error/status flags to better understand what IS happening.
You could test single nodes in Loop-back mode, also check the CAN-TX pin with a scope. Observe data and timing.
2024-04-11 11:48 AM
I can already test the loopback mode with both boards separately and it works properly.
I am using breakpoints and status flags for debugging but I can't rectify the problems. and also I have crosschecked many times with the configuration and clock.
2024-04-11 12:25 PM - edited 2024-04-11 01:37 PM
What about Rs pin voltage level? How did you connect that tranceiver's pin? this pin is to put the tranceiver in a stanby mode. So you can't send/receive anything on the bus.
So it should be at least tied it to the ground:
Read Rs section in the datasheet.
2024-04-11 12:51 PM
Also what is the clock source you set for the system clock? HSI or HSE?
Need to select HSE with an external crustal otherwise you risk you have some troubles in the communication.
2024-04-11 11:54 PM
2024-04-11 11:55 PM
Yes, I am setting clock to HSE with Crystal oscillator.
2024-04-12 12:24 AM
Hello,
It seems they are a purchased modules. But anyway you need to:
2024-04-12 02:17 AM
It needs to connect Rs to Ground for both the transreceiver??
And All the other point I have checked properly.
2024-04-12 02:40 AM
@mr_vineet wrote:I have connected transceiver like this. How can I connect Rs Pin to ground?
So you're using some 3rd-party module?
Then you need to check the schematic of that module.