[comp.lang.c] Help: Output to RS232 ports

tomg@code3.com (Tom Green) (06/19/91)

To: ron@eatdust
Subject: Re: Help:  how to output to a port such as a RS232?
Newsgroups: comp.lang.c
In-Reply-To: <1991Jun14.152321.1698@cherokee.uswest.com>
References: <1991Jun11.135431.22955@udecc.engr.udayton.edu> <8380@awdprime.UUCP>
Organization: 3M Health Information Systems
Cc: 
Bcc: 

In article <1991Jun14.152321.1698@cherokee.uswest.com> you write:
>In article <8380@awdprime.UUCP> sjb@piobe.austin.ibm.com writes:
>>In article <1991Jun11.135431.22955@udecc.engr.udayton.edu>, Jinghong Li writes:
>>> Help needed:  would someone tell me how to send output
>>> to a port such as a RS232?  Any sepcial commands? 
>
>other stuff deleted.
>
>I responded to him by mail, but thought I'd post because I'm also interested
>in communications.  I got a book by Sam's, called "C programmer's Guide to
>Serial Communications" by Joe Campbell, ISBN 0-672-22584-0.
>
>I haven't implemented any code with it yet, but while reading it I feel it's
>quite comprehensive and informative.  
>
>Have others read it?  Comments?  Do you recommend other books over (or in
>conjunction with) to understand (and be able to write code for) async comm?

I found the book to be quite good.  A few problems with the book are that the
definitions for the odd and even parity masks for the U8250 were incorrect.

The book should read:

#define ODD_MASK		0x20
#define EVEN_MASK 		0x30


The other problem is that the book doesn't define the base address
for serial ports 3 and 4.

These can be added with the definition of:

#define COMM3			0x3e8
#define COMM4			0x2e8


Also the definition of the comm base address to be a unsigned char pointer
I found to be inappropriate to deal with regardless of the explanation
given in the book.  Just declare it as an unsigned int.

Otherwise the book is an excellent base for a good library of routines
and I recommend it.

All standard disclaimers apply.


-- 
Tom Green
- Life's a pain, then you die.				  _/_ __ ____ __
  "I shall be swift, and merciful" - the Gorn		  /  /_// / //_/
tomg@code3.code3.com                                                 _/