'r' command is a generic form of the 'a' command. It is used to read inputs and the returned bytes from MS II are not buffered.
Send 'r', <CANid>, followed by 2 bytes specifying the offset from the array or structure corresponding to tble_idx, followed by 2 bytes specifying the total number of data bytes desired. The offset word and the number of bytes word must each be sent msb (most significant byte) first, then lsb (least significant byte). After all 7 bytes are received, MS-II™ will start sending the requested number of bytes. Thus to duplicate the 'a' command, you could send 'r', 0, 6, 0, 0, 0 (msb of 112), 112.
'w' command is the reverse of the 'r' command - it writes to MS-II™. The format of the command is identical to 'r', except send 'w' and follow the seventh byte with the nbytes of data to be written to MS-II™ RAM.
'e' (echo) command is the same as 'w', except that after MS-II has received all the bytes from the sender, it echoes them back for verification. Thus a sender who has sent n bytes to be written should expect n bytes back from MS-II™ starting after he has sent the last byte to be written.
'y' command has format 'y', <CANid>, <tble_idx> and is used to verify that input data in a RAM block matches the corresponding flash block. This is typically used after a flash burn command to verify the data were correctly burned. MS-II sends back a 2 byte word, lsb first, that holds the number of times a ram and flash byte pair failed to match. So if it returns a zero, all is good.
'b' command has format 'b', <CANid>, <tble_idx> and is used to tell MS II to burn the RAM copy of <tbl_idx> into the flash copy of it.
There are also some specialized commands for MS-II. These are:
't' command. This command is for re-flashing new coolant, MAT, EGO, and MAF tables. These tables are all 1024 word (2byte) tables. The 't' command is followed by <tble_idx> of 0 - 3, to identify the table of interest. At that point the MS-II™ erases the table flash sector entirely (that is why you do NOT want to be driving while this is going on). So you want to delay about 50 milliseconds to allow the flash to be erased before sending the the rest of the data, which consists of the table words. These are sent in order of ascending index, msb (most significant byte) byte first, then lsb (least significant byte) byte for each of the 1024 16-bit words.
'C' command, no other characters, causes the current value of the 16-bit seconds counter to be sent back. It is only used as a check that comms are working.
'Q' and 'S' commands (both caps) are used to retrieve two indicators of the MS-II code version. The first is the 20-byte ASCII string for the Rev Number of the code version, the second is for a 32-byte Signature string. The latter is changed in the code whenever a new feature is added, the first is changed in the code whenever there has been an input parameter or output variable added.
There are also re-initialization, reboot and code reloading commands, all starting with '!'. The complete commands are:
- '!', 'x' causes MS-II™ to re-initialize various program values, for example the ncylinder-dependent coefficient for computing RPM, to be re-calculated. It should be used only when the following specific variables are changed:
- spark polarity,
- tach input polarity,
- ignition options. including dual spark options,
- warmup enrichment parameters or tables,
- baud rate,
- can_id.
- '!', '!', 'x' If rpm < crank_rpm, this causes the program to reboot itself and start running - not currently used.
- '!', '!', '!' If rpm < crank_rpm, this is the same as reboot, except the program comes up ready to load a new code version - not currently used.