How to monitor RS232 DTR

Hello All,

I will be using a 3 wire RS232 connection to configure a PIC. I would like for the PIC to be interrupted and wake when the RS232 cable is connected. I plan for the DTR line to be monitored by the PIC through the following:

Schottky 10K current limiter DTR

--------->|-----------------/\\/\\/\\/\\---------------(note)--------PIC

NOTE: at this point will be a 10M pull down and a 3V Zener to ground.

Is this a good way of tackling the problem?

Is there a better way?

Thanks for the help,

John

Reply to
jecottrell
Loading thread data ...

You can just monitor to Send line. It provides -12 volts when connected. Use one of pins RB4-RB7 with internal pullup set for interrupt on change. Feed RS232 Send line thru a 10k resistor to the pin. You dont need to write a real interrupt routine. Just put PIC in Sleep mode and disable GIE. Processing will simply continue with the instruction following the Sleep command when the pin in pulled low.

Note: be sure to read the RB port just before entering Sleep, or the detect on change circuit may not work.

Luhan

Reply to
Luhan

3V Zeners don't work very well. Why not just make a real RS232 receiver out of a 2N2222 or the like. Connect the DTR in to the base of the transistor through a 10K reistor. 3.3K from collector to VCC. Emitter to ground. Connect the PIC to the collector of the transistor. This will also give you the normal inversion. If you are squemish, connect a 1N914, or whatever, from the base to ground so the base can't go to -12 V. You could also connect a 22K - 100K resistor from base to ground to be sure an open circuit is detected as DTR OFF; you probably won't need this below 100C.

Tam

Reply to
Tam/WB2TT

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.