The firmware handles the received serial messages as follows:
From start of string, character position is counted, with the target fields being stored in temp registers. This data doesn’t get used until the linefeed character is detected. The linefeed must be the 67th character or else the comm error flag is set and the string is ignored & overwritten by the next transmission. This ensures that only the status message data is used.
Format below (from the wiki)
TR=000 CR=000 CF=002 PW=000 HS=0315 RT=0716 FB=00 BA=000 AH=000.0
Other received data includes the firmware version on powerup, as well as the confirmation data sent back when you change a cougar parameter. Since the linefeed is at a different position these strings are ignored.
Framing errors and receive queue overflows also set the comm error flag so any string occurring during these events will also be ignored.
Older versions of Cougar firmware that do not follow the above status message format are incompatible. The new 1000amp controller follows the same format, with a new pack voltage field appended to the end. To be compatible, this only requires a change to one line of code indicating the new position of the line feed character.
-Chris
|