From: a7yvm109gf5d1 on
On Jun 11, 5:42 pm, "ScadaEng" <scada...(a)optonline.net> wrote:
> I have worked allot with RS232, and other serial protocols, but this is my

A

LOT


TWO WORDS.
From: Joerg on
a7yvm109gf5d1(a)netzero.com wrote:
> On Jun 11, 5:42 pm, "ScadaEng" <scada...(a)optonline.net> wrote:
>> I have worked allot with RS232, and other serial protocols, but this is my
>
> A
>
> LOT
>
>
> TWO WORDS.

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.
From: JosephKK on
On Fri, 11 Jun 2010 21:15:38 -0400, "ScadaEng" <scadaeng(a)optonline.net>
wrote:

>
>"Tim Wescott" <tim(a)seemywebsite.now> wrote in message
>news:UvednQJjt_R8Ro_RnZ2dnUVZ_gWdnZ2d(a)web-ster.com...
>> On 06/11/2010 04:14 PM, ScadaEng wrote:
>>> "Bit Farmer"<bit.farmer(a)yahoo.com> wrote in message
>>> news:V9-dnQM0RuB8Io_RnZ2dnUVZ_tGdnZ2d(a)giganews.com...
>>>> ScadaEng wrote:
>>>>> I have worked allot with RS232, and other serial protocols, but this is
>>>>> my first RS485 project. It seemed straight forward to me, but now I
>>>>> have
>>>>> a big problem.
>>>>>
>>>>> I am using the max490 chip. I'm doing full duplex, 4 wire. Each of my
>>>>> nodes have the max490 communicating with a 16F877A pic chip. The whole
>>>>> project will have 25 nodes. I just built two pcb's (nodes) and
>>>>> individually they work as expected. However when I put both of them on
>>>>> the rs485 bus, I can't talk to either of them! Probably some kind of
>>>>> collision, but as it turns out my scope just died and I'm on a tight
>>>>> deadline. Any help is greatly appreciated.
>>>>
>>>> Check your output enables. You can't have both on at the same time.
>>>> The
>>>> system must be designed to allow only one transmitter to be on at a
>>>> time.
>>>> The easiest way to do this is to have the master poll each device in
>>>> turn.
>>>> When polled, each device can then send either a NoData packet or reply
>>>> with the data that it needs to send. This approach was used for several
>>>> generations of point of sale systems and works quite well. You will
>>>> need
>>>> to have unique addresses for each device and a means of setting them.
>>>>
>>>> b. Farmer
>>> That's the thing, there are no output enables with the max490 chip. I do
>>> have unique addresses, and I can call each board by itself with it fully
>>> functioning. Its when I put more than one board on the network(485) that
>>> I
>>> can't commmunicate with any of them. Not that it should matter, but I am
>>> using a modified RTU Modbus protocol.
>>
>> You have to turn the transmitter on under processor control, and for that
>> you have to have an enable pin on the transceiver. That chip isn't really
>> an RS-485 transceiver at all -- it's more a 422 transceiver without
>> internal terminations.
>>
>> Sorry. That's the breaks.
>>
>> Either daisy-chain everything, with board 1 transmitting to board 2 etc.,
>> back to board 1, and wait for the system failure when one board fails, or
>> rip out the 490 and put in a real 485 transceiver, like the MAX-485.
>>
>> --
>> Tim Wescott
>> Control system and signal processing consulting
>> www.wescottdesign.com
>
>Yeah, thats what I was affraid of. I was grabing at straws, I was hoping
>someone would see a way out of this. Thats what happens when you get caught
>up in the rush, and get talked into "not waisting time making a prototype".
>I think I will order the max491 and hack the hell out of 25 boards.
>
>Thanks to everyone for your responses.
>

Crikey, putting 14 pin devices in 8 pin positions! That is epic PWB
hacking.
From: JosephKK on
On Sat, 12 Jun 2010 12:32:14 -0400, "ScadaEng" <scadaeng(a)optonline.net>
wrote:

>
>"Martin Riddle" <martin_rid(a)verizon.net> wrote in message
>news:hv00u5$rak$1(a)news.eternal-september.org...
>>
>>
>> "ScadaEng" <scadaeng(a)optonline.net> wrote in message
>> news:4c135553$0$22519$607ed4bc(a)cv.net...
>>>
>>> "Paul Keinanen" <keinanen(a)sci.fi> wrote in message
>>> news:82b616l1mbp6vfbodrvlm3jku629d6jbgm(a)4ax.com...
>>>> On Fri, 11 Jun 2010 19:14:42 -0400, "ScadaEng"
>>>> <scadaeng(a)optonline.net> wrote:
>>>>
>>>>>
>>>>>"Bit Farmer" <bit.farmer(a)yahoo.com> wrote in message
>>>>>news:V9-dnQM0RuB8Io_RnZ2dnUVZ_tGdnZ2d(a)giganews.com...
>>>>>> ScadaEng wrote:
>>>>>>> I have worked allot with RS232, and other serial protocols, but this
>>>>>>> is
>>>>>>> my first RS485 project. It seemed straight forward to me, but now I
>>>>>>> have
>>>>>>> a big problem.
>>>>>>>
>>>>>>> I am using the max490 chip. I'm doing full duplex, 4 wire. Each of my
>>>>>>> nodes have the max490 communicating with a 16F877A pic chip. The
>>>>>>> whole
>>>>>>> project will have 25 nodes. I just built two pcb's (nodes) and
>>>>>>> individually they work as expected. However when I put both of them
>>>>>>> on
>>>>>>> the rs485 bus, I can't talk to either of them! Probably some kind of
>>>>>>> collision, but as it turns out my scope just died and I'm on a tight
>>>>>>> deadline. Any help is greatly appreciated.
>>>>>>
>>>>>> Check your output enables. You can't have both on at the same time.
>>>>>> The
>>>>>> system must be designed to allow only one transmitter to be on at a
>>>>>> time.
>>>>>> The easiest way to do this is to have the master poll each device in
>>>>>> turn.
>>>>>> When polled, each device can then send either a NoData packet or reply
>>>>>> with the data that it needs to send. This approach was used for
>>>>>> several
>>>>>> generations of point of sale systems and works quite well. You will
>>>>>> need
>>>>>> to have unique addresses for each device and a means of setting them.
>>>>>>
>>>>>> b. Farmer
>>>>>That's the thing, there are no output enables with the max490 chip.
>>>>
>>>> You can use that chip only on the master.
>>>>
>>>> In a "4 wire RS-485" network, the master will always have both the Tx
>>>> as well as Rx active all the time.
>>>>
>>>> The slaves will always have the Rx enabled (listening for the master
>>>> Tx pair), however, the slave Tx must only be activated, when that
>>>> slave has been addressed and is ready to send the response to the
>>>> master. Have you looked at e.g. MAX485, which has separate
>>>> ReceiverEnable and DriverEnable pins, which you need for the slaves.
>>>>
>>>> I do not know about the PIC UART, but make sure that actually the last
>>>> stop bit for the last byte has been transmitted out of the shift
>>>> register, before turning off the transmitter.
>>>>
>>>> Some stupid UART designs such as the 14550 family generate an
>>>> interrupt when the last byte has been loaded into the Tx shift
>>>> register, however, you can not turn of the transmitter at time, but
>>>> you have to wait for the last byte has actually been shifted out.
>>>>
>>>> For Modbus, you should actually keep the transmitter enabled for an
>>>> additional 3.5 character times after the last data byte has actually
>>>> been transmitted (thus sending constant Mark state), however, with a
>>>> properly terminated line, this is not necessary as the last stop bit
>>>> will put the line into the Mark state and the "fail-safe" termination
>>>> will keep the line in Mark state, even if the transmitter is disabled.
>>>>
>>> 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.
>>>
>>
>> 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
>>
>>
>>
>>
>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...
>

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.
From: JosephKK on
On Sat, 12 Jun 2010 07:50:27 -0400, "ScadaEng" <scadaeng(a)optonline.net>
wrote:

>
>"Paul Keinanen" <keinanen(a)sci.fi> wrote in message
>news:pun616los12l5tctnkgdhuj123dgtu6gjc(a)4ax.com...
>> On Fri, 11 Jun 2010 19:14:42 -0400, "ScadaEng"
>> <scadaeng(a)optonline.net> wrote:
>>
>>>That's the thing, there are no output enables with the max490 chip. I do
>>>have unique addresses, and I can call each board by itself with it fully
>>>functioning. Its when I put more than one board on the network(485) that I
>>>can't commmunicate with any of them. Not that it should matter, but I am
>>>using a modified RTU Modbus protocol.
>>
>> 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.
>>
>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.
>

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