View previous topic :: View next topic |
Author |
Message |
colinbrenton
Joined: 13 Feb 2007 Posts: 6
|
"connect" one pin to another |
Posted: Fri Oct 16, 2009 7:39 am |
|
|
Hello,
I am using a 18F6527. One one UART I have a PC, on the the other I want to connect two other devices.
Is there a way I can feed UART2 (TX and RX) to two general purpose IO pins, and connect the two devices to be served to four other IO pins, then "map" between them, selecting one device or the other?
I suppose an ISR may be needed, to monitor for change-of state on the pins, and pass the changes through the system, but a "virtual switch" would be easier...
These RS232 links will be 0-5v, rather than +/-15, so that shouldn't cause any problems
Any suggestions?
Thanks in advance,
Colin |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Oct 16, 2009 9:34 am |
|
|
Internal multiplexing of UART function to different chip pins isn't possible with standard PICs. You have to use external multiplexers. |
|
|
colinbrenton
Joined: 13 Feb 2007 Posts: 6
|
|
Posted: Tue Oct 20, 2009 4:43 am |
|
|
Hi FmV,
Thanks for your repply, looks like a hardware block is needed then.
Cheers,
Colin |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Oct 20, 2009 6:15 am |
|
|
the usual way to share out 2 RS-232 ports is to connect
the TX pin to BOTH TX side pins of say a max232.
ONE for EACH of the two ports.
the RX is a different matter - you need to take the TWO RX outs from your pair of MAX232's and then
feed EACH of those into a 74HC08 or equiv AND gate input.
Now the OUTPUT of the HC08 goes to your RX pin on the pic
NB:
NONE of this will save your bacon if BOTH of the bonded RS-232 external devices talk simultaneously to you
the result will be garbage
FYI |
|
|
|