serial port control: reading CTS? RTS out?

Postby jofish on Sat Mar 06, 2004 8:39 pm

I'm using a sensor to feed into a Palm, and this sensor outputs either high or low at any point in time. Not bytes, just high or low. I was wondering if anyone had used such a signal to feed into CTS; I was planning on setting the timeout to some small value, send a dummy byte out the port and seeing if it timed out: if it timed out, then CTS was low, and if it sent successfully then CTS must have been high. Has anyone done this, or done anything similar?

I realize I could go in through RX, but then I'd need fully formed bytes, and would probably require a chip between my sensor (a radio shack burglar alarm movement sensor) and the palm. I could also capture the hotsync signal and just feed it 3.3V, but that seems like more hassle than it's worth.

Another way to do it would be to look directly at the memory location that corresponds to that CTS value; it's not clear to me how to do that. Any leads?

And, finally, I'd like to output RTS to control a relay. How do I change RTS directly? (This one is not so crucial; if I output 11111111 thru TX then i'll get something that should do roughly ok, particularly if I put a cap in there to smooth out the edges.)

Any leads welcome.

Thanks
jofish
 
Posts: 1
Joined: Sat Mar 06, 2004 8:31 pm

Postby reguser on Tue Mar 09, 2004 6:29 am

I am using the PTOOLBOX library to control RS-232 Signals (for a PALM IIIX).

Example:

@doc "Configura el estado de la l?ɬ?nea Request To Send (RTS)";
PuertoSerie?Ǭ©fijarEstadoRTS(boolean estado){
int registro=0xFFFFF908;
int valorRegistro;

valorRegistro = peek(registro);
if (estado)
poke(registro,valorRegistro|0x40);
else
poke(registro,valorRegistro&0xBF);
}
reguser
 
Posts: 15
Joined: Wed May 01, 2002 1:36 pm
Location: France


Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 2 guests

cron