Skip to main content
Visitor II
October 29, 2024
Solved

Issue in CAN Normal mode with STM32F412

  • October 29, 2024
  • 4 replies
  • 1489 views

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

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    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

    4 replies

    Explorer
    October 29, 2024

    @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

     

     

    Visitor II
    October 29, 2024

    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

     

    Super User
    October 29, 2024

    @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!

    Explorer
    October 29, 2024

    Hello Andy, good to hear you are still around ! 
    Had been off for months at times, busy with other projects and occupations.

    Technical Moderator
    October 29, 2024

    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)?

    SofLit_0-1730210824649.png

    SofLit_1-1730210888431.png

    SofLit_0-1730211144231.png

    So check if S pin in connected to the ground.

    Technical Moderator
    November 11, 2024

    Hello @mohamed_25 ,

    Could you please provide a status on this thread? did you solve your issue?

    Thank you.