CAN Bitmask for 12bit Messages

D153, D175, C125, C127, C185 and C187 forum

CAN Bitmask for 12bit Messages

Postby dzzr on Tue Dec 21, 2021 1:37 am

Hi All,

Been trying to work out the correct value for configuring my C127 to read EGT values over CAN.

I've done a lot of reading from the webinars and other forum posts but I'm stuck with getting accurate values when the message does not start at the beginning of a Byte. Below is the CAN data I need to read.

Image

I have perfect values for EGT1, EGT3 and CJ temp. These all start perfectly at Byte 0, 3, 6 respectively. For EGT2 and EGT4 I'm getting values hundreds of degrees lower (sometimes negative).

This is my channel config:
Image

I have tried starting at Byte 2 instead of 1 and also un-ticking "Data shifted right". I believe I'm correct with the bitmask and then dividing by 16 for these two problem channels? Must be something else I'm missing here?

Cheers!
dzzr
 
Posts: 10
Joined: Fri Jul 30, 2021 11:41 pm

Re: CAN Bitmask for 12bit Messages

Postby David Ferguson on Tue Dec 21, 2021 5:17 am

Have you tried making the mask 0FFF or FF0F?

To work this out, I typically have the values on the bus (captured with CAN Inspector), and the values I am translating. I look at them in hex and figure out what needs to happen. Start out with no shifts and no divides / adders -- you are trying to get the bytes in the right order to start, before converting them to the units you need.

I might even setup a test to generate a specific pattern (like 01 23 45 67 89 AB CD EF) on the bus using another device, so I can make sure I get every nibble correct.
David Ferguson
Veracity Racing Data
David Ferguson
Pro User
 
Posts: 1371
Joined: Fri Nov 07, 2008 2:45 am
Location: Paso Robles, California

Re: CAN Bitmask for 12bit Messages

Postby adrian on Tue Dec 21, 2021 8:55 am

You shouldn't have both the divisor of 16 and "Data shifted right by 4 bits" selected as they do the same thing. Easiest way is just to just tick the box and not worry about the divisor.

Everything else is correct, however, if this is the device I'm thinking it is you will need to talk to the supplier to get it updated. It looks like the issue you are having is the same one I helped a customer with not long ago where channel 1 and channel 3 are sent little endian and channel 2 and channel 4 are sent big endian.

The supplier in that case made a quick update to the device and it all worked fine after that.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Bitmask for 12bit Messages

Postby NathanB on Tue Dec 21, 2021 9:30 am

Hi,

That would be an Emtron ETC4 correct? I suggest that you download our CAN Capture software off the MoTeC website (under latest releases at the bottom of the page called utilities V1.20)

Run the Capture on the CAN bus of the dash that the ETC is connected too, and complete a short capture when the vehicle has not been run, so that you know the values are reading evenly and close to ambient. You will be able to open the capture in notepad, excel or any CAN software that supports ASCII files.

You can easily convert the hex values to the binary bits using the programmer function in windows calculator. Once you have done 2 hex bytes at a time and written down the binary output, you can use the calculator to type out 12 binary bits at a time to come up with a decimal (or hex) value.

At an ambient temperature, each 12 bits of data should have a similar value.

Depending on the age of firmware in your ETC4 I seem to remember there was an issue with the transmit on the older unit, that Emtron fixed in their software to read the values correctly.
Attachments
turn 12 binary bits into a decimal or hex value.PNG
type out 12 bits of the binary data to come up with a decimal / hex value
turn 12 binary bits into a decimal or hex value.PNG (397.69 KiB) Viewed 6008 times
Programmer calculator.PNG
Convert 2 hex bytes to bits
Programmer calculator.PNG (394.76 KiB) Viewed 6008 times
NathanB
MoTeC
 
Posts: 207
Joined: Thu Oct 15, 2020 1:50 pm

Re: CAN Bitmask for 12bit Messages

Postby dzzr on Tue Dec 21, 2021 10:08 am

Hi Guys,

Thanks for all the responses. Yes, this is an Emtron ETC4.

I did run a CAN capture and try to work backwards that way. This would of been close to ambient temp, I think the car had been started a few hours prior to the capture.

Code: Select all
     0.081042   1       2B3    Rx d      7 4D 00 4D 4F 00 50 40


Here is my attempt to work backwards from that.
egt.JPG
egt.JPG (40.89 KiB) Viewed 6004 times


At ambient temp all channels are equal on the dash.

I think this is a sample of when the car was started. Values should be about 250*c from my calculation.

Code: Select all
     0.483515   1       2B3    Rx d      7 1B 11 28 2A 11 07 46


Cheers!
dzzr
 
Posts: 10
Joined: Fri Jul 30, 2021 11:41 pm

Re: CAN Bitmask for 12bit Messages

Postby adrian on Tue Dec 21, 2021 12:09 pm

If the channels were all little endian in that CAN log you would have:

At Ambient:
EGT1 = 27°C
EGT2 = 1182°C
EGT3 = 29°C
EGT4 = 1230°C
At Startup:
EGT1 = 233°C
EGT2 = 591°C
EGT3 = 248°C
EGT4 = 63°C

So 1 and 3 read correctly but 2 and 4 don't.

Dash Manager can't be configured to read both big and little endian channels in a single message. Emtron have an update that sorts it out, they also have a dbc file that you can import straight into Dash Manager so you don't have to worry about configuring the CAN setup.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: CAN Bitmask for 12bit Messages

Postby dzzr on Tue Dec 21, 2021 12:52 pm

Thanks Adrian, I will contact them to get it updated.

At the very least trying to figure this out I've learnt a lot!
dzzr
 
Posts: 10
Joined: Fri Jul 30, 2021 11:41 pm


Return to Colour displays

Who is online

Users browsing this forum: No registered users and 22 guests