Menu
Sep 30, 2008 The entry will say something like 'MSP430 Application UART COM5' or something very similar. When you setup the hyperterminal choose that com port, 9600 Baud with no flow control. In the previous zip file, the uscia0uart019600.c should work as is (this code is in the zip file above).
--------------------------------------------------------------------------------------------------------------------------------------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
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up Find file Copy path
Cannot retrieve contributors at this time
/* |
Software serial multple serial test |
Receives from the hardware serial, sends to software serial. |
Receives from software serial, sends to hardware serial. |
The circuit: |
* RX is digital pin P1.4 (connect to TX of other device) |
* TX is digital pin P1.3 (connect to RX of other device) |
created back in the mists of time |
modified 25 May 2012 |
by Tom Igoe |
based on Mikal Hart's example |
modified again 8 Feb 2013 |
by Brian Baker for MSP430 |
This example code is in the public domain. |
*/ |
#include<SoftwareSerial.h> |
SoftwareSerial mySerial(P1_4, P1_3); // RX, TX |
voidsetup() |
{ |
// Open serial communications and wait for port to open: |
Serial.begin(9600); |
Serial.println('Goodnight moon!'); |
// set the data rate for the SoftwareSerial port |
mySerial.begin(9600); |
mySerial.println('Hello, world?'); |
} |
voidloop() // run over and over |
{ |
if (mySerial.available()) |
Serial.write(mySerial.read()); |
if (Serial.available()) |
mySerial.write(Serial.read()); |
} |
Copy lines Copy permalink