A little bit more about HDLC encoding and framing: HDLC is not a very good choice for an ISOCRONOUS data stream (one where the same number of bits must be transferred in each second) because the bit stuffing can 'slow down' the link. One way around this is to prevent bit stuffing from happening. Assume you want to send the four bytes: ABCDEFGH IJKLMNOP abcdefgh ijklmnop By sticking a zero bits after every four data bits before you send the data to the HDLC layer you get: ABCD0EFG H0IJKL0M NOP0abcd 0efgh0ij kl0mnop0 This adds one extra bit for every 4 data bits, so the packing efficiency is still 80% (compared to 50% for Manchester). Bob Ammerman RAm Systems ----- Original Message ----- From: "Bob Ammerman" To: Sent: Tuesday, August 12, 2003 10:41 AM Subject: Re: [PIC]: serial transmission > From: "Olin Lathrop" > > There are many communications schemes that don't require a separate clock > > signal or require the transmitter and receiver to agree on a clock > > frequency in advance. Manchester encoding is popular because it makes > > good use of the bandwidth. > > Actually, Manchester encoding is one of the poorest schemes to use if you > want to maximize your use of the bandwidth. This is because there can be up > to two transitions per bit cell, effectively doubling the required > bandwidth. > > HDLC type encoding and framing is far more efficient than Manchester. > > In HDLC encoding, a zero is represented by a change of state on the line, > and a one is represented by the line not changing state. You would expect > that this would cause a great deal of trouble with a long run of ones > because there would be no clock transitions, and you would be right. To > avoid this problem the transmitter simple stuffs a zero bit after any five > consecutive one bits. The receiver removes these stuffed in bits by ignoring > a zero bit after five consecutive one bits. Thus the receiver will see at > least one transition every six bit times, which should be plenty to keep the > clock synchronized. > > HDLC framing allows a unique flag bit pattern to mark the start and end of a > frame. This pattern cannot occur during normal operation. The transmitter > simply sends 01111110, which is an illegal sequence in the basic encoding > (it has six one bits in a row). When the receiver sees the first five one > bits it will be in a state where it is expecting the stuffed-in zero bit. > When it sees a one instead of the stuffed in zero it knows it has a special > case. If the bit following the one bit is a zero then it has seen a flag. (A > pattern of 01111111 means that the transmission is being aborted). > > Note that an idle HDLC line simply transmits a continuous series of zeros. > > One feature of Manchester that HDLC doesn't have is that HDLC is not > balanced over the short run (i.e.: there is an equal amount of high and low > time on the line). > > All of the above seems pretty complicated, but it can be handled by a > relatively simple state machine. > > Bob Ammerman > RAm Systems > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body