LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-14-2001, 08:54 AM   #1
scgadgets
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:
http://www.easysw.com/~mike/serial

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

Thanks,
SCG
 
Old 09-14-2001, 08:27 PM   #2
scgadgets
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
device.

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

3) Use the TIOCSSERIAL ioctl to write it back.
 
  


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
Setting Baud Rate on Comm2 Question steve_f60 Linux - General 2 06-21-2005 01:30 PM
Reading Baud Rate of Serial Port zaheer031 Programming 1 09-27-2004 12:47 PM
standard vs Expert install? Standard flubs up! Frost Linux - Software 1 03-27-2002 07:55 AM
How do I change ttyS port baud rate? joe_dejesus Linux - General 1 09-27-2001 09:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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