LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-14-2003, 02:23 PM   #1
dcarter
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0
Controlling serial port RTS pin from 'C' program


Using Slackware 9 running on a 586 Compaq laptop.

I'm using /dev/ttyS0 to communicate with a micro-controller. Opening it with O_RDWR | O_NOCTTY then using tcgetattr and so forth per the serial_programming HOWTO works fine, up to a point...

I can send and receive bytes all day using a direct serial cable, however I have a half duplex radio link that I need to switch directions using the RTS line. Said another way, I need to assert RTS to low under program control before I send bytes (to turn on the radio transmitter).

I've tried:

int flags;
ioctl(fd, TIOCMGET, &flags);
flags &= ~ 0x004 // because TIOMC_RTS is undefined in my system
ioctl(fd, TIOMSET, &flags);

and also:

ioctl(fd, TIOMBIC, 0X004);

Neither seem to affect the RTS pin at all and sometimes hang the system.

Any ideas?
 
Old 09-26-2003, 07:01 PM   #2
dcarter
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Well, I guess no one has a clue.

I'm able to control the UART by directly changing its registers with outb(). I'd rather not have to run the application as root though.

o'well...
 
  


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
manually controlling RTS/CTS pappsynz Programming 4 05-25-2005 04:55 AM
Need help to read a signal from the CTS pin of a serial port juan_de_margo Linux - Hardware 0 02-24-2005 03:36 AM
Controlling external electronics via the serial port... anybody know anything? Napalm Llama Linux - Hardware 11 02-20-2005 06:46 AM
C++ serial port program problem doar Programming 3 10-01-2004 10:46 AM
configuring 25 pin serial null modem dnijaguar Linux - Networking 2 09-03-2004 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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