LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-14-2011, 10:13 PM   #1
cucub
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Beginner at ttyS1


Hi folks,

I'm a quite "old" linux user but new on serial communications.

Following my current problem:
I have a embedded system from Via (vx855) equipped with two setial ports. The second port, ttyS1 is set to RS422 by jumper on the main board. This port is conected to a stepper motor. Now, by this connection I should be able to communicate with the firmware of the motor. But somehow it does not work. Using a USB-to-RS422/485 adapter and "talking" (putty, screen etc..) to ttyUSB0 works fine but on ttyS1 not.
I used the serial port sniffer jpnevulator to get an idea what is going on: when I type eg. "q" to the ttyS1, jpnevulator sniffs a "G" (ASCII 47).... looks like all keys have been mixed up.... Hove no idea where to search for this problem, any advices?

Example:
echo echo -e -n "q" > /dev/ttyUSB0 sniffer reads ASCII(HEX) 71 with is q
echo echo -e -n "q" > /dev/ttyS1 sniffer reads ASCII(HEX) 47 with is G, how come???

Last edited by cucub; 03-14-2011 at 10:37 PM. Reason: Example added
 
Old 03-15-2011, 03:33 PM   #2
Rod3775
Member
 
Registered: May 2008
Location: Washington State
Distribution: Slackware-current
Posts: 94
Blog Entries: 10

Rep: Reputation: 18
The most likely problem is an incompatibility in serial baud rate or stop bit (less likely) between your devices. You didn't say what baud rate you were trying to use, but a stepper is not going to want anything real fast. If you don't have a direct way to measure baud rate, you can send a long sequence of chars (like 1000) and stopwatch how long it takes (and that the # of characters received by your sniffer is correct!). Another possibility is reversed differential signals. RS422 is a balanced voltage system, and if your embedded system drives the lines in the opposite sense than your USB converter, you would get garbage. Check the polarity from each (with a voltmeter) when nothing is being transmitted, and make sure they are both the same.
 
Old 03-16-2011, 09:59 AM   #3
cucub
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Hi and many thanks for the answer

Baudrate is both 9600, stop bit both 1

Quote:
Originally Posted by Rod3775 View Post
Another possibility is reversed differential signals. RS422 is a balanced voltage system, and if your embedded system drives the lines in the opposite sense than your USB converter, you would get garbage.
That looks like a very good guess. Just got the RS422 pin configuration from the embedded board:
Embedded board RS422 D-Sub9:
Pin 1: TX-
Pin 2: TX+
Pin 3: Rx+
Pin 4: Rx-
Pin 5: GND

USB-to-RS422 converter RS422 D-Sub9::
Pin 1: TX+
Pin 2: TX-
Pin 3: Rx+
Pin 4: Rx-
Pin 5: GND

So TX seems to be reversed.
I gone make a new wire, test and report....
 
Old 03-20-2011, 01:43 AM   #4
cucub
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Tested and yes, TX is reversed, now all works

Many thanks
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
respawn changes to off on ttyS1 DownhillGeezer Linux - General 4 02-19-2007 11:25 AM
modem on ttyS1 ?? skguha Linux - Newbie 6 08-18-2005 07:08 PM
ttyS1 problem or whot? Xon Linux - Hardware 2 12-01-2004 05:52 AM
No such device /dev/ttyS1 gsancho Debian 3 09-23-2004 05:40 PM
parse info from ttyS1 franklin97355 Programming 1 12-31-2003 01:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:17 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
Open Source Consulting | Domain Registration