CAN LOTUS BROADCAST
Posted: Thu Jul 20, 2017 6:29 am
Hi,
is possible insert Lotus BROADCAST?
is possible insert Lotus BROADCAST?
Support and discussion forum for Megasquirt 1, 2, 3, Microsquirt/module, DIYPNP, MSPNP2, MS3-Pro
https://www.msextra.com/forums/
What was the source of this code? Is it under copyright?AbatelliCristian wrote:Hi,
is possible insert Lotus BROADCAST?
For the white dash 1Mbit/s CAN (2004-2007):
CAN ID 0x400, period 10ms, Motorola endian format
/* 8 Data Bytes */
Yes... but I cannot just use his code without permission.flycat wrote:Hi James, this info are writed from a guy on a lotustalk forum, he have maked a lcd dashboard for elise/exige to connect a original ecu, and it use this command set.
Bye, Luca
You posted someone's code. By default it is protected by copyright. So unless that guy specifically gives permission to re-use it, I won't.AbatelliCristian wrote:I do not understand ... addresses could have been detected by a sniffer ...
These are only address, is correct?
400h 8 AA BB CC DD EE FF GG HH
AA -----------------------> adjusted speed ~= d(XXh)-11d (61h-->97-11=86 mph)
BB --------------------> unused (always 00)
CC DD --------------> tach rpms [d(CCh)*256]+d(DDh) 06 D2 = 1746 rpm
EE -----------> fuel level (00=empty, FF=full)
FF --------> engine temperature ~= d(XXh)-14d (D0-->208-14=194F)
GG -----> MIL (04-oil, 02-engine, 01-shift)
HH --> unused (always 00)
bitmask patterns:
01 00000001 shift light
02 00000010 engine light
04 00000100 oil light
08 00001000
10 00010000
20 00100000
40 01000000
80 10000000
the can trace that you posted in the other thread shows that at least bits 3 and 7 are used (40 and 08) in the MIL byte (byte 7 of . Also your trace shows that byte 8 (the one that reads 20) is now used whereas in 2005 it was not.
Finally the text frame only shows 7 bytes being able to be sent... have you ever seen a message on the cluster that is bigger than 7 bytes and if so can you post a quick trace.
frame data: aa bb cc ddeeff gg hh
aa = dash understands speed in kilometers per hour (good as i live in Australia and we are metric)
bb = unused
cc = first part of rpm. take rpm from ecu output eg. 4000rpm and divide by 256 = 15 (dont care about the decimal left overs(.625)) now convert 15 to hex (0F) and send to the dash.
dd = second part of rpm. take the second two digits of rpm eg 4090, now just use 90 and convert to hex (5A) and send to the dash.
ee = fuel - all depends on your ECU calibration. as Rob states - 00 - FF
ff = engine temp. dash needs to understand engine temp in deg F for some reason. and has an offset of -14. so for 90 deg C engine temp use the following: ((tempin * 9.0 / 5.0)+32)+14 where tempin variable is 90
gg = various dash lights:
send the following to the dash - all in hex. tc = traction control light.
00 = off. 01 = shift light. 02 = MIL. 03 = Mil&Shift. 04 = oil. 05 = oil&shift.
06 = oil&mil. 07 = oil&mil&shift. 08 = tc. 09 = tc&shift. 0a = tc&mil.
0b = tc&mil&shift. 0c = tc&oil. 0d = tc&oil&shift. 0e = tc&oil&mil.
0f = tc&oil&mil&shift
hh = unused by dash.
The lotus network uses a CAN based network for three conection points in the elise. these points are the ECU, the instrument cluster, and the OBD connector. CAN uses a twisted pair cabling with arbitration, which means that it still functions under a variety of conditions including either signal wire being severed or shorted to ground or 12 volts. it also uses differential signaling; both wires normally rest at 2.5 volts and a data bit is signalled by 3.5 volts on the CANH wire and 1.5 volts on the CANL wire. the advantage of this is that the differential between the two wires constitutes signal and any induced noise will either raise or lower both lines by the same amount, thus not changeing the differential.
the network follows the standard CAN 2.0 spec for the physical layer; it uses 120 ohm impedance twisted pair cabling with each line having a 60 ohm impedance in relation to gnd. the network uses standard TJA1054 CAN transcievers (texas instruments) or 82C251 (phillips). both are very common parts availabl through digikey. the wiring is as follows:
Code:
sig ECU cluster obd wire color
--------------------------------------------
can H 85 C1 6 red
can L 79 C7 14 violet
gnd -- A2 5,4 blk
the CAN spec specifies that a number of different bitrates can be used, with 250 and 500kbs being the most popular for C level or engine management networks. the elise actually goes one better and runs the network at 1000 kb/s or 1 mb/s which is actually very fast but does make the network more susceptable to noise issues; at 1MB, any loose connection in the signal wires causes data corruption. CAN specifies that data is transfered in frames; each frame has an ID#, a length descriptor and 1 to 8 bytes of data (sometimes a return request flag too). the ID number designates the type of information sent and sometimes also the sending node though multiple nodes can send messages with identical id's, it is not recommended. the arbitration mechansim is such that lower ID#'s are given priority over higher ones so that if two messages are transmitted at the same time, the node that is sending the higher ID# will back off and allow the lower one to transmit. (for more info on how this happens google the CAN spec and start reading) this allows for message prioritization, and consequently important messages (say like "switch on the high cam NOW!") are given low ID#'s to insure that they transmit as quickly as possible.
theelise regularly transmits only one frame/message ID# and that is 400h (hex). The message is transmitted and thus updated 10 times a second (allowing a resolution of 10 hz). the frame is 8 bytes and so far it looks as though 2 bytes are unused. the frame carries the following data: rpm, speed, temperature, MIL, and fuel. the frame layout and approximate conversions are as follows:
Code:
lotuseliseecu-->cluster broadcast frame
400h 8 AA BB CC DD EE FF GG HH
AA -----------------------> adjusted speed ~= d(XXh)-11d (61h-->97-11=86 mph)
BB --------------------> unused (always 00)
CC DD --------------> tach rpms [d(CCh)*256]+d(DDh) 06 D2 = 1746 rpm
EE -----------> fuel level (00=empty, FF=full)
FF --------> engine temperature ~= d(XXh)-14d (D0-->208-14=194F)
GG -----> MIL 06-on, 04-crank, 00-running, 01-shift light
HH --> unused (always 00)
the speed and temperature conversions are only approximate; they need to be calibrated against controlled readings. the fuel sender reading needs to be averaged over time as the value fluctuates in relation to the fuel sloshing around and moving the float. the MIL data may correspond to more than what i have listed; i have not had a chance to check bits 3-7.
one more thing: ii worked out the actual encoding of the speed sensor value... it works out to be:
d(xxh) * 0.68 = mph
so a value of ECh = 236 dec * 0.68 = 160 mph
http://www.lotustalk.com/forums/f129/ca ... sis-10866/
Elise/ExigeCanbus below:
CAN ID 0x400, period 10ms, Motorola endian format
/* 8 Data Bytes */
0 /* Vehicle Speed for speedo */
1 /* Vehicle Speed for odo */
2&3 /* Engine Speed */
4 /* Fuel Level */
5 /* Coolant Temp */
6 /* Shift 1-3, MIL, LOP, T/C Lamp Status, USA spec bit*/
7 /* Service lamp, spare 1-3, TH2o flash bit, bulb check rear fog, spare 1-2 */
Vehicle speed is scaled 1 KMH/bit
Engine Speed is not scaled (1 RPM/bit)
Fuel Level is scaled 0-255 = 0-100%
Coolant Temp is scaled 0-255 = -40-120degC (5/8 – 40)
Lamp status stat1 defined below:
SHIFT1 0x01 /* Instrument Pack Shift Light 1 */
SHIFT2 0x02 /* Instrument Pack Shift Light 2 */
SHIFT3 0x04 /* Instrument Pack Shift Light 3 */
MIL 0x08 /* Instrument Pack MIL */
LOP 0x10 /* Instrument Pack Low Oil Pressure Warning */
TRACCNT 0x20 /* Instrument Pack Traction Control Warning */
TPMSMIL 0x40 /* Instrument Pack Tyre Pressure Monitoring System Warning */
USASPEC 0x80 /* Instrument Pack Indication of USA spec vehicle (temp's in degF, etc) */
Lamp status stat2 defined below:
SERVICE 0x01 /* Instrument Pack Service Light */
SPARE1 0x02 /* Instrument Pack Spare Light 1 */
SPARE2 0x04 /* Instrument Pack Spare Light 2 */
SPARE3 0x08 /* Instrument Pack Spare Light 3 */
TH2oFLASH 0x10 /* Instrument Pack Flash Coolant Temp */
FOGLAMP 0x20 /* Instrument Pack Bulb Check Rear Fog Light Lamp */
SPARE4 0x40 /* Instrument Pack Spare Light 4 */
SPARE5 0x80 /* Instrument Pack Spare Light 5 */
My measurments showed:
AA -> speed (mph * 1.5)
FF -> temp (degs C * 1.6 + 64)
It could be coincidence that my speedo was inaccurate by the difference between kph and (mph * 1.5). I believe the temp calculation is accurate - the 1.6 multiplier in essence converts from dec to hex.
remember though the localised version of the speed/temps for 08+ is set in the can frame, unlike previous years where its fixed to metric and translated by the cluster
Would some kind soul post the definitive form of the "status" byte in the 0x400 CAN message for the '07? I've got
00000001 shift
00000010 engine
00000100 oil
Are these correct? Any idea on the remaining 5?
That is correct (bit 0 = immobilizer/shift light, bit 1 = check engine, bit 2 = oil pressure). The remaining 5 bits are unused.
0x22 0x3 0x34 Fastest Standing Start 0-100KMH
0x22 0x3 0x35 Fastest Standing Start 0-160KMH
0x22 0x3 0x36 Last Standing Start 0-100KMH
0x22 0x3 0x37 Last Standing Start 0-160KMH
0x22 0x3 0x39 Total number of Standing Starts