The software is written using C language and communicates with the Serial Port using Win32 API. In Windows,Serial ports are named as COM1, COM2,COM3. COM1 and COM2 usually refer to the hardware serial ports present in the PC while COM numbers in double digits like COM32, COM54,COM24. Etc are given to USB to Serial Converters or PCI serial port extenders. How to send value with serial port (C Language) edit. Now I need to get this pixel value and send it with serial port, where a xBee is connected, but I don't know how can I do that. I would appreciate it if someone could help me to send the pixel value to the xBee with serial port.
--------------------------------------------------------------------------------------------------------------------------------------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