Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: 9 bit communication on RS 232



"suchitra" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello All
> I wanted to know how can we configure com port for 9 bit
> communication.
> I intend to use the 9th bit as Address/data bit..since i want to
> communicate with more than one devices.
> I am using turbo c compailer if some one can give me some reference
> code that will be great..
> with kind Regards
> Suchitra

I assume that you are using a PC architecture UART as you do not mention
this minor detail.  The PC's uarts do not really support 9 bit addressing as
some microcontrollers do.  However, you can emulate this bit with the parity
bit.  On sending, send with the parity bit high for address and low for
data.  On receiving receive with parity low always.  That way a byte
received with a parity error will be an address byte (that is if you need
the PC to decode addresses).  This does not work for full duplex comms.  If
you don't care about the PC being able to respond to addresses, then just
ignore parity errors.  You will naturally lose the protection that the
parity bit gives you against data corruption.

HTH
Alf
[EMAIL PROTECTED]
www.micromagic.net.au



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 3/11/2003





<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.