Using non standard baudrate 28800 with rs232


 
Thread Tools Search this Thread
Top Forums Programming Using non standard baudrate 28800 with rs232
# 1  
Old 02-08-2007
Question Using non standard baudrate 28800 with rs232

Hi,
can somebody help me with this one?
I have to configure rs232 write/read inside a C program.
I'm using the termios.h (POSIX)
The problem is that the only baudrate that works for me is 28800 and
it is not supported any more from this driver. Smilie
So I can't write :

cfsetispeed(&options, B28800);
cfsetospeed(&options, B28800);

At least for the version of termios.h that I have on my SuSe Linux 10.1
I would really appreciate any help.
Thanks!
# 2  
Old 02-10-2007
You have to use a baud rate that the driver supports. Try B19200. If you are trying to connect to a 28K modem, this should be possible. The modem will use flow control to throttle down the actual transmission rate.
# 3  
Old 02-10-2007
No, it's not a modem. There is a card connected there which is commanding a robot by a wireless connection. I've tried all speeds defined in the termios.h, then I read somewhere in the documentation that the stupid robot is not receiving the command if the speed is other than 28800.
It is working perfectly under Windows. The porblem is that I have to make it also work under linux.
There should be a way to use the speed 28800.
# 4  
Old 02-10-2007
If i recall correctly, and it's a long time since I have done any serial programming on Linux. For the higher baud rates you have to set to B38400 and use setserial to se the actual speed that B38400 runs at.
# 5  
Old 02-10-2007
Yes this was really a nice idea with setserial. I've got this tip already from another thread.
I'll try adding this single line to my Program:

system("/bin/setserial /dev/ttyS1 spd_cust baud_base 115200 divisor 4");

prior to opening the port
and setting the speed like:

cfsetispeed(&options, B38400);
cfsetospeed(&options, B38400);

I really hope it will work.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Connecting PIC16F877A using Easypic5 via RS232 with Linux

I searched the forums for RS232 issues, but all of the results don't help me solving my problem, so I had to open new thread. This is the problem: I have PIC16F877A micro-controller and I'm programming it with Easypic5(the PIC programming device(board) from MikroElektronika) and I want to... (1 Reply)
Discussion started by: ivan_vasileski
1 Replies

2. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

3. UNIX for Dummies Questions & Answers

Can A File Be Copied to an RS232 Port on Unix?

We have a text/csv file (4mb) sitting on a Unix box. The PC belongs to a retail store and they're asking me to bring the file over to Windows so they can import the file. Can a file be copied to an rs232 port? If so how? The idea is that I'll hook up a null modem cable to the Unix com port,... (2 Replies)
Discussion started by: alivebyscience
2 Replies

4. Shell Programming and Scripting

standard error to standard out question

Hi there how can i get the result of a command to not give me its error. For example, on certain systems the 'zfs' command below is not available, but this is fine becaues I am testing against $? so i dont want to see the message " command not found" Ive tried outputting to /dev/null 2>&1 to no... (5 Replies)
Discussion started by: hcclnoodles
5 Replies

5. Programming

How to read the CTS and DSR of RS232 in Unix using C language?

Hello to all Gurus out there, Could you show me a source code in Unix platform using C language. I want to read the status or voltage level of the DSR and CTS. Thanks a lot, Swing5 (2 Replies)
Discussion started by: Swing5
2 Replies

6. AIX

Transferring files via RS232 cable

Current setup: Some old AIX standalone machine (F series) My WinXP laptop Null modem cable from laptop to AIX machine (console port). On Hypterminal on WinXP I can connect to the AIX machine (serial connection), but when I try to transfer file, it will just sit there. I'm guessing the... (3 Replies)
Discussion started by: apra143
3 Replies

7. UNIX for Advanced & Expert Users

RS232 programming problem

Hi all I encountered a strange phenomenon when reading / writing to RS232 serial device (on my machine /dev/ttyS0) I have simple 2 processes: 1) process which WRITE characters from /dev/ttyS0 For example write the characters... (2 Replies)
Discussion started by: dudi.forum
2 Replies

8. Solaris

rs232 pci-card

hello mates, do you know a manufactor for rs232 serial pci cards for the sparc architecture? it seems that there is no original product from sun for that purpose. strange, isn't it? problem is that i have a V250 with only one db9 rs232 serial port, and i need it for a modem connection, but i also... (1 Reply)
Discussion started by: pressy
1 Replies

9. UNIX for Advanced & Expert Users

VNC via Rs232

Hi ! Is there somebody who is able to connect a VNC session via serial cable ? There is a hint on the VNC homepage that it is possible to configure that. But how? thanks joerg (2 Replies)
Discussion started by: joerg
2 Replies

10. Programming

RS232 communication optimisation

Need help for RS232 communication with switches in order to optimise the data traffic. How to manipulate different flags in termios struct to do the same? (1 Reply)
Discussion started by: ManishSaxena
1 Replies
Login or Register to Ask a Question