Windows Serial Port Programming Robertson Bayer March 30, 2008 Intro This paper covers the basics of opening, reading from, writing to, and managing serial port communications using the Windows API. The overall goal here is to give you a basic overview of how serial communications programming works and to at least get you started along the.
--------------------------------------------------------------------------------------------------------------------------------------Code for programming the serial port on a Linux System using **ANSI C** and **Terminos API**.The codes can be used for transmitting and receiving data from an x86 Linux PC and a Microcontroller deevelopment board through 3 wire Serial Link or RS232 Port.
###You can find the original Tutorial here
##Features
PC side is written in ANSI C using Terminos API to Communicate with the Serial Port.
Transmission and Reception are kept seperate in different C files so that user can easily understand the mechanisms involved.
PC communicates with MSP430 microcontroller using a 3 wire serial Link (RX,TX,GND).Refer Tutorial for Circuit
The Microcontroller and PC are connected in null modem configuration using 3 signals (TX,RX and Ground).
Code will Work With Standard RS232 Serial ports or any USB to Serial Converter.
Microcontroller side code is written in Embedded C and can be Compiled using Code Composer Studio for MSP430.
The Hardware used is MSP430G2553 on Launch pad development board.
##Code Explanation
serial.c - A simple C file which opens a connection to Linux Serial Port and closes it.
USB2SERIAL_Read - Serial Reception Program which runs on the Linux PC and receives data from the MSP430 Microcontroller.The Received Data is then displayed on Console Window.
USB2SERIAL_Write - Serial Transmission which runs on the Linux PC and Transmits a charcter to the MSP430 Microcontroller.The MSP430 on Receiving the Character lights up an LED on the Launchpad Development board.
##Circuit
##Hardware used
- **USB to RS485/RS232/Serial Converter** - Details can be found here
MSP430 Launchpad Development Board
P: n/a
On Mon, 10 Nov 2003 21:51:05 GMT, in comp.lang.c , 'Ewan Sinclair' <ea**@nbnet.nb.ca> wrote:
Sorry if this question seems naive, but I'm a bit new to C: I would like to write something that can send and receive ASCII characters over a serial port, then pass them somewhere else for interpretation. Communication via the serial port is very hardware specific and not part of C . You will have to ask in a group specialising in your hardware or compiler platform. All the resources I have been able to find are vague or don't have anything C specific. Thats because its not a feature of C, but of specific hardware. Am I likely to need any extra libraries for C, or is serial port control built in at some level?
C has no builtin control for serial ports, however many implementations do. Read your compiler manual for morew info, or ask in a group specialising in it. -- Mark McIntyre CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html> CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>