home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!cup.portal.com!dbell
- From: dbell@cup.portal.com (David J Bell)
- Newsgroups: sci.electronics
- Subject: Re: How does a UART do it...
- Message-ID: <65414@cup.portal.com>
- Date: Mon, 7 Sep 92 11:21:34 PDT
- Organization: The Portal System (TM)
- Distribution: world
- References: <18ff9hINNa5b@grapevine.EBay.Sun.COM>
- Lines: 24
-
- >Given a stream of 1s & 0s, how does a UART get the character framing
- >established, i.e. how is the 'start' bit differentiated from all the
- >others? (I want to emulate one in software)
-
- >Steve
-
- The 'start' bit is the first transition from the resting state. If
- I remember the archaic terms correctly, the line rests in the SPACE
- condition, and the start bit is *always* a MARK, and is the first
- bit transmitted (obviously :{) ). Given the baud rate, the UART
- counts out N/2 (N is commonly 16) clocks at N*Baud frequency, and
- verifies that the current state is *still* a MARK. Subsequent reads
- are then done at N clock intervals, and the 10'th read verifies that
- the 'stop' bit is a SPACE. This makes it sample in the middle of
- each bit cell, and checks leading and trailing framers. I believe
- it then *immediately* resets to the waiting-for-start state, and
- loops as above...
-
- Auto Baud detection is sort of magic; it usually requires the
- firmware to keep trying various rates until a reasonable and
- correctly framed character is received.
-
- Dave
- dbell@cup.portal.com
-