Coder Social home page Coder Social logo

zhuminfeng / serial-port-programming-on-linux Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rifotu/serial-port-programming-on-linux

0.0 0.0 0.0 11 KB

Programming the Serial port on Linux in C using termios API

Home Page: http://xanthium.in/Serial-Port-Programming-on-Linux

License: MIT License

C 100.00%

serial-port-programming-on-linux's Introduction

Programming the Serial port on a Linux System using C and termios API

-------------------------------------------------------------------------------------------------------------------------------------- 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

Screenshot of the serial port programming code running on Linux


##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

serial-port-programming-on-linux's People

Contributors

xanthium-enterprises avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.