LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-18-2004, 01:41 PM   #1
fbarre
LQ Newbie
 
Registered: Aug 2003
Location: California
Distribution: RedHat
Posts: 28

Rep: Reputation: 15
Angry looking for simple RS232 driver & sniffer


Hi all,

I'm new in Linux drivers programming world.. thanks to O'Reilly's "Linux Device Drivers" book, I was able to pick up the basics but I'm trying to program a simple RS232 driver and don't know where to start. Simple meaning, I want to be able to access/control a board connected to my PC's serial port while using 3 wires only.

I was wondering if anyone knows a simple example out there to follow and also any Linux RS232 sniffer/spy available out there... couldn't find any over the web.

thanks,
 
Old 04-18-2004, 05:47 PM   #2
larrykeenan
Member
 
Registered: Apr 2004
Location: Brisbane Australia
Distribution: UBUNTU 13.04
Posts: 61

Rep: Reputation: 19
Look at http://www.ontrak.net/linux.htm
as a starting point.
 
Old 04-19-2004, 06:47 PM   #3
fbarre
LQ Newbie
 
Registered: Aug 2003
Location: California
Distribution: RedHat
Posts: 28

Original Poster
Rep: Reputation: 15
Hi larrykeenan and all,

Thanks for your reply and this driver would do the job but I followed it and I can't talk to my board. For instance by writting 0x81 it should I should get a reply of 0x04. I even wrote 10000001 or 1 0 0 0 0 0 0 1 or 0 0 0 1 1 0 0 0 and no luck.

It says in the example that a special cable was used and I was wondering if this is a big deal as I'm using a normal serial cable where I'm using only the Rx, Tx and Grnd pins.

If you've successfully used this example to communicate with a board please let me know your suggestions as I am stuck! I suspect I should costumize this line and tried few things but no luck. (my baud is 115200)

my_termios.c_cflag = B115200 | CS8 |CREAD | CLOCAL | HUPCL;

I checked the following:

1) from the this output I can tell I my PC serial is using ttyS0
setserial -g /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4

2) while the program is running, it shows that I'm txing/rxing crazy number of bytes!
and it stays the same even when I quit the program. Initially, tx:24 and rx:0 but never saw these values again:
cat /proc/tty/driver/serial
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:3F8 irq:4 baud:115200 tx:300973 rx:271036 fe:8 RTS|DTR

3) I did check my serial port of my board and can successfully to it using a Windows based RS232 sniffer.

4) I changed 2 pcs to make sure that my serial port is working.

greatly appreciate your help,
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 06:09 PM
PCMCIA & Modem >>> rs232 tataros3 Solaris / OpenSolaris 0 07-18-2005 10:59 AM
mandrake10.1 after upgrade kde3.3&gnome2.8 simple loginwith no choice & no desktop msalimane Mandriva 3 11-22-2004 08:27 PM
cygwin & rs232/com port & getty access tomjermy Linux - Software 0 07-09-2004 08:08 AM
modem driver for RS232 external modem? nnaemekadavid Linux - Hardware 5 05-03-2004 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:38 PM.

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