RS485 trouble

You make a good point about the UART, I will be sure to look into the timing. As for the new chip, I'm going to test with the max491, I am keeping my 4 wire configuration, I don't want to change more by going two wire. Thanks for your input.

Reply to
ScadaEng
Loading thread data ...

One dirty non-standard trick that has sometimes used in RS-232 environment _might_ work with constantly on RS-422 transmitters (such as MAX490) on RS-485 buses.

Put a diode in series between the RS-422 output port and the RS-485 bus. Two diodes are required with opposite polarity for the Tx+ and Tx- ports. The diode polarity must be set so that they conduct only when Space ("0") is transmitted, but isolate the transmitter from the bus, when Mark ("1") is transmitted.

When the transmitter is in the Idle Mark state, the bus is pulled to the Mark state by the "fail-safe" termination resistors on the bus or driven to Space by an other transmitter.

The diodes will reduce the noise margin by the diode voltage drop and not be used, when making "RS-485" compliant slaves.

However, if you are in full control of both the master and slaves and the slaves and the cables between them, you might consider this dirty trick.

Reply to
Paul Keinanen

Thanks Paul, its a neat trick. I have ordered the max489 it has the needed enable pins and also is slew rate limited. With my low baud rate of 57.6K, it will give me a little extra insurance of good comm. Thanks again.

Reply to
ScadaEng

On the PIC there is a bit that flips when the TX Register is Empty. I forget if a interrupt is generated or not.

Cheers

Reply to
Martin Riddle

The 1x550 family also has status bits for Tx Register Empty and Tx holding Register empty, but unfortunately only the latter can be configured to generate an interrupt, for the first, you have to poll for the last stop bit to be sent.

Unfortunately, it is completely unacceptable in any multitasking kernel to do a busy loop to poll a status register for 0.1 to 10 ms (115k2 .. 1k2) to find the end of a character, if proper interrupts are not available.

One way to avoid this on a _2-wire_ RS-485 system is to enable the receiver during your own transmit and when processing the TRx interrupt from the last character echoed, turn off the Tx Enable pin.

This method is not generally available for 4 wire RS-485 networks, so you have to poll the Tx status register in a busy loop, unless a proper interrupt is available.

Reply to
Paul Keinanen

You can, with one device talking at a time. A host would send codes out which would tell who can talk, and for how long. I am doing a multi-point capable radio system right now that works in a similar fashion. It is somewhat comparable to ramp metering on busy freeways (one car per green, two cars per green, et cetera), or to a busy airport where tower controllers align aircraft in a row for take-off landing.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

You mean you need an open collector type out put?

Reply to
Jamie

Yes, it is "txif". You need to poll it to see if it is set. I plan to first check the receive register (also polled) and if it is empty I will enable DE through a pic port. When all transmit is completed I will check the txreg (txif flag) to see if its clear before turning off DE. I believe I don't need to toggle RE (active low, can't show the bar above) so I will tie it low. The pic routine is the least of the problem.

Thanks...

Reply to
ScadaEng

This is more like DTL (Diode Transistor Logic).

For proper differential open collector (wired-OR), one output should be NPN and the common load resistor to +Vcc and the other should be PNP with the common load resistor to Gnd.

Reply to
Paul Keinanen

One other option is to have one master. All the slave RX lines are connected to the TX line of the master. All the TX lines (tri-state) connected to the RX of the master. The problem is that the master is a single point of failure.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------
Reply to
Nico Coesel

y A

LOT

TWO WORDS.

Reply to
a7yvm109gf5d1

In California:

"mucho"

New word, one word again :-))

--
SCNR, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

this is

=20

my

whole

on

of

tight

=20

=20

reply

several

=20

them.

do

fully

that=20

am

that=20

really=20

etc.,=20

or=20

=20

caught=20

prototype".=20

Crikey, putting 14 pin devices in 8 pin positions! That is epic PWB hacking.

Reply to
JosephKK

this=20

I=20

of my

them=20

of

tight

time.=20

a=20

in=20

reply

will=20

them.

Tx

last

termination

disabled.

=20

two=20

first=20

enable DE=20

txreg=20

=20

it=20

In a two pair (four wire) system it should not be a problem. In a one pair (two wire) system it can cause problems by trying to respond to your own outgoing message.

Reply to
JosephKK

do

fully

that I

am

needed=20

57.6K,=20

Actually, i find it kind of screwy for a differential pair signaling system.

Reply to
JosephKK

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.