AW: [En-Nut-Discussion] 9-Bit UART Communication

Oliver Schulz Oliver.Schulz at bong.de
Thu Dec 4 08:41:14 CET 2003


Hi Harald,

I think the ioctl method is the better choice and it's easier to implement in the new driver. 
For the user it is also easier to use ioctl than some kind of byte-stuffing on sender's and receiver's side. This will just blow up the code and the receiver must always check this start/stop sequence and has to do some destuffing....

So I vote for IOCTL!

Cheers,
Oliver.

> -----Ursprüngliche Nachricht-----
> Von: Harald Kipp [mailto:harald.kipp at egnite.de]
> Gesendet: Mittwoch, 3. Dezember 2003 21:25
> An: Ethernut User Chat (English)
> Betreff: [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