From: Joerg on 12 Jun 2010 11:21 Nico Coesel wrote: > "ScadaEng" <scadaeng(a)optonline.net> 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 > > You can't do full duplex on a RS485 bus with more than two nodes > unless you use some kind of hub. Every device needs to receive the > transmit signal from all other devices. > 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.
From: Jamie on 12 Jun 2010 12:12 Paul Keinanen wrote: > 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. > You mean you need an open collector type out put?
From: ScadaEng on 12 Jun 2010 12:32 "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...
From: Paul Keinanen on 12 Jun 2010 12:47 On Sat, 12 Jun 2010 12:12:22 -0400, Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_(a)charter.net> wrote: >Paul Keinanen wrote: >> 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. >> >You mean you need an open collector type out put? 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.
From: Nico Coesel on 12 Jun 2010 14:47
Joerg <invalid(a)invalid.invalid> wrote: >Nico Coesel wrote: >> "ScadaEng" <scadaeng(a)optonline.net> 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 >> >> You can't do full duplex on a RS485 bus with more than two nodes >> unless you use some kind of hub. Every device needs to receive the >> transmit signal from all other devices. >> > >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 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(a)nctdevpuntnl (punt=.) -------------------------------------------------------------- |