need help to communicate through RS232 in C


Thread Starter


Me and my partners are working on our Senior Design project, in which we need to communicate thru RS232 to transceiver that will transmit data.
We need to write a code in C that will do this for us. Does anyone know anything, how to make it work.
If you're working under a *NIX, I'd
suggest basing your code on a old
program called logserial. I did a bit
of stuff using version 0.3, I think it
was. A google search should bring it
up on one of the university sunsites.

Bluexcell says here is an excellent site;

RS-232 Interfacing

Interfacing the Serial Port - Parts 1 and 2
Explains the pin diagrams of the RS-232 Port and the 8250 & Compatible UARTs. Includes information on handshaking, Null Modems, DTE/DCE
Speeds, flow control, types of UART's etc. The second part of this series gives details of the Serial Ports Registers for the PC (8250 to
16750 UARTs) and the Serial Port's Addresses in the PC.

Interfacing the Serial Ports - Parts 3 and 4
Starts with example programs written in C, using both the Interrupt Driven and Polling methods for the PC. Gives details of how the programs
work and how they can be changed to suit your requirements, i.e. Changing addresses, FIFO Buffers, IRQ's etc. It then gives details of
interfacing your own projects to the RS-232 Port using MAX-232's, CDP6402 UART's and Micro-Controllers.
I'm not sure which operating system are you working on it. Followings are the solutions I know.
There's a company, Moxa technologies, provide APIs for easy RS-232 programming.
DOS - you may use Moxa API-232 to control the RS-232 port. The API-232 works with C language. You may have to purchase the serial board from them.
Win32 - you may use Moxa PComm Lite API to control RS-232 port. It works with VC, BC. PComm Lite even provides ready-made file transfer protocols, XModem, YModem, ZModem. It's compatible to any COM ports in your Windows system.
Above utilities are free for download.
Hope the information helps.