cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Node not able to transmit when on an existing bus

Mohit Aggarwal
Associate II
Posted on May 25, 2018 at 09:34

Hello Everyone,

I,am having a issue with my can node.

The communication bw two can nodes built on STM32L4 works perfectly fine. But that's just for testing purpose. I don't intend to use it that way.

When I introduce it to an existing CAN bus, TX stops. Node is able to read the messages on the bus.

Please let me know what all things i can try or i might be missing.

Hope someone has already been down this road and can help me out..

CAN settings are as follow

hcan1.Instance = CAN1;

hcan1.Init.Prescaler = 6;

hcan1.Init.Mode =

CAN_MODE_NORMAL

;

hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ;

hcan1.Init.TimeSeg1 = CAN_BS1_13TQ;

hcan1.Init.TimeSeg2 = CAN_BS2_2TQ;

hcan1.Init.TimeTriggeredMode = DISABLE;

hcan1.Init.AutoBusOff = DISABLE;

hcan1.Init.AutoWakeUp = DISABLE;

hcan1.Init.AutoRetransmission = ENABLE;

hcan1.Init.ReceiveFifoLocked = DISABLE;

hcan1.Init.TransmitFifoPriority = DISABLE;

#can #can-interface #can-examples #problem-can
28 REPLIES 28
Posted on May 26, 2018 at 08:37

Ok. Will try that out too.

Thought that if once it fails it wont try again ,so left it Enabled ;p 

Posted on May 26, 2018 at 18:21

I tried with

AutoRetransmission = DISABLE;

AutoBusOff = ENABLE; (ABOM)

Still no luck.

However i have an input.

I,am using TJA1050 CAN Transreceiver

1) When monitoring CAN_TX pin on analyser without connecting the CAN H and CAN L pin to the bus.. the msg is transmitted and decoded.

2) 

When monitoring CAN_TX pin on analyser with 

connecting the CAN H and CAN L pin to the bus..I see activity on the the CAN TX pin but it is decoded as error by the analyser.

Hope this input helps you in guiding further.

Posted on May 27, 2018 at 02:06

is it possible that you have CanH and CanL swapped ?

or the MsgID is in conflict.

please be sure that no 2 devices can transmit the same MsgID.

Posted on May 28, 2018 at 07:39

is it possible that you have CanH and CanL swapped ?

As said before, this could be the case.

And for cables of more than a few centimeters length you NEED a proper termination on both bus ends.

I had such a case a few weeks ago, where I needed to 'hack' a termination resistor into the CAN cable near the device to get it working.

Posted on May 28, 2018 at 09:16

CAN H and CAN L are in Place.

Didn't knew the Length of wires could be an issue. will surely put on an termination register.

The RX was working so thought its not needed.

Thanks for the clarification.  

T J
Lead
Posted on May 29, 2018 at 09:13

this is confusing..

CanRx pin on the processor,  must be pulled up, if there is no Transceiver chip.

Otherwise the Can-HAL will not Initialise

Are you connecting the OBD2 interface directly to the processor pins or with a CanBus transceiver ?

which vehicle are you connecting to ?

Did you know that some older OBD2 systems are not CanBus ?

On the OBD2 connector, which pins are you using ?

Pins 2 & 10

Pin 2 only

Pins 7 & 15

Pins 6 & 14

What speed are you running at ?

Posted on May 29, 2018 at 08:16

Adding termination didn't help either. :(

Posted on May 29, 2018 at 08:40

I,am using TJA1050 CAN Transreceiver

1) When monitoring CAN_TX pin on analyser without connecting the CAN H and CAN L pin to the bus.. the msg is transmitted and decoded.

2) 

When monitoring CAN_TX pin on analyser with 

connecting the CAN H and CAN L pin to the bus..I see activity on the the CAN TX pin but it is decoded as error by the analyser.

I would concentrate on this. Perhaps something wrong with the hardware ?

For prototypes, this would not be surprising.

Posted on May 29, 2018 at 08:50

Can u suggest an ideal schematic for the TJA1050 and OBD2.

there are Various Schematics available on internet and that's confusing.

The one mentioned in datasheet and application note doesn't require anything on the CAN-TX CAN-RX pins and even termination on CAN-H and CAN-l if you are getting introduced on an existing bus.

But that doesn't work at all. I have to pull down CAN-RX pin using 3.3K ohm resistor to get receive working.

Please guide if something is wrong and needs to be changed. A reference to an tested schematic would be really helpful.

Posted on May 29, 2018 at 09:19

For OBD2, I will bail out - I have no experience with it.

Being a software guy, I would have started with schematics suggested in the transceiver datasheet as well.