View unanswered posts | View active topics It is currently Sun Nov 19, 2017 10:22 pm



Reply to topic  [ 2 posts ] 
S12X Serial Monitor communication quirks 
Author Message
LQFP112 - Up with the play

Joined: Tue May 01, 2012 4:17 pm
Posts: 211
Location: Shrewsbury PA
Several people have noticed, that when using FreeEMS-Loader, you have to hit load twice to get it to actually load a file. This is most noticable when you first power up in SM mode, subsequent tries typically succeed.

I have managed to track down the reason for this, as the fact that the SM will send an indeterminant amount of null characters (0x0), before its response to the first command you send.

Typical command sequence according to the documentation

Code:
PC -> 0xD //Check to see if SM is alive
SM -> 0xE0 0x08 0x3E


This is indeed true, for all except the first communication. That goes more like this

Code:
PC -> 0xD
SM -> 0x0 0x0 0x0 (... some random number of 0's) 0xE0 0x08 0x3E


Where the SM waits for the PC to send its awake message before sending the 0's. Handling this by blindly reading after sending the first command, and then trying again seems to work every time.

Code:
PC -> 0xD
SM -> 0x0 0x0 0x0 (... some random number of 0's) 0xE0 0x08 0x3E
PC -> (Reads chars until 50-100ms timeout)
PC -> 0xD
SM -> 0xE0 0x08 0x3E

_________________
EMStudio
Interesting Stuff
My Car


Mon Jan 27, 2014 10:07 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14871
Location: Home sweet home!
These tactics only *appeared* to help for me in UL. There are still initial connection issues even with this approach. As you mentioned to me in a PM recently, it's the driver that's at fault, though I'm yet to prove it (busy dealing with other stuff right now).

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Mon Jan 27, 2014 10:26 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.