[sdiy] Serial Ports

Tom Arnold xyzzy at sysabend.org
Thu Sep 23 11:07:13 CEST 2004


On Thu, Sep 23, 2004 at 09:36:23AM +0100, Jason Tribbeck wrote:
> It depends on the exact sequence of bytes that are being transmitted.

See, this is what gets me.

I've used uarts before.  The 6402 is a good friend of mine, simple to use
and cheap... and I've never had problem.

One thing that I find maddening is all the books I have that cover raw
serial protocol all seem to assume that there is a pause between bytes, One
of my old interfacing books even shows a bit string with pauses in between
each byte, but I cant find any spec that says There Shall Be a Pause.

Perhaps I'm concerned about nothing.  In theory a midi recieving device
should never come in in the middle of a conversation unless you made a
mistake and forgot to turn something on, so even if there isnt some pause to
look for.  Most of the bit banging code I've looked at doesnt do anything to
handle this, it just assumes the first bit it sees is a start bit and works
from there to the stop bit.  Some of the code will drop the data as bad if
it doesnt see a stop bit but most of it doesnt care and sends when it thinks
it has 8 bits.

It just seems so.... unclean or something...   

> If you were really adventurous, you could write out a sequence of
> start/data/stop bits, and work out what will happen if you start at any
> point in time.

I've got some simple code running now that just looks for serial data and
makes the assumption of First Bit Is Start, 8 data, Then Stop.  I think
you're right,   I'll fire up a sequencer or something to spew out a ton of
midi data and see what happens when I turn my board on at random times.

-- 
 ------------------------------------------------------------------------
 - Tom Arnold -       When I was small, I was in love,                  - 
 - Sysabend   -       In love with everything.                          -
 - CareTaker  -       And now there's only you...                       - 
 --------------         -- Thomas Dolby, "Cloudburst At Shingle Street" -




More information about the Synth-diy mailing list