Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-14-2001, 09:54 AM   #1
LQ Newbie
Registered: Sep 2001
Distribution: Slackware
Posts: 6

Rep: Reputation: 0
rs232 at non-standard baud rate possible?

Ok, I'm trying to do a little rs232 programming using an onboard COM port and cannot figure out how to generate non standard baud rates. Most of my readings about Linux serial have been from the HOWTO and this website:

My question is how I can generate a different baud rate, 12800 specifically?

Old 09-14-2001, 09:27 PM   #2
LQ Newbie
Registered: Sep 2001
Distribution: Slackware
Posts: 6

Original Poster
Rep: Reputation: 0
I believe I have the answer

Well, I think I figured it out. Here is the solution to using non-standard baud rates on a PC:

1) Use the TIOCGSERIAL ioctl to get the serial_struct for the

2) Set the ASYNC_SPD_CUST flag in the serial_struct "flags"
field and set the "custom_divisor" field to whatever you

3) Use the TIOCSSERIAL ioctl to write it back.


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
USB>RS232 versus PCMCIA>RS232 jayhel Linux - Laptop and Netbook 2 08-04-2005 07:09 PM
Setting Baud Rate on Comm2 Question steve_f60 Linux - General 2 06-21-2005 02:30 PM
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 01:47 PM
standard vs Expert install? Standard flubs up! Frost Linux - Software 1 03-27-2002 08:55 AM
How do I change ttyS port baud rate? joe_dejesus Linux - General 1 09-27-2001 10:50 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:57 PM.

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