Last edited by Kamikaze47; - 6th April 2008 at 16:28.
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Sounds reasonable indeed. Did you tried with Darrel's instant interrupts?
What's your baudrate?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Okay, here's another thought.
Use 2 optos; each output feeds each target.
The serial out goes to the anodes of both the opto inputs; the 2 cathodes go to 2 separate pins, each of which can be selectively pulled low to allow transmission to the corresponding target.
Anand
I have successfully used a 74HCT125 for this purpose. You can selectively enable each gate to drive what you want. If you add a pull up on the output of each gate, you can "idle high".
One package (two gates for TRANSMIT, two devices for RECEIVE) plus an inverter will allow you to use one pin to select which device you want to "speak to".
Connect PIC TXD to the inputs of two gates (call them A & B) Connect the output of A to
device 1, connect the output of B to device 2.
Connect the outputs of gates C & D to the PIC RXD. Connect the input of C to device 1 and the input of D to device 2.
Connect the ENABLES of gates A and C together, and the ENABLES of B & D together.
Put an inverter between the pairs of enables. Drive the input of the inverter from a PIC pin.
Charles Linquist
Bookmarks