How much out of sync are you getting? 1 ms, 100ms or 10s? How much drift is acceptable?

What exactly should the timing look like? Consider the timing diagram below:

A. Start sending command C. Wait period ends / / ---+------+--------------------+-----------+---- \ \ B. Command finish transmission D. Send next command.

If I understand correctly, you want to have the time between A and C be X milliseconds as determined by input from the file. The time between C and D should be as close to zero as possible.

Are you reading in all of the commands in the command set at once, and operating from memory? Or, are you reading each command from a file? The second approach could add time between C and D.

My next step in trouble shooting this would be to try and figure out which part of the process we are at when the time is being lost/gained.


TGI says moo


In reply to Re^3: Serial Port timing and write blocking? by TGI
in thread Serial Port timing and write blocking? by worldsight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.