2024-10-29 04:59 AM - last edited on 2024-10-29 06:59 AM by SofLit
If anyone Work on project that interfacing Can transceiver TJA1050 with STM32F412RET6 , if yes i hope anyone send Example code that work and clock configurations ,, the loopback mode work correctly .. but in normal mode problems start ... and operating voltages of TJA
Solved! Go to Solution.
2024-10-29 06:58 AM
Hello @mohamed_25 and welcome to the community,
Please share your schematics and the code you have used for tests. Are you using CubeMx? please share also the .ioc file
You can inspire from this example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM324xG_EVAL/Examples/CAN/CAN_Networking
2024-10-29 05:58 AM
@mohamed_25 wrote:If anyone Work on project that interfacing Can transceiver TJA1050 with STM32F412RET6 , if yes i hope anyone send Example code that work and clock configurations ,, the loopback mode work correctly .. but in normal mode problems start ... and operating voltages of TJA
The TJA1050 is just a simple "combinatorial" device, i.e. logic for voltage level adaption. There is no programmable functionality whatsoever.
Loopback mode works correctly because the loopback is usually internal (i.e. on-chip), and the signals don't leave the MCU (or have no consequence).
If loopback works, the next step is to connect two compatible CAN nodes on digital level directly.
Compatible means either two STM32F412 boards, or two CAN interfaces on the same board. (CAN-TX1 to CAN-RX2, and vice versa).
If that works, you can proceed to different nodes connected via transceivers. You will need a scope, or configurable logic analyser. CAN is a differential bus : https://en.wikipedia.org/wiki/CAN_bus#/media/File:ISO11898-2.svg
2024-10-29 06:16 AM
i understand this ,, i use 2 MCUS with 2 tja1050 Transciever but i dont work so i need example code to make sure that problem in hardware
2024-10-29 06:29 AM
@mohamed_25 wrote:it dont work so i need example code to make sure that problem in hardware
So use a scope or logic analyser to see what's actually happening on the wires.
No point in messing with software if it is a hardware problem!
2024-10-29 06:58 AM
Hello @mohamed_25 and welcome to the community,
Please share your schematics and the code you have used for tests. Are you using CubeMx? please share also the .ioc file
You can inspire from this example: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM324xG_EVAL/Examples/CAN/CAN_Networking
2024-10-29 07:10 AM - edited 2024-10-29 07:12 AM
The TJA1050 is a 5V transceiver but VIHmin = 2V which is OK.
Meanwhile, what do you set as voltage level for S pin (Silent mode)?
So check if S pin in connected to the ground.
2024-10-29 08:47 AM
Hello Andy, good to hear you are still around !
Had been off for months at times, busy with other projects and occupations.
2024-11-11 07:02 AM
Hello @mohamed_25 ,
Could you please provide a status on this thread? did you solve your issue?
Thank you.