CAN VSS and Gear# format. - Listen mode message format

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

Post Reply
mb300sd
MS/Extra Newbie
Posts: 13
Joined: Wed Sep 16, 2015 4:32 pm

CAN VSS and Gear# format. - Listen mode message format

Post by mb300sd »

I've decided to build a CAN translator to bridge between the PCS proprietary CAN format, and MS. I'm using a STM32F105 with 2 CANs, one connected to the MS3pro and the other to the TCM-2000. This way I can use the spare ADCs on the transmission controller for MS sensors and display it's outputs on a TunerStudio dash.

It looks like I can use the MS dash broadcast function to get the info I need to feed to the transmission controller (RPM, MAP, TPS, CLT), and MS can read any 11-bit ID under "CAN Receiving" as an ADC. But I can't find any info on the message MS expects when I set up CAN VSS and gear to listen mode. I could fake it as an ADC and read everything that way, but I'd prefer to use the dedicated message if I can find it since there's only 16 fields under CAN Receiving, and I'll run out real quick if I want to display/log everything.

I assume I'm looking for a MSG_CMD into table 7, but I can't understand the ini file well enough to figure out the offset. Am I close??
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CAN VSS and Gear# format. - Listen mode message format

Post by jsmcortina »

Instead of adding another microcontroller, why not add receiving of the 29bit broadcasts to the Megasquirt firmware?

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN VSS and Gear# format. - Listen mode message format

Post by racingmini_mtl »

jsmcortina wrote:Instead of adding another microcontroller, why not add receiving of the 29bit broadcasts to the Megasquirt firmware?

James
How will you avoid the possible conflicts with the MS protocol? You also have to think about any other device that might be on the CAN bus and may not be able to identify the messages as being not from an MS-compatible device.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: CAN VSS and Gear# format. - Listen mode message format

Post by jsmcortina »

It depends on the specific messages - I didn't work out the acceptance mask required to see if it does or not. My first hunch was not.

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".
racingmini_mtl
Super MS/Extra'er
Posts: 9130
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada
Contact:

Re: CAN VSS and Gear# format. - Listen mode message format

Post by racingmini_mtl »

I was editing my previous message when you were replying so I don't know if you saw it.

And while this subset may not be an issue, if you allow this in a generic manner there is no way to say in advance that this will always be the case. And that would mean the CAN bus is no longer MS-compatible with this feature activated.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
mb300sd
MS/Extra Newbie
Posts: 13
Joined: Wed Sep 16, 2015 4:32 pm

Re: CAN VSS and Gear# format. - Listen mode message format

Post by mb300sd »

I'd like to avoid messing with the MS code and having my own copy, for upgradability in the future if nothing else. The code to make the STM32 translate can fit in 1 small file and would be completely self contained, so I have some chance of understanding it a year from now if I need to make any changes.

I think I've figured out what I'm looking for in the ini file now.

Based on

Code: Select all

    gear            = scalar, U08,  232, "", 1, 0
   vss1             = scalar, U16,  336, { bitStringValue( prefSpeedUnits ,  prefSpeedUnits ) }, { msToPrefUnitsScale }, 0.0
I think I need to send a MSG_CMD to table 7, offsets 232 for gear and 336 for vss.

It looks like the polling that happens in the MS code, just gets the other device to write back to it's table 7, and MSG_CMD and MSG_RSP are handled by the same code.

Code: Select all

            (void)can_build_msg_req(ram4.vss1_can_id, ram4.vss1_can_table, ram4.vss1_can_offset, 7, off, num);
I feel like I'm missing something though, can I just write to any part of table 7? If I want to write 2 shaft speeds from the transmission to ss1 and ss2, and I just write to offsets 340/342, without setting them up in TunerStudio?
dontz125
Super MS/Extra'er
Posts: 4225
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: CAN VSS and Gear# format. - Listen mode message format

Post by dontz125 »

Just a comment from the peanut gallery; I have no idea what your current situation is nor how anything CAN related works internally. Have you given any consideration to using James' transmission code for the Microsquirt?
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
mb300sd
MS/Extra Newbie
Posts: 13
Joined: Wed Sep 16, 2015 4:32 pm

Re: CAN VSS and Gear# format. - Listen mode message format

Post by mb300sd »

dontz125 wrote:Just a comment from the peanut gallery; I have no idea what your current situation is nor how anything CAN related works internally. Have you given any consideration to using James' transmission code for the Microsquirt?
It's a Mercedes 722.6 transmission. I haven't seen anyone successfully control one with the MegaShift, and I did look into it for a bit before shelling out for the PCS unit. Starting over after all the time and money I have in this controller does not sound appealing even it I could.
Post Reply