CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

"connect" one pin to another

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
colinbrenton



Joined: 13 Feb 2007
Posts: 6

View user's profile Send private message

"connect" one pin to another
PostPosted: Fri Oct 16, 2009 7:39 am     Reply with quote

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 Smile

Any suggestions?

Thanks in advance,


Colin
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Oct 16, 2009 9:34 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 20, 2009 4:43 am     Reply with quote

Hi FmV,

Thanks for your repply, looks like a hardware block is needed then. Smile

Cheers,

Colin
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Oct 20, 2009 6:15 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group