2024-09-13 03:12 AM
Hello,
I'm developing an application based on the above mentioned NUCLEO board and need a CAN connection to control the board. I've done some embedded development, but this is my first time using an STM board, so please forgive my lack of experience.
I've configured the CAN module in CubeMX to use a baudrate of 500kbit/s using value from a tutorial. The code uses the HAL library and using the debugger I can see the transmit function return with HAL_OK. But when i connect my oscilloscope to the TX line I only get a short LOW pulse of ~34µs and no actual data.
I'm guessing it might be my lack of understanding the proper (clock) configuration but using different threads I'm now out of ideas. I've attached the CubeMX file below.
Thanks for your help.
Solved! Go to Solution.
2024-09-13 03:18 AM - edited 2024-09-13 04:16 AM
Hello,
You are using Normal mode. As you are using NUCLEO H755ZI-Q you didn't mention if you are using an FDCAN transceiver and if you have connected another node on the bus.
If it's not the case, it's a normal behavior. CAN/FDCAN is not UART or SPI to test it on "floating" mode as it breaks the acknowledgement mechanism.
So you need to use one of the Loopback modes when you are using one board:
To probe Tx pin you need to configure External Loopback mode.
2024-09-13 03:18 AM - edited 2024-09-13 04:16 AM
Hello,
You are using Normal mode. As you are using NUCLEO H755ZI-Q you didn't mention if you are using an FDCAN transceiver and if you have connected another node on the bus.
If it's not the case, it's a normal behavior. CAN/FDCAN is not UART or SPI to test it on "floating" mode as it breaks the acknowledgement mechanism.
So you need to use one of the Loopback modes when you are using one board:
To probe Tx pin you need to configure External Loopback mode.
2024-09-13 03:55 AM
Hello SofLit,
thanks for your quick reply. Indeed I was under the impression, that I could probe CAN just like SPI and likes, which as I learned now is not true.
I've now assembled a complete bus using a PCAN USB in one side and a MCP2561FD as transceiver for the NUCLEO. As the transceiver is 5V logic, I'm currently using a voltage divider for the RX pin to not overload the microcontroller, but probably need to end up ordering the MCP2562FD which integrates levelswitching in the IC. But in the meantime I will test my code using the loopback modes.
Thanks again and sorry for my lack of experience.
2024-09-13 04:10 AM
Indeed MCP2562FD is suitable for your application.
Transceiver VDD @ 5V / VIO @3.3V.