Page 1 of 1

VSS from GPIO to MSIII over can

Posted: Sun Nov 06, 2016 1:43 pm
by Halldorsson
Hello

I´m running MS III and GPIO megashift linked via can and have no trouble getting tach and map signal from MS to GPIO.
I´m trying to get VSS signal from the GPIO to MS. VSS is working good in GPIO but I can´t get the signal over to MS.
The reason for this I want to read speedo on a tablet linked to MSIII.
I´ve tried all kind of different settings back and forth. MSQ of both projects attach
Can anyone help me on this?

Stefan

Re: VSS from GPIO to MSIII over can

Posted: Tue Nov 08, 2016 8:58 am
by Bernard Fife
Halldorsson, The speed value is an unsigned 16bit (2 bytes) integer at offset 2 in the outpc structure in the MShift code. The value is in mph x 10, so you have to multiply by 0.100 to get mph, or multiply by 0.16093 to get kph. It is up to your ms3 controller to request this value from the GPIO (and properly convert and report it). You need it to do it similarly to what the MShift code is requesting from the ms3 for the tach and MAP. So you need to ask the ms3 support folks how to get the info to ms3.

The speed ("speedo") memory location and format info can be found in the INI's OutputChannels section:

Code: Select all

[OutputChannels]
; These are from the outpc. structure in the main.c file of the source code
; the size and format are the same as above

   deadValue        = { 0 } ; Convenient unchanging value.

   ochBlockSize     = 104
   
#if CAN_COMMANDS
; full version that works anywhere
   ochGetCommand    = "r\x01\x07%2o%2c"
#else
   ochGetCommand    = "a\x00\x06"
#endif 
  
  seconds           = scalar, U16,    0,     "sec",      1.000, 0.0 
#if SI_LENGTHS
  speedo            = scalar, U16,    2,     "kph",      0.16093, 0.0
  odometer          = scalar, U32,    4,      "km",      0.00161, 0.0 
#else
  speedo            = scalar, U16,    2,     "mph",      0.100, 0.0
  odometer          = scalar, U32,    4,   "miles",      0.001, 0.0 
#endif 
...
...
...