Subject: Switch
From: ACRE NL
Date: 12/7/2002, 7:22 AM

Ed Anderson wrote:

 > > > I am going to use the Request To Send line out of the
PC UART COM RS232 port.

snips.....

BTW toggling RTS was way easier than I expected.
If you use RS in the option list of OPEN COM the RTS output
bit is set low. If you don't it is set high. So all you need
is one OPEN COM for the modules and a different OPEN COM for the GPS.

Piece of cake.
Here is the code that works. Don't throw those old DOS computers
away. They make great software programmable square and rectangle pulse
generators :-). This switch is super simple. Four wires out of the
nine pin COMx D connector. RX pin 2, TX pin 3, GND pin 5 and
RTS pin 7.

BTW I have not heard from Ed in awhile. I think that ice storm
cut off his power. Oh well no rush getting this done. He probably
can't fly anyway.

Paul Lamar


 Looking at the code, it appears you open COM1 for the data by setting RS
HIGH and recording data then closing COM1. Opening COM1 for GPS by setting
RS LOW and recording, closing COM1 and then back to START for a repeat.  The
FOR/NEXT Loop  appears to be just a delay as I would assume there is no
action going on while the code is in that loop unless we are still getting
data recorded even while in that loop?  Would appear to me that we would
want the recording code within that loop so that we record data for D=50000
then GPS dor D=32000.  But I realize this is just the strawman on the code,
so will await the results of your tests.

Go'ng flying

Ed

CLS

START:

OPEN "COM1:300,N,8,1,RS,DS0,CS0,DS0" FOR RANDOM AS 1

PRINT #1, "$1RD"

'Module code goes here.
FOR D = 1 TO 50000 : NEXT D
temp$ = INPUT$(LOC(1), #1)
PRINT temp$;
CLOSE 1

OPEN "COM1:300,N,8,1,DS0,CS0,DS0" FOR RANDOM AS 2
'GPS code goes here.
FOR d = 1 TO 32000
NEXT d

CLOSE 2

GOTO START:

True Ed. I just used that code to test the idea. I put a scope
on the RTS line and sure enough it toggled. I used an RS232 loop
back configuration with TX tied back to RX. Pin 2  tied to pin 3.
 
Paul Lamar
 
The AirCraft Rotary Engine NewsLetter.  Powered by Linux.
ACRE NL web site. http://home.earthlink.net/~rotaryeng/            
Copyright 1998-2002 All world wide rights reserved.