Serial protocol
Moderators: jsmcortina, muythaibxr
Serial protocol
iv been playing with an arduino, grabbing info to display on a small screen from serial, and on ms2 v 3.3.2 it works pretty well, but when i try it on ms3 pre 1.3alpha9 it does not work so well, iv changed the data table length to match the f/w also increased the serial buffer to, i can get some info from it like rpm and afr1, also sometimes i get extra or duplicated bytes meaning i receive more than im expecting, is the serial protocol different between ms2 & ms3?
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Super MS/Extra'er
- Posts: 9130
- Joined: Sun May 02, 2004 6:51 am
- Location: Quebec, Canada
- Contact:
Re: Serial protocol
The protocol is the same. The information specific to the command and data is in the ini file for the firmware you're using. If you're not getting the correct data, you likely have either a serial comm issue or an arduino issue.
Jean
Jean
-
- Site Admin
- Posts: 39621
- Joined: Mon May 03, 2004 1:34 am
- Location: Birmingham, UK
- Contact:
Re: Serial protocol
Is your CRC checking detecting these problems?grom_e30 wrote:iv been playing with an arduino, grabbing info to display on a small screen from serial, and on ms2 v 3.3.2 it works pretty well, but when i try it on ms3 pre 1.3alpha9 it does not work so well, iv changed the data table length to match the f/w also increased the serial buffer to, i can get some info from it like rpm and afr1, also sometimes i get extra or duplicated bytes meaning i receive more than im expecting, is the serial protocol different between ms2 & ms3?
James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk
My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Re: Serial protocol
I'm not totally sure if I'm using the CRC. But on ms2 set the table length as the och block size can read temp, AFR, battery and rpm. Chang block size as on ms3, can get AFR and rpm, but not temp or tps. When you mention the CRC is that aimed towards tuner studio using it or arduino? Looks like if got some homework to do tonight and read up on this lot some more
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Super MS/Extra'er
- Posts: 9130
- Joined: Sun May 02, 2004 6:51 am
- Location: Quebec, Canada
- Contact:
Re: Serial protocol
I have tried to look at that before but the file is not working.
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Super MS/Extra'er
- Posts: 9130
- Joined: Sun May 02, 2004 6:51 am
- Location: Quebec, Canada
- Contact:
Re: Serial protocol
Click on the confirm line in the window you get with the link.
Re: Serial protocol
So would the CRC still be there with the A command?
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Site Admin
- Posts: 39621
- Joined: Mon May 03, 2004 1:34 am
- Location: Birmingham, UK
- Contact:
Re: Serial protocol
The CRC is the biggest single change in the protocol, you are supposed to use it to validate that the data you received is valid.grom_e30 wrote:I'm not totally sure if I'm using the CRC. But on ms2 set the table length as the och block size can read temp, AFR, battery and rpm. Chang block size as on ms3, can get AFR and rpm, but not temp or tps. When you mention the CRC is that aimed towards tuner studio using it or arduino? Looks like if got some homework to do tonight and read up on this lot some more
James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk
My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Re: Serial protocol
I'm trying to wrap my head round this so to request the information from the ecu with the "A" command it should be 7 bytes long 0x00 0x01 0x41 0xd3 0xd9 0x9e 0x8b. Data length then the command followed by the crc
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Super MS/Extra'er
- Posts: 9130
- Joined: Sun May 02, 2004 6:51 am
- Location: Quebec, Canada
- Contact:
Re: Serial protocol
The 'A' command will work without the wrapper and will then return an unwrapped response. But you won't know if there was any communication error. And if you do wrap it, then you're correct about the resulting command.
Jean
Jean
Re: Serial protocol
OK is it always an unwrapped response from the A or if you wrap the command you get a wrapped response?
1990 bmw 320i daily driver with m20b25 ms3 sequential fuel, 380cc injectors, d585 coil near plug, home made cam sync, launch control, fan control, vss, homebrew egt logging what's next????
-
- Super MS/Extra'er
- Posts: 9130
- Joined: Sun May 02, 2004 6:51 am
- Location: Quebec, Canada
- Contact:
Re: Serial protocol
If you send a wrapped command, you receive a wrapped response.
Jean
Jean