View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Connecting several Rxd pins and Txd pins together ? |
Posted: Wed Apr 06, 2005 7:24 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
valemike Guest
|
|
Posted: Wed Apr 06, 2005 8:09 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Apr 06, 2005 9:11 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Wed Apr 06, 2005 9:23 am |
|
|
I think you do not even need a Max232 to convert signals, just connect them directly will work. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Wed Apr 06, 2005 9:38 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Thu Apr 07, 2005 5:35 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Thu Apr 07, 2005 6:53 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Apr 07, 2005 8:49 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|