cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in CAN Normal mode with STM32F412

mohamed_25
Associate

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

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Ozone
Lead II

@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

 

 

mohamed_25
Associate

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

 


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

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

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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

SofLit
ST Employee

Hello @mohamed_25 ,

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

Thank you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.