[En-Nut-Discussion] 9-Bit UART Communication
Mike Lutton
mike.lutton at comcast.net
Thu Dec 4 03:28:40 CET 2003
I vote for the ioctl method. The special bytes method sounds more complex.
Mike Lutton
----- Original Message -----
From: "Harald Kipp" <harald.kipp at egnite.de>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Wednesday, December 03, 2003 3:24 PM
Subject: [En-Nut-Discussion] 9-Bit UART Communication
> Hi,
>
> I'd like to ask the list for opinions.
>
> First of all my special thanks to Brett Abbott for
> his 9-bit UART driver contribution. As other users
> confirmed, this code is working reliable. But, as
> contributors know me, I'm not easy to satisfy...not
> even with my own code. :-)
>
> Brett's code uses a second buffer to store the
> additional bits.
>
> The ninth bit is used to indicate an address frame.
> Thus, most of the characters will be transmitted with
> the ninth bit cleared. In addition, the ATmega has
> a special provision to ignore frames without the
> ninth bit set. Simply enhancing the I/O buffers from
> 8 to 9 bits will not use the benefit, discarding
> data frames with MCU interaction on a bus system, which
> are not addressed to the local MCU.
>
> One idea is to use a special ioctl to switch the
> transmitter or the receiver to MPCM or back.
>
> A second idea is to define a frame start/stop sequence,
> let's say 0xFF 0xFF and use 0-byte stuffing for
> sending this as normal data. I mean, if you need to
> send 0xFF 0xFF and the UART is working in 9-bit mode,
> you must send 0xFF 0x00 0xFF. The same is true for
> the receiver side. If 0xFF 0xFF is received as data,
> the application will get 0xFF 0x00 0xFF.
>
> I'd vote for the first one, using an ioctl. To keep
> it simple, the buffer must be flushed before switching
> modes. But I think that this fits to the typical usage
> of 9-bit communication anyway.
>
> Please let me know your view. Critics and even flames are
> welcome. There will be no new UART driver until I hear
> from you, basta. :-)
>
> Harald
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
More information about the En-Nut-Discussion
mailing list