CANbus to Instruments etc. working

This forum is for the discussion of other projects on Megasquirt/Microsquirt hardware that don't fit into any of the other forums

Moderators: jsmcortina, muythaibxr

racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post by racingmini_mtl »

NArcher wrote:@ stevevp
I would like to get my instrument cluster to talk with my MS3. I have a Mazda 3 that I recently installed MS3+MS3X on, but do not have rpm, speed, etc., because I could not figure out how to communicate with instrument cluster. I have the hex ID's for most of the signals that the Mazda 3 uses on CAN, but I'm only a novice programmer at best and cannot figure out how to implement the signals to allow MS to communicate with instrument cluster. Maybe someone can help me on this? Any help is much appreciated! I can also make a donation if need be for this to happen.
Post what you have. You not only need the ID but also the content of the message so that the correct value is displayed.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

This is what I have so far. I will try to dig up more info.
stevevp
Helpful MS/Extra'er
Posts: 40
Joined: Fri Nov 11, 2011 3:43 am
Location: Brisbane, Australia
Contact:

Re: CANbus to Instruments etc. working

Post by stevevp »

Be aware from the start this is going to be a big job, and a large number of signals need to be emulated that the MS3 currently does not know or care about.
The MS3 firmware will need to be modified to suit or cheat a little and grab a MSGPIO to look after the extra signals with your own firmware and interfaces.

I would start with the first and second bytes of 201 as per below.

Code: Select all

        id = 0x201 // 
        dataLen = 0x08;
        data[0] = (unsigned char)((outpc.rpm) & 0x00FF ); //byte 1 = RPM, L 
        data[1] = (unsigned char)((outpc.rpm) /256 );        //byte 2 = RPM, H 
        data[2] = 0x00;
        data[3] = 0x00;
        data[4] = 0x00;
        data[5] = 0x00;
        data[6] = 0x00;
        data[7] = 0x00;
        ECANSendMessage(id, data, dataLen, MSG_STD);
or maybe reversed high and low values

Code: Select all

        id = 0x201 // 
        dataLen = 0x08;
        data[0] = (unsigned char)((outpc.rpm) /256 );        //byte 1 = RPM, H 
        data[1] = (unsigned char)((outpc.rpm) & 0x00FF ); //byte 2 = RPM, L 
        data[2] = 0x00;
        data[3] = 0x00;
        data[4] = 0x00;
        data[5] = 0x00;
        data[6] = 0x00;
        data[7] = 0x00;
        ECANSendMessage(id, data, dataLen, MSG_STD);
and keep adding signals until you are happy its enough.

another valuable tool for this kind of development is a canbus interface
Microchip do a very effective one http://www.microchip.com/stellent/idcpl ... e=en546534
Steve
Black99rt
Experienced MS/Extra'er
Posts: 364
Joined: Tue Mar 14, 2006 10:38 am

Re: CANbus to Instruments etc. working

Post by Black99rt »

Matt Cramer wrote:
Paul_VR6 wrote:I am can-stupid, but can this be used to send generic different format can messages to an aftermarket digital dash?
AIM has already set up their MXL series digital dashes to talk to MegaSquirt CAN.
Can you point me to documentation for this? Their website doesn't seem to mention MS, nor do their integration documents I could find.
1999 Dakota 5.9L R/T-
MSIIe 3.1.2 Batch Fuel/MSD single coil dizzy/Stepper idle
LC-1
atomic6
Experienced MS/Extra'er
Posts: 317
Joined: Sat Nov 13, 2004 11:29 pm
Location: omaha

Re: CANbus to Instruments etc. working

Post by atomic6 »

1986 G.N. (sold)
1967 Nova II wagon (sold)
ex-MSer
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

I will begin working on implementing the MS3 CAN into my current car's network this weekend. Thanks everyone for their inputs. I would like to try the AIM display, but with a price tag of over $1000, I can't fit it into my project car budget. :(
piledriver
Super MS/Extra'er
Posts: 1679
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: CANbus to Instruments etc. working

Post by piledriver »

Heck, I'm looking at a 996 cluster on ebay, and i have a sawzall in my right hand...
Wanted to redo my dash anyway.
Is there any particular cluster that's preferred?

Is this code in mainline yet, or is there a patch handy?
(I guess I have to wait until the current non-buggy ms3 code is released?)
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

I hope James can release the source code soon. Can we just copy and paste the code that is in the previous posts? I understand that I am going to have to modify the code to suite my unique situation (i.e. CAN id's, data values, ect.) but, what else is required to get this running? I guess I am going to have to play with it when the source code comes out.
stevevp
Helpful MS/Extra'er
Posts: 40
Joined: Fri Nov 11, 2011 3:43 am
Location: Brisbane, Australia
Contact:

Re: CANbus to Instruments etc. working

Post by stevevp »

any of the 996 canbus enabled clusters will do - even boxster if you wish
2001+ I think, with the small clock and digital speed windows in dials 2&4
Steve
piledriver
Super MS/Extra'er
Posts: 1679
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: CANbus to Instruments etc. working

Post by piledriver »

stevevp wrote:any of the 996 canbus enabled clusters will do - even boxster if you wish
2001+ I think, with the small clock and digital speed windows in dials 2&4
Excellent, flexible is good.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
stevevp
Helpful MS/Extra'er
Posts: 40
Joined: Fri Nov 11, 2011 3:43 am
Location: Brisbane, Australia
Contact:

Re: CANbus to Instruments etc. working

Post by stevevp »

the best way to confirm a series two dash is the connectors on the rear

green/blue/grey = series two with canbus

black/white/blue = series one without

Image
Steve
piledriver
Super MS/Extra'er
Posts: 1679
Joined: Tue Oct 27, 2009 6:24 am
Location: Van Alstyne, Texas

Re: CANbus to Instruments etc. working

Post by piledriver »

Thank you for the pic!

I was ...amused... to discover that Boxster clucsters seem to go for the same or more than 996 clusters, esp if you can replace the clock/odo reset stalks..
(looks like there's probably a decent buisiness just doing that, they must be horribly delicate things)

My only worry at this pont is will it FIT.
(...and... will it be supported in the ms3 firmware)

I'm trying to find a scan or pattern or something with dimensions with no joy, I don't want it sticking halfway up my windscreen.

Have ordered an SLC-OEM eval kit and set aside the funds for a IOX for my first foray into CAN, but this is still up there on my list, as I despise my current dash.
Always doing things the hard way, MS2 sequential w/ v1.01 mainboard, LS2 coils. 80 mile/day commuter status.
acab
Experienced MS/Extra'er
Posts: 243
Joined: Tue Aug 21, 2012 5:52 am

Re: CANbus to Instruments etc. working

Post by acab »

i add fiat\alfa\lancia C-CAN (can line from stock ecu to body computer)
Since rpm information from the engine control unit node (NCM) travels on the C-CAN network (high transmission speed) to reach the instrument panel node (NQS), which is connected to the B-CAN network (low transmission speed) it must be processed by the Body Computer (NBC) via the gateway function. Only after reprocessing does the body computer transfer the required information to the instrument panel node via the B-CAN network. (rev counter management)

Code: Select all

561 8 00 00 00 xx 00 00 00 00
xx= kühlmitteltemperatur -40 gr.C bis + 215 gr.C / auflösung 1 gr.C / offset - 40gr.C

561 8 00 00 00 00 xx xx 00 00
xx= kraftstoffverbrauch (fuel consumption) 0-132 L/Stunde
auflösung 0,0022

561 8 00 00 00 00 00 00 xx 00
xx= motordrehzahl 0-8000 upm / auflösung 32 upm
I write some programm for my Alfa Romeo
Image

Video with work...
http://www.youtube.com/watch?v=Ly7jbOvC ... r_embedded

I make all that, becouse i didnt wanna disconnect body computer from dashboard. I wanna see some stuff like outside temp, opened dors and other usefull stuff.
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

Did anyone get this code working with MS3? I copied the code, just not sure where to put it.
jsmcortina
Site Admin
Posts: 39587
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CANbus to Instruments etc. working

Post by jsmcortina »

NArcher wrote:Did anyone get this code working with MS3? I copied the code, just not sure where to put it.
It is already included in MS3.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

Thanks James, I'll look at it tonight.
frank_ster
Experienced MS/Extra'er
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Post by frank_ster »

any chance of 2005 subaru legacy ? can dash control ?

how are you guys identifying each can bit ? i have access to a scope. various atmega chips and atmega avr in system programmer.
2005 subaru legacy with buick grandnational engine and awd :D
1976 gmc k10 pickup vortec 383 tbi ms2 nv4500 3.42 final drives
NArcher
Helpful MS/Extra'er
Posts: 55
Joined: Wed Mar 23, 2011 1:38 pm

Re: CANbus to Instruments etc. working

Post by NArcher »

frank_ster wrote:any chance of 2005 subaru legacy ? can dash control ?

how are you guys identifying each can bit ? i have access to a scope. various atmega chips and atmega avr in system programmer.
Stevevp mentioned earlier in this post of a CAN tool to analyze CAN signals and retrieve the ID's and bits. Other than that, you can do an exhuaustive search on the web like I did to find the necessary info. :D
frank_ster
Experienced MS/Extra'er
Posts: 226
Joined: Tue Sep 11, 2007 11:07 am

Re: CANbus to Instruments etc. working

Post by frank_ster »

maybe we could get racingmini_mtl to make such a device. sort of a reverse jim stim.

what do you think jean ?
2005 subaru legacy with buick grandnational engine and awd :D
1976 gmc k10 pickup vortec 383 tbi ms2 nv4500 3.42 final drives
racingmini_mtl
Super MS/Extra'er
Posts: 9128
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CANbus to Instruments etc. working

Post by racingmini_mtl »

I don't see the link with the JimStim.

What you need is a CAN sniffer that will read the CAN messages from a working setup. But then the fun begins: you need to identify what each ID message is for and what the format of the payload is. For example from all the messages going through the bus, you need to find which ID has the RPM data in it and then find you how that data is encoded in the payload. That could be months of boring an tedious work.

That's why the data is so hard to find on the web. Most people who have spent the time and money to find this information (since the OEM doesn't make that available) will keep it for themselves and sell products that use this information.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
Post Reply