LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-25-2011, 08:05 AM   #1
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Question about serial port card


I have a serial port card (http://www.newegg.com/Product/Produc...004&Tpk=rc-301) in my desktop, I got it mostly to be able to easily communitate with microcontroller projects. Wen I pipe data into it like this:

Code:
echo "test" > /dev/ttyS0
, it comes out at 9600 baud. What I wonder is if it's possible to change the baud rate, and is it safe to rely on the fact that it will be 9600 when you just pipe data into it like in the above example?
 
Old 08-25-2011, 12:40 PM   #2
gammahermit
Member
 
Registered: Apr 2010
Distribution: Arch
Posts: 51

Rep: Reputation: 6
There is a program called setserial that lets you modify serial port settings. Check the man page for the right option.
 
1 members found this post helpful.
Old 08-25-2011, 02:36 PM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
I guess that is what I'm looking for, but there's something strange I noticed:

Code:
$ setserial -a /dev/ttyS0
/dev/ttyS0, Line 0, UART: 16550A, Port: 0xec00, IRQ: 16
	Baud_base: 115200, close_delay: 50, divisor: 0
	closing_wait: 3000
	Flags: spd_normal skip_test
Howcome it says tha the baud rate is 115200, when it's actually 9600? I know for sure since I have a device connected to that serial port right now that's sending data at 9600 baud, and it's working.
 
Old 08-25-2011, 02:41 PM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
It actually says that baud_base is 115200. I think that's upstream of whatever dividers are set locally, and there are dividers set.
 
Old 08-26-2011, 09:17 AM   #5
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443

Original Poster
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by salasi View Post
It actually says that baud_base is 115200. I think that's upstream of whatever dividers are set locally, and there are dividers set.
I don't really understand, and how do I configure those?

Anyway, I have another problem: I have a microcontroller project that accepts commands and prints output through the serial port. The problem is that when I run:

Code:
cat /dev/ttyS0
to see the output, it automatically echoes it back to the microcontroller, which interprets it as commands. How do I stop this, and why doesn't it echo when I don't run the above "cat" command?
 
  


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
timedia 4 port serial port i/o card configuration binu_edl Linux - Hardware 0 03-09-2006 09:39 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
need serious help with serial port card nephish Linux - Hardware 7 08-23-2005 11:28 AM
serial port card madness - please help! nephish Linux - Hardware 1 08-22-2005 10:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:40 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