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

Connecting several Rxd pins and Txd pins together ?

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



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Connecting several Rxd pins and Txd pins together ?
PostPosted: Wed Apr 06, 2005 7:24 am     Reply with quote

MCU: 16F628
Compiler: PCM


Hi,

I connected the Rxd pin and the TXd of two PIC 16F628s together. The junction I connected to a MAX 232 Ic ( the way it should be done). The PC's COM port is then connected to the MAX IC.

I find that I am unable to communicate with either of the PICs. when both of them are connected together, but each of them worked well when alone. I also checked the supply voltages they were OK.


I could post the code as well , but I would like to know if this kind of connection is OK ?. Or do I have to use I2C , SPI for this ?


thanks
arun
valemike
Guest







PostPosted: Wed Apr 06, 2005 8:09 am     Reply with quote

So you have two pics connected to the same MAX232?

I don't think RS232 is a multi-drop bus that you can connect more than one device to.
Ttelmah
Guest







PostPosted: Wed Apr 06, 2005 9:11 am     Reply with quote

It will depend on how you have things connected. If (for instance), you have one PICs 'TX' line, connected to the other's 'RX' line, and this same wire connected to the 'T1IN' pin on the MAX232, then this should work. It would allow data to be sent from one pic to the other, and the data to also be 'monitored' by a PC via RS232. However the R1OUT line on the MAX232, would have to connect only to the RX lines of one or more PICs.
So assuming you only connect to the T1IN line on the MAX232, this should work. The logic signals have a significant 'fanout' (I'd have to check the data sheets of both the MAXIM chip, and the PICs to work out exactly how high, but five is typical). You can connect one logic output to multiple inputs (the only output on the connection as descibed should be the one 'TX' pin, while T1IN, and RX are both inputs).
Remember also that the ground lines between the PICs also have to be connected as well. If you are connecting to the R1OUT line, then this won't work, since you then have two outputs connected together.

Best Wishes
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

PostPosted: Wed Apr 06, 2005 9:23 am     Reply with quote

I think you do not even need a Max232 to convert signals, just connect them directly will work.
Ttelmah
Guest







PostPosted: Wed Apr 06, 2005 9:38 am     Reply with quote

For talking between the PICs, you do not need the MAX232, but he was also refering to connecting to a PC, for which the MAX232 (or some other way of providing a suitable voltage level, and the signal inversion), is required.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Thu Apr 07, 2005 5:35 am     Reply with quote

Hi,

I am using the MAX 232 for connecting to the PC only (therfore there is only one MAX 232 in the circuit ).

The Rxd and the Txd pins of the MAX 232 are connected directly to the Rxd and TXd pins of both the PICs. Thus when the PC sends a character it is received by both the PICs.

Do you think such an arrangement could damage the PICs ??

If the Txd of one PIC goes low, the TXD of the other PIC would try to maintain a High state, thus damaging the port. ??

In any case the arrangement is not working well.

Thanks
arun
Ttelmah
Guest







PostPosted: Thu Apr 07, 2005 6:53 am     Reply with quote

You could possibly do what you want, by using a couple of diodes and a pull down resistor to form a negative logic 'or' gate. You must not connect two normal logic outputs together.

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Apr 07, 2005 8:49 am     Reply with quote

Having the PC talk to two PICs is not a problem. Having two PICs talk back to the PC definately IS a problem.
Clearly only one PIC can talk at a time. If you make sure each PIC is tristated when it is not talking, the other PIC can drive the line. You will need a pull-up on the line for when both PICs are tristated. Otherwise noise will cause grabage to be sent to the PC causing grief.
If you can't tristate the PIC outputs you can either use an AND gate, either a logic chip or diodes, or you could have one PIC talk to the other, and only the second PIC talks to the PC.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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