Page 1 of 1

Info from char "a"

Posted: Tue Sep 14, 2010 12:11 pm
by larry_s
What I am trying to do is obtain information from microsquirt about the engine speed so it can be sent to the rs232. From searching the code in main v2.891.c (about line 7003), it says that if the character “a” is sent, all of the engine data is returned. From examining data already captured, after the “a” character is sent, it is followed by a null, then there is an acknowledgement followed by another null. Where can I expect to see the rpm data? Also, is this data little endian or big endian? How can I calculate the engine speed from this, and how many bits of data represents an unsigned integer? I'd appreciate any help.

Thanks,
Larry

Re: Info from char "a"

Posted: Tue Sep 14, 2010 12:31 pm
by grippo
The data come over as binary data, not ascii, so it shows up as unprintable characters on a terminal program like hyperterm. To test your setup, just give it a 'Q' command (uppercase Q) in hyperterm. You should see a string, MSII + version number come back in ascii. TS has a mini-terminal that you can set to ascii or decimal, and that may give you what you want. The rpm is in decimal and you can read rpm directly. You can find the breakdown of variables by looking at the ini file - it lists each variable and its type and byte offset.