Home Contact us Terms & conditions Shopping cart


Linux SoM



This article is obsolete or related to an obsolete product.
Please contact us at info@acmesystems.it for any further information.

Using serial ports in C

In this article we will show how to interface the TTL serial ports /dev/ttyS2 and /dev/ttyS3 available on the J6 connector with real RS232 devices

The FOX Board has two serial port on its J6 connector. These port pins come directly from the Axis MCM ETRAX 100LX processor pins, so the electrical levels are TTL compatible, with levels between ground and +3.3 Volts. This means that is NOT possible to connect directly the console port of the FOX with simple wires to the serial port of a PC. You need to interpose a simple circuit based, for example, on a MAXIM MAX3232 for level translation and inversion as shown below:


Schematic of a RS232 interface with a MAX3232 (3.3v to RS232)

The Axis MCM Etrax100LX processor is +5Volts tolerant, so it is possible to connect also an electrical RS232 translation circuit externally powered at +5Volts.

How to try the serial ports

Use a null modem cable connect the FOX Board to an RS232 port of your PC:


RS232 cross cable

Run on your PC a terminal emulator (ie. Hyper Terminal or Minicom) and set a baudrate (i.e. 19200,N,8,1) . Copy serial_test utility available at the download section of this article into your FOX Board and make it executable.

chmod +x serial_test

Setup the same baudrate of your terminal to your FOX serial interface (i.e. /dev/ttyS2):

stty -F /dev/ttyS2 19200
run serial_test:
./serial_test /dev/ttyS2
Every character you will press on the console will send to the serial port in this form:
TX: hexvalue [ascii char]
Every character you will on the serial terminal will send to the console in this form:
RX: hexvalue [ascii char]

Download

Related articles

Related links




Acme Systems srl
Via Aldo Moro 53 - 00055 Ladispoli (RM) - Italy
P.IVA/C.F. 08114831004
Tel +39.06.99.12.187 - Fax +39.06.622.765.31
http://www.acmesystems.it -
Iscritta al Registro delle Imprese di Roma al n. 08114831004


Atmel© Certified Partner

Documentation Terms of Use
Acme Systems provides this documentation "as is" without warranty or guarantees of any kind. The mantainer of this site (Sergio Tanzilli), has gone to a great deal of effort into making this documentation as correct as possible. Acme Systems doesn't provide any direct support for the Open Source preinstalled software but provides, through these pages and forum posts, all the information required to obtain the sources, install, use and update the Open Source softwares runnable on the FOX Board, NetusG20, AriaG25 and Terra platforms. Please note that all the preinstalled softwares, used on the Acme Systems products, are Open Source and you will have to check the license terms provided (usually the GPL) by each author before using it in any commercial or non-commercial product, by yourself. Before sending emails or calling the Acme staff here are our contacts please note that WE ARE MAINLY HARDWARE DESIGNERS and NOT LINUX GURUS so could be better to post your questions directly to the forum listed below to be sure that all the contributors of this site and the large software developers community will read and reply to your questions.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Creative Commons License