Searching \ for '[PIC]: PIC Network Strange Behaviour' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'PIC Network Strange Behaviour'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PIC Network Strange Behaviour'
2004\08\23@080841 by Lucian

flavicon
face
Hello all,

I have a problem connecting two PICs (16F877A) on two boards. I use a
communication protocol and until yesterday it worked fine. I connected a
MAX232 circuit to one board and after that, the boards won't connect
without this circuit plugged.
One board is the master and the other is the slave. The slave has to
request for a permission to transmit, but the signal never gets to the
master. I think that the problem is with the TX line which cannot be
pulled LOW by the slave. Each slave has a diode connected on the TX line
to allow more slaves on the line.
I have the feeling that I might have missed some details, but I hope
someone will understand my problem and answer it. Should I give more
detail, please ask !
Thank you very much !

Lucian Copat

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu

2004\08\23@095942 by Howard Winter

face
flavicon
picon face
Lucian,

On Mon, 23 Aug 2004 15:08:09 +0300, Lucian wrote:

> Hello all,
>
> I have a problem connecting two PICs (16F877A) on two boards. I use a
> communication protocol and until yesterday it worked fine. I connected a
> MAX232 circuit to one board and after that, the boards won't connect
> without this circuit plugged.

I'm confused - you had it working with the two PICs connected directly, then you added a MAX232 to one board,
"inserting" it into that serial connection?

If so then it shouldn't work - the PICs connected directly are using 0V = data "Low" and 5V = data "High") but
a MAX232 is a level-shifter that implements RS232 which is +V / -V (where V is 5 to 15V, I think) with +V =
data "Low"  and -V = data "High".  If I understand you correctly you need a matched pair of MAX232s or none at
all.

> One board is the master and the other is the slave. The slave has to
> request for a permission to transmit, but the signal never gets to the
> master. I think that the problem is with the TX line which cannot be
> pulled LOW by the slave. Each slave has a diode connected on the TX line
> to allow more slaves on the line.

You can't share a serial connection with a MAX232 - it's expecting to drive the line and not be overriden by
something else (or to put it another way, RS232 is a point-to-point protocol).  You need RS485 which is
designed for shared serial busses, and there are appropriate driver chips available.

> I have the feeling that I might have missed some details, but I hope
> someone will understand my problem and answer it. Should I give more
> detail, please ask !

Yes, a diagram of some sort would help - I may have completely misunderstood you!

Cheers,


Howard Winter
St.Albans, England

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu

2004\08\23@100944 by hael Rigby-Jones

picon face
>-----Original Message-----
>From: pic microcontroller discussion list
>[PICLISTspamKILLspamMITVMA.MIT.EDU] On Behalf Of Howard Winter
>Sent: 23 August 2004 15:00
>To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
>Subject: Re: [PIC]: PIC Network Strange Behaviour
>
>You can't share a serial connection with a MAX232 - it's
>expecting to drive the line and not be overriden by something
>else (or to put it another way, RS232 is a point-to-point
>protocol).

You can use RS232 in a multidrop configuration by a diodes in the TX line of
every slave to prevent them loading each other.  It's a bit of a bodge, and
RS485 is certainly far superior.

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu

2004\08\23@103435 by Howard Winter

face
flavicon
picon face
Mike,

On Mon, 23 Aug 2004 15:12:30 +0100, Michael Rigby-Jones
wrote:

>...<

> You can use RS232 in a multidrop configuration by a
diodes in the TX line of
> every slave to prevent them loading each other.  It's
a bit of a bodge, and
> RS485 is certainly far superior.

Could you do the bodge with MAX232s involved?  I'd have
thought they would try to assert the + or - voltage
whatever happens, so which way would you connect the
diode?

(Having typed that I've just remembered that RS232
"idles" at -V, so perhaps you treat this as the base
state and anything trying to send would take it to +V ?
You'd have to have a pull-down on the wire somewhere, I
think?)

Cheers,


Howard Winter
St.Albans, England

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu

2004\08\23@105931 by Lucian

flavicon
face
I do not want to use RS485 or RS232, only the USART from the PICs. The
TX line is pulled high on the master side with a pull-up resistor, and
the slaves have a diode connected with the cathode to the TX pin of the
micro.
It has worked previously, but now it only works with a MAX232 circuit
connected to the line. The slave can receive data, it cannot transmit,
so I guessed it is the TX line that it cannot pull low. The problem is
not at the slave level, as I tried with another slave and I have the
same result, while it worked before.
I don't know what could prevent the TX line going low. Is the pull-up
resistor value too small ? it is 10K.
Should I use a RS485 network to do this job ?

Lucian


{Original Message removed}

2004\08\23@110101 by Lucian

flavicon
face
The RS232 circuit is for interfacing with the PC. It is not connected
between the two PICs, but on the master side, to the PC. The two PICs
are still connected as before, but now the slave can only talk when the
RS232 circuit is connected.


Lucian


{Original Message removed}

2004\08\23@110310 by Spehro Pefhany

picon face
At 03:34 PM 8/23/2004 +0100, you wrote:


>(Having typed that I've just remembered that RS232
>"idles" at -V, so perhaps you treat this as the base
>state and anything trying to send would take it to +V ?
>You'd have to have a pull-down on the wire somewhere, I
>think?)

RS232 receivers typically have a 5K (nominal) resistor to ground on the
inputs. (it's between 3 and 7K on the MAX232). They also change state
above 0V by a couple of volts (800mV to 2 or 2.4V guaranteed on the MAX
series).

Note that when the line goes to -V you are depending on the resistor
to discharge the wire and other stray capacitance to less than this
(poorly defined) threshold voltage within a fraction of the bit time or
there will be an error*. Also the line impedance (against noise) has gone from
a few hundred ohms with perhaps 8-10V of noise immunity up to 5K or so
with maybe 1/5 that noise immunity. It's really an ugly hack, but usable for
some limited applications.

For example, suppose you have a 12V driver, and you're unlucky enough to
have a MAX receiver that triggers at 800mV and has a 7K resistor to ground.

v(t) = 11.4*exp(-t/(7K*C))

For error-free communication at 19200 baud, with a wee bit of margin, we'd
like it to drop to, say, 400mV within 1 bit time or 52usec.

Cmax = 52usec/(ln(11.4/0.4)*7K) = 2200pF

At, say, 100pF/m, it will work up to 20m or so.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu

2004\08\23@110726 by D. Jay Newman

flavicon
face
> The RS232 circuit is for interfacing with the PC. It is not connected
> between the two PICs, but on the master side, to the PC. The two PICs
> are still connected as before, but now the slave can only talk when the
> RS232 circuit is connected.

The problem may be that you are using a PIC with only one UART. If you
want to communicate between two PICs you shouldn't also be using the
same UART to talk to another network.

I would suggest using either SPI or I2C to communicate between the
two PICs rather than overloading the UARTs.

Good luck!
--
D. Jay Newman           ! DCX - it takes off and lands base down,
RemoveMEjayTakeThisOuTspamsprucegrove.com     !       as God and Robert Heinlein intended.
http://enerd.ws/robots/ !

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu

2004\08\23@111343 by D. Jay Newman

flavicon
face
> I do not want to use RS485 or RS232, only the USART from the PICs. The
> TX line is pulled high on the master side with a pull-up resistor, and
> the slaves have a diode connected with the cathode to the TX pin of the
> micro.

Strange. I've never used a diode for this, but then I've only used
ansychronous serial (which is what most people mean when they say
RS232 -- which is purely an electrical standard) either point to point
or in a strictly master-slave protocol. I did use pull-ups though when
I was using TTL level ansychronous serial.

> It has worked previously, but now it only works with a MAX232 circuit
> connected to the line. The slave can receive data, it cannot transmit,
> so I guessed it is the TX line that it cannot pull low. The problem is
> not at the slave level, as I tried with another slave and I have the
> same result, while it worked before.

As you describe it, the MAX232 is actually connected to both the PICs.
This could load the network too much for the PICs to communicate between
themselves.

> I don't know what could prevent the TX line going low. Is the pull-up
> resistor value too small ? it is 10K.

I would suggest *not* using the same UART to do both RS232 and TTL level
asych serial.

> Should I use a RS485 network to do this job ?

If your two PICs are right next to each other (or within a few feet),
then TTL-level (what comes out of the PIC) is fine.

If your two PICs are either in an electrically noisy environment or if
they are separated by some distance, I would use RS485. I am moving to
RS485 for my internal robotics communications because it solves much of
my noise problems.
--
D. Jay Newman           ! DCX - it takes off and lands base down,
TakeThisOuTjayEraseMEspamspam_OUTsprucegrove.com     !       as God and Robert Heinlein intended.
http://enerd.ws/robots/ !

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspamTakeThisOuTmitvma.mit.edu

2004\08\23@112419 by Lucian

flavicon
face
part 1 2570 bytes content-type:text/plain; (decoded 7bit)

Here's a diagram of the configuration I have. In fact, I want the
circuit to function without the MAX232 connected, but it doesn't. That's
what I'm trying to figure out: why does now it only functions with the
MAX232 connected to the line.

Lucian


{Original Message removed}
part 2 2842 bytes content-type:image/gif; (decode)

2004\08\23@114706 by Wouter van Ooijen

face picon face
> Here's a diagram of the configuration I have.

I think the 10k is a bit high, I would use 1k. And maybe a schottky for
the diode.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu

2004\08\23@125242 by Jan-Erik Soderholm

face picon face
Lucian wrote :

> Here's a diagram of the configuration I have. In fact, I want the
> circuit to function without the MAX232 connected, but it
> doesn't. That's what I'm trying to figure out: why does now it only
> functions with the MAX232 connected to the line.

Hi !
(Refering to the attached GIF...)

I'd guess that when the PC is "idle", the MAX232 is holding
it's TX output *actively* high ("1"). That's why the slave can
not send data using it's own TX output. The slave and the
MAX232 will try to force that line in different directions.
If the MAX232 can source more current then the slave can drain,
the line will probably be kept in a high state.

What about a diod at the MAX232-TX, just as at the slave-TX ?

Jan-Erik.

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu

2004\08\24@030346 by Lucian

flavicon
face
Hi,

The TX line is held HIGH from the master, through a 10K pull-up
resistor. The communication doesn't work *WITHOUT* the MAX232 connected.
It worked before, but not anymore. I have two connectors at the master
side, one for the slave, and one for the MAX232. Could it be that when
the MAX232 is not connected, some strange fields pull the line wrong ?
From my point of view, it should work fine without the connector for the
MAX232...
Should I remove the pull-up resistor from the master ? I guess this way
it could work with one slave, but not with more.


Lucian


{Original Message removed}

2004\08\24@084140 by Lucian

flavicon
face
Hi guys,

In the meantime I did some tests, and the conclusion is that for some
reasons (unknown to me), the USART in the 2 PICs won't talk through a
20m cable, so I replaced it. Now everything should be OK, but it isn't.
It seems that the master board creates some strange fields. When I touch
the microcontroller or one A/D converter I have onboard (on the plastic
side), the micro starts sending garbage data on the USART.
A packet that should be
FE FF 05 01 02 B3 FF, becomes
3E 1F 05 FC 01 FC 02 F8 33 FF 1F. Some correlation exists, but I suspect
some magnetic fields are created there and hinger the communication.
The ICs are well soldered and the wires are OK. What other causes could
be ?
Could someone enlighten me ? Thank you !

Lucian

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...