LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-12-2013, 02:16 AM   #1
biyabani
Member
 
Registered: Mar 2013
Posts: 65

Rep: Reputation: Disabled
Uart not working when communicate with board to board


Hi,
I am working on ARM9 based LPC3250 controller with linux kernel version 2.6.34 and i have ported kernel and device drivers with all UARTs(lpc3250 has 7 uarts) in board.

Actually,i have tried to communicate from board to board using UART(two boards are similar).

The connections are
Board1 console is connected to its own UART1(that is application running on UART1)
Board2 console is also connected to UART1(that is application running on UART1)

UART5 of board1 is connected to UART5 of board2 .


I send the data from application of board1 to board2 using below commands

tty -F /dev/ttyS0 115200 cs8 -cstopb -parenb
echo "welcome to my world" > /dev/ttyS0

I tried with different baud rate like 9600 but that data is not received at board2.
And i also written the user application for transmitting and receiving data but it is also giving same problem.

What could be the reason?Please give reply.

Thanks & Regards,
MOHAMMAD BIYABANI.
 
Old 07-12-2013, 03:11 AM   #2
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 290

Rep: Reputation: 55
The COM ports use RS-232, which was designed to connect a terminal (or serial board) (DTE) to a modem (DCE). The standard cable is a straight pin 1 to pin 1 (etc.) arrangement.
The pin out for a modem is different than a terminal (any CPU connected UART). If you connect two controllers (two DTE) with an ordinary cable, you will have outputs connected to outputs. Thus if you want to connect two controllers you need a NULL-MODEM cable. This cable has the necessary wires crossed over so that output pins connect to the input pins.

See RS-232: http://en.wikipedia.org/wiki/RS-232

The second problem is that a UART port will not look at the serial data until the control signals are correct (the handshake).
What is correct depends upon how the UART software is setup.
Normally it needs:

Signals that both ends are present, connected, and ready
(DTR) Data terminal ready (output on DTE, input on DCE)
(DSR) Data set ready (output on DCE, input on DTE)
Many times turning on DTR requires a special port command.
Ignoring DSR is a special port setting.

To prevent buffer overrun, hardware flow control
(RTS) Request_to_send (output on DTE, input on DCE)
(CTS) Clear_to_send (output on DCE, input on DTE)

Null Modem: http://en.wikipedia.org/wiki/Null_modem
A.Tx -> B.Rx, A.Rx -> B.Tx
A.DTR -> B.DSR, A.DSR -> B.DTR
A.RTS -> B.CTS, A.CTS -> B.RTS
The null modem cable imitates being two DCE connected together. Each end of it looks like a DCE.

If software flow control is enabled, then an XOFF code will disable the transmitter until an XON code is sent to it.

There is also a test connection called a loopback device.
This connects the outputs of a UART to its own inputs.
When the UART is in Full-duplex, characters typed in a terminal will echo back to that terminal. This verifies that the UART transmitters and receivers are working.

If the two devices do not have good ground compatibility then a ground loop will occur.
We tried connecting computers on two adjacent computer racks, connected their grounds together with heavy cables, and it would not work. Ground currents in the range of 10 to 20 amps would flow to maintain a ground voltage difference. All the ground cables connecting the racks had to be removed, except for one (no loops). We had to switch to differential RS-422, which can tolerate a few volts of ground difference.

Otherwise one end must be grounded by its cable connection to the other. The ground of a modem would be from the computer. With two computers directly connected, the grounds will fight. Consider using an optically isolated NULL-MODEM device.

It really helps to have a RS-232 cable monitor. This is a small device that plugs into RS-232 cables with an LED for each signal wire. Not expensive and tells you immediately what is happening.
Identify if you have DB-9 or DB-25 connectors. DB-25 is the full standard, but most small computers only have DB-9 these days. Some test equipment has connectors for both, but if you get DB-25 by mistake, you will need DB-9 adapators.
For connecting two computers, a breakout box is handy. It provides connectors for two DB-25 or two DB-9, with individual jumpers to selectively connect them to each other.

A fancy breakout box: http://www.bb-elec.com/Products/Data...2513ds-pdf.pdf
Comparison of tracers: http://www.conserver.com/consoles/Tracers/tracers.html

If you buy a tracer where the LED stick up, then blacken them with marker and then (gently !!!) file them down half way. Only file down the plastic dome. Do not hit anything inside. This makes them much easier to see, and lessens the pressure on the internal circuit board. Otherwise the light from one LED leaks into the others, and the dome sends the light in only one direction (never where you are).
If using a motor tool, grind with the highest speed possible, to lessen vibration. Do not attempt to cut off the domes as it will catch and fling the unit across the room (which does it no good).

If you make your own, I would recommend to NOT use bi-color LED, because they just turn yellow and color is too difficult to see. Use separate green LED and red LED. It is much easier to see a 100 ms blip of transmission on an individual LED, than it is to see a 100 ms color change.

Last edited by selfprogrammed; 07-13-2013 at 01:13 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MINI2440 board with Samsung S3C2440 ARM9 Board + 7"TFT Eddy van den Boom Linux - Newbie 5 05-24-2012 06:07 AM
Kernel Testing using LTP on Beagle board (ARM based Embedded Dev Board) Rajender.G Linux - Newbie 0 07-27-2011 06:19 AM
Error trying to configure the touch screen on the Beagle Board XM Expansion Board marietto Linux - Hardware 0 06-30-2011 03:37 PM
UART driver porting from 2.4.20 to 2.6.10 for freescale imx21ADS21 board. AshishVyas Linux - Newbie 1 05-15-2008 07:30 AM


All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration