LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 04-24-2013, 04:21 PM   #1
IDEASeth
LQ Newbie
 
Registered: Feb 2013
Posts: 12

Rep: Reputation: Disabled
485 serial port


I am trying to get a 485 port on a Manx PC-104 board to work. This is suppose to be COM3 in Windows or TTYS2 in Linux. I have written a C-program to enable the 485 hardware transmitter and dump characters into the UART's transmit buffer. This works. I can see the 458 serial stream on an oscillascope <sic> so I know the hardware is OK.

But when I stop the C-program and then try to output using a Linux driver, it doesn't work -- nothing on the scope.

I have tried 2 approaches to stimulate the output:

--- I have used minicom, setting the device to /dev/ttyS2

--- I have tried this command or variations "echo UUUUUUUUUU > /dev/ttyS2".

setserial reports the device at the correct address with the correct IRQ. (0x3e8 and IRQ4)

"mesg | grep /dev/ttyS [01234] also confirms this.

Do I have to do something special, like "mounting" the device to /dev/ttyS2? If so how? What is the device "type" for the mount command?
 
Old 04-24-2013, 07:42 PM   #2
jefro
Guru
 
Registered: Mar 2008
Posts: 11,323

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
No, you don't mount it. Linux has had 485 support for a while and many patches are available for different chips. 485 doesn't really work like 232-c so you have to use other means than a common serial uart setup or posix serial type apps.

This link may offer clues. http://www.moxa.com/resource_file/857220091121341.pdf
 
Old 04-25-2013, 11:13 AM   #3
IDEASeth
LQ Newbie
 
Registered: Feb 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
If mountng is not required, what is? The article from Moxa goes into detail about the handshaking and need to control precisely when the transmitter turns off after each transmission. At this time, that is not my problem. It may be in the future, but not yet. Right now, I cannot get the transmitter to work at all using a Linux driver. (As I said, it's OK when I load the registers directly.) Simply stated how come the command "echo "UUUUUUUUUUUUU" >/dev/ttyS2" issued after the transmitter is enabled does not produce a stream of pulses on the TXD+/- lines?

Last edited by IDEASeth; 04-25-2013 at 11:15 AM.
 
Old 04-27-2013, 10:41 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
The standard linux driver is probably hardware agnostic for anything beyond the UART. Whatever means you have employed to enable the transmitter is probably undone by the driver, since it was probably written with the expectation of supporting RS-232. You may be able to suppress this behavior. It may also be caused by the expectation of some modem control line such as CTS or CD to be enabled before it will transmit. This behavior may also be suppressed. It may be helpful to tell us specifially what driver is being used for your system. Since you said PC/104 & Windows, it seems probable that it is a standard 8250 UART family driver, but it is probably worth knowing for sure.
The device nodes '/dev/ttyS*' are created as part of the driver loading. I assume this is the basis of your question about 'mounting' (filesystem partitions on block devices are 'mounted'). That there is a device node for your hardware is pretty much sufficient to confirm that the driver is properly loaded.
May I suggest the use of C-Kermit to diagnose this problem? It has a fair degree of flexibility about how modem control and handshaking is used, and may at least help you determine the cause of your problem. From there, a solution may become evident.
--- rod.

Last edited by theNbomr; 04-27-2013 at 10:44 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
Is a USBtty (USB serial port) treated the same as tty (normal serial port) in C? spudgunner Programming 1 11-12-2010 01:19 PM
linux serial port to router console port connection? frankie_fix Linux - General 3 02-26-2007 09:32 PM
Parallel Port & Serial Port device identification helpmeforlinux Linux - Hardware 3 01-02-2007 01:15 AM
Using serial port card(PCMCIA) with IPAQ running Linux, can't find ttyS0 port d2army Linux - Laptop and Netbook 0 11-12-2005 08:07 PM
rs-485? alaios Linux - Networking 3 04-28-2003 10:11 AM


All times are GMT -5. The time now is 01:18 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration