CAN bus acknowledgement ?

Information on getting your PC to talk to your MoTeC product via RS232, CAN, USB or Ethernet.

CAN bus acknowledgement ?

Postby Matce on Wed Mar 08, 2023 5:22 pm

Hi guys,

We have developed a CAN display / logger to work with a multitude of ECUs.
We we're implementing Motec (M150 to test) but ran into an issue:

Connecting our device ALONE onto Bus 2 (Can H+L) resulted in an "passive transmit error" and no log was taken.
Yet, the second we attached an AEM Dash parallel to our device, the error went away and the logger worked.

We can rule out wiring issues.
We can rule out the 120Ohm resistor.
Our device worked instantly on AEM, Haltec, ProEFI - so the system works.

Does the Motec ECU need some sort of CAN-message to acknowledge a device is connected?
If so, what's the message, please?

thank you
Matce
 
Posts: 8
Joined: Wed Mar 08, 2023 4:54 pm

Re: CAN bus acknowledgement ?

Postby Stephen Dean on Thu Mar 09, 2023 9:02 am

Hi,

The most typical causes of a "Passive Transmit Error" are either the CAN Bus wires are swapped, or there is not a terminating resistor at each end of the bus (if the bus is greater than 500mm long). Incorrect Bus speeds can also cause this to occur.
Stephen Dean
MoTeC Research Centre Melbourne, Australia
User avatar
Stephen Dean
Site Admin
 
Posts: 1614
Joined: Tue Dec 02, 2014 10:29 am
Location: Melbourne

Re: CAN bus acknowledgement ?

Postby adrian on Thu Mar 09, 2023 11:00 am

If you are confident the wiring is correct and there is at least 1 terminating resistor in place then it could be that your device isn't setting the 'ack' bit in the CAN message.

For a CAN bus to work at least one device needs to set the 'ack' bit otherwise the transmitter will go into error and stop transmitting. Typically all devices will do this, however it is possible to configure the CAN chip not to do it and essentially be invisible on the bus.

Normally this is only done on CAN sniffers where you may want to read the messages on a bus without any other device knowing it is connected. If you gauge isn't setting the 'ack' bit and it is the only device on the bus other than the transmitter then the bus won't work.
adrian
MoTeC
 
Posts: 718
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN bus acknowledgement ?

Postby Matce on Thu Mar 09, 2023 11:41 am

adrian wrote:If you are confident the wiring is correct and there is at least 1 terminating resistor in place then it could be that your device isn't setting the 'ack' bit in the CAN message.

For a CAN bus to work at least one device needs to set the 'ack' bit otherwise the transmitter will go into error and stop transmitting. Typically all devices will do this, however it is possible to configure the CAN chip not to do it and essentially be invisible on the bus.

Normally this is only done on CAN sniffers where you may want to read the messages on a bus without any other device knowing it is connected. If you gauge isn't setting the 'ack' bit and it is the only device on the bus other than the transmitter then the bus won't work.


yeah, that would make perfect sense since we have exactly this setup... our "logger" just reads and stores RAW DATA on the bus, so we can play it back to confirm the display works on this specific bus.

How can we set this ACK-bit?
Matce
 
Posts: 8
Joined: Wed Mar 08, 2023 4:54 pm

Re: CAN bus acknowledgement ?

Postby NathanB on Thu Mar 09, 2023 1:36 pm

Matce wrote:How can we set this ACK-bit?


We don't have the ability to answer this question for you. It comes down to the CAN Transceiver chip you are using in the device you are developing.

Chips can typically be set to "Listen Mode", where the Tx is disabled, in which when it receives a message it doesn't change the recessive ACK bit to a dominant one. The process of changing the mode depends on the chip itself, and the tools you have to interact/program it.

Most CAN Transceiver chips are in "Normal" mode by default, and CAN sniffer devices have software when ticking a box will program the change to the chip's setting and reboot it. In some chips it is a case of one of the pins on the IC is grounded or not.

Our devices are designed to check that this ACK bit has been "changed" to know that the data it is sending out has been received and deemed error free, or it will eventually time out and stop transmitting.
NathanB
MoTeC
 
Posts: 190
Joined: Thu Oct 15, 2020 1:50 pm

Re: CAN bus acknowledgement ?

Postby Matce on Thu Mar 09, 2023 5:07 pm

thanks again!

So this ACK bit... to WHAT ID is this to be sent? We can send any message to any ID but we would know where this ACK bit has to go? Just setting 1 bit from 0 to 1 ?

thanks
Matce
 
Posts: 8
Joined: Wed Mar 08, 2023 4:54 pm

Re: CAN bus acknowledgement ?

Postby NathanB on Thu Mar 09, 2023 9:06 pm

It's not something you "send"

There is a piece of information in a CAN message frame that when a device receives the message when operating in normal and the CRC checks out, it changes the bit information on the ACK part of the message and retransmits it.

Then when the transmitting device see's the message, it see's the ACK bit has changed it knows the message was received and there was nothing wrong with it.

I don't know how many ways this can be explained, but your not setting your device to transmit a message, you need to ensure that:

1. The CAN transceiver chip you are using is capable of transmitting, which is part of the acknowledge function.
2. The chip is set in "normal" mode, and not listen mode.

Programming the mode of the CAN chip varies based on the manufacturer, but is normally handled on something along the lines of a Serial Peripheral Interface (SPI) which is used to adjust settable functions on a microcontroller. This is usually covered in the datasheet of the CAN chip used in your device. Without this function, you will run into issues integrating your gauge with any higher end Aftermarket ECU the follows CAN 2.0B standards and cares about data integrity in the CAN messaging.

Picking 2 chips at random with the function for "Normal" and "Listen only" functions on RS online, I found the information covered in the supplied datasheet.

MCP2515 Can chip modes.jpg
MCP2515 Can chip modes.jpg (280.84 KiB) Viewed 3842 times


Infineon TLE9255W receive only mode.jpg
Infineon TLE9255W receive only mode.jpg (170.03 KiB) Viewed 3842 times
NathanB
MoTeC
 
Posts: 190
Joined: Thu Oct 15, 2020 1:50 pm

Re: CAN bus acknowledgement ?

Postby Matce on Fri Mar 10, 2023 5:29 am

thanks again! This makes it perfectly clear - I was hung up on what level of communication we need to ACK.
I'm getting in touch with the chip manufacturer and get this sorted.
thank youagain
Matce
 
Posts: 8
Joined: Wed Mar 08, 2023 4:54 pm


Return to MoTeC PC Comms

Who is online

Users browsing this forum: No registered users and 2 guests