[sdiy] Serial Ports
René Schmitz
uzs159 at uni-bonn.de
Thu Sep 23 19:29:14 CEST 2004
Hi Tom,
Tom Arnold wrote:
> So, this is synth related ( midi )
>
> How does serial get in sync?
> So I'm reinventing the wheel on something, writing my own bit banging
> routines for the fun of it. And now I'm curious, I mean start
> bit/data/stop bit is fine and all, but what happens if you come in in the
> middle of a conversation? How do you sync, or do you not? Or do you just
> hope you have a moment of silence longer then 10 bits so you can go "Hey,
> I'm between bytes!" ?
Its a point to point protocol. I.e. there is only one sender and one (or
more) receiver(s) connected to the transmission medium. So nobody can
babble into a conversation that is going on. (You have two wires, one
for each direction...)
(There are variants of serial communications that use a real bus with
multiple senders (RS485 for example), but usually there is a "master"
which arbitrates the access of the other interfaces.)
As for bit detection, you basically wait for the transition of the start
bit, wait half a bit time, and them sample several times to detect the
start bit (majority of samples). After that you wait until you're in the
middle of the next bit time, and sample again, repeat that for all
remaining bits.
Cheers,
René
--
uzs159 at uni-bonn.de
http://www.uni-bonn.de/~uzs159
More information about the Synth-diy
mailing list