My16M Communication ProtocolThe page documents the communications protocol that My16M uses. This is normally hidden by the use of the ECUControl program or the Optimiser. It would be useful for someone who wants to write their own application that talks directly to My16M. My16M communicates
using a serial connection. The supplied RS232 adapter can be
plugged straight into a 9 pin COM port on a PC. Communication
is simple 3 wire RS232 with no software or hardware handshaking
at 38K, 8 bits no parity. Memory structure transferMany of the packets are used to transfer internal ECU structures. These structures are transferred using a common subroutine. A memory structure is transferred in the flowing format. <prefix>NND0D1...DnXX where NN is the
number of bytes in the structure in hex
void
TxMem_( uint8_t * Buf, int Cnt, char * Str ) int
i; int
i; } } Continuous UpdatesAs soon as the ECU
is powered up it begins dumping 3 structures continuously. The
rate of transfer is RPM dependant but for all intents and
purposes it can be consider realtime ( 5 - 10 times per second
). Timing InfoThis structure can be used to determine the engine speed, throttle setting and postion within the map, and the resultant engine pulses typedef struct { FullPulse_t SparkOff; // Position of spark pulse trailing edge - the spark FullPulse_t SparkOn; // Position of spark pulse leading edge - coil charging uint16_t PulsePeriod; // The time(us) between engine timing pulses uint16_t InjDuration0; // Pulse duration in us uint16_t InjDuration1; // Pulse duration in us FullPulse_t InjAdvance; // Position of injector uint8_t MapIdx_; // The index of the map entry being used ( lower left ) uint8_t fy; // The fraction throttle from base map entry uint8_t fx; // The fraction RPM from base map entry } TimingInfo_t; This structure is
prefixed with a "=1". typedef
struct Compensation InfoThis structure can be used to determine various corrections being applied to the map typedef struct { uint16_t AirPressure; uint16_t BaroAdjust; // The correction factor calculated from air pressure and temperature 1024 is 100% - no change from map uint16_t O2Adjust0:12; // The correction factor being applied to the map ( after baro correction ) uint16_t O2Index0:3; uint16_t ClosedLoopActive0:1; int16_t O2Target0; int16_t O2Target1; uint16_t CylinderOffSet; uint16_t InjDuration; // Pulse duration in us uint16_t O2Adjust1:12; // The correction factor being applied to the map ( after baro correction ) uint16_t O2Index1:3; uint16_t ClosedLoopActive1:1; uint16_t InjectorVAdjust; } CompInfo_t;
Analog inputsThis structure provides the raw analog signals as seen be the ECU
typedef
struct Get Map entry into edit buffer - "gXX\r"This command is sent to My16M to load
the map edit buffer with cell XX from the static map if the
edit buffer does not already contain that cell. XX is in
hexadecimal representation in upper or lower case and can take
a value of 00 to 8F (143 decimal). Two hex digits for XX ARE
required. The edit buffer takes precedence over the static map
for engine operation and can hence be used to modify the engine
timing in real-time. XX is an echo of the request parameter Set Map Edit buffer "Mssssddddiiii\r"This command is sent to My16M to set the map edit buffer that has previously been loaded with the "Get Map entry" command. If the engine is operating near the corresponding area of the map this will have immediate effect on the engine. The format is the same as the previous command. There is no response from My16M to this command. Program Map Edit buffer "x\r"This command is sent to My16M to program the map edit buffer into the static map cell that was previously select that was loaded with the "g" command. The entry is now permanently stored in My16M. There is no response from My16M to this command. Set My16M Configuration "cRRRROOTT\r"This command is sent to My16M to set the configuration. RRRR sets the red line RPM. The value is a 16 bit hexadecimal number representing the time in microseconds between engine sync pulses. There is no response from My16M to this command. Query the analog inputs "?\r"This command is sent to My16M to
retrieve all the analog inputs. All analog inputs are 10 bit
quantities. AAAA is a 16 bit hexadecimal number representing the oxygen sensor input Query the timing information "?1\r"This command is sent to My16M to
retrieve current timing parameters. SSSSSS is a 24 bit hexadecimal number representing the spark advance. The first two digits are the engine pulse, the next four digits is the delay in microseconds from the engine sync pulse to the trailing edge of the spark pulse. Query the configuration "?2\r"This command is sent to My16M to
retrieve current configuration parameters. Query the compensation information "?3\r"This command is sent to My16M to
retrieve current barometric and closed loop compensation
parameters. BBBB is a 16 bit hexadecimal number representing the barometric compensation multiplier that has been calculated from the temperature and pressure inputs. 0x4000 represent the 100% number.
|