EmbeddedRelated.com
Forums

RS485 - MODBUS or PROFIBUS or ....

Started by eeboarder July 21, 2009
Rich Webb wrote:
> On Wed, 22 Jul 2009 07:28:08 -0700, Rumpelstiltskin <rumpy@abc.biz> > wrote: > >> Grant Edwards wrote: >>> On 2009-07-22, Rumpelstiltskin <rumpy@abc.biz> wrote: >>> >>>> Since distance is only 4 feet, simplest way is to make a TTL >>>> level RS232 wire-or'd bus. >>> Since "TTL level" and "RS232" are mutually exlusive, can you >>> explain what you mean by "TTL level RS232"? >>> >> The output of a UART is TTL. UART output is generally referred >> to as RS232, > > You misspelled "generally" as "incorrectly."
Incorrect, but commonly used. > The signal polarity
> (mark-high versus mark-low) is also flipped and there are a number of > other constraints that follow the designation.
Use a 74HCT09 instead of 74HCT07, polarity solved.
> Practitioners generally refer to a UART's external interface as > asynchronous serial or async serial or just async, which itself can > interoperate with a range of physical layers.
async serial can be alot of things. Not necessarily UART coms.
Paul Keinanen wrote:
> On Wed, 22 Jul 2009 07:03:07 -0700, Rumpelstiltskin <rumpy@abc.biz> > wrote: > >> Since distance is only 4 feet, >> simplest way is to make a TTL level >> RS232 wire-or'd bus. Just requires >> adding an open collector TTL buffer >> to each transmit line, and resistor pullup. > > While wire-ORing some TTL open collector outputs would be sufficient > to implement a bus _within_ a single PCB, there are hardly any PCBs > more than 1 m long these days :-)
Why limited to PCB? Floppy drives used terminated wire-or'd TTL for years with cables several feet long if needed.
> When interconnecting any PCBs with cables at least a few centimeters > long, you are going to have ground potential problems, due to the > resistance (and most importantly the inductance) of the ground > connection.
When your max speed is 115K, and requirement surely much slower there are no serious problems with running 3-4 feet max.
> When transferring data from one PCB to an other, I really would > suggest using some kind of differential signaling such as RS-485 or > CAN bus. The other alternative is to use for instance Biphase-M > coding, which will pass through transformers and hence the PCBs can be > galvanically isolated from each other. > > Paul
IMO, that is overkill for coms of 4 feet max. Especially in the context of the original intention of poster.
On 2009-07-23, Rumpelstiltskin <rumpy@abc.biz> wrote:
> Rich Webb wrote: >> On Wed, 22 Jul 2009 07:28:08 -0700, Rumpelstiltskin <rumpy@abc.biz> wrote: >>> Grant Edwards wrote: >>>> On 2009-07-22, Rumpelstiltskin <rumpy@abc.biz> wrote: >>>> >>>>> Since distance is only 4 feet, simplest way is to make a TTL >>>>> level RS232 wire-or'd bus. >>>> Since "TTL level" and "RS232" are mutually exlusive, can you >>>> explain what you mean by "TTL level RS232"? >>>> >>> The output of a UART is TTL. UART output is generally referred >>> to as RS232, >> >> You misspelled "generally" as "incorrectly." > > Incorrect, but commonly used.
It must be regional. I've been doing microprocessor stuff involving serial ports for 25 years, and I don't think I've ever heard it used that way.
>> The signal polarity (mark-high versus mark-low) is also >> flipped and there are a number of other constraints that >> follow the designation. > > Use a 74HCT09 instead of 74HCT07, polarity solved.
But, that still doesn't make it RS232. :)
>> Practitioners generally refer to a UART's external interface >> as asynchronous serial or async serial or just async, which >> itself can interoperate with a range of physical layers. > > async serial can be alot of things. Not necessarily UART coms.
Even if it's not 100% specific, the term "async" is at least correct (and it's the term that comes to mind for me). Since RS232 interfaces can be synchronous, using the term "RS232" to specify an async interface that doesn't use RS232 levels is wrong in multiple ways... -- Grant
In article <h48gg6$2r5$1@aioe.org>, Rumpelstiltskin <rumpy@abc.biz> wrote:
>Paul Keinanen wrote: >> On Wed, 22 Jul 2009 07:03:07 -0700, Rumpelstiltskin <rumpy@abc.biz> >> wrote: >> >>> Since distance is only 4 feet, >>> simplest way is to make a TTL level >>> RS232 wire-or'd bus. Just requires >>> adding an open collector TTL buffer >>> to each transmit line, and resistor pullup. >> >> While wire-ORing some TTL open collector outputs would be sufficient >> to implement a bus _within_ a single PCB, there are hardly any PCBs >> more than 1 m long these days :-) > >Why limited to PCB? Floppy drives used terminated wire-or'd TTL >for years with cables several feet long if needed. > > >> When interconnecting any PCBs with cables at least a few centimeters >> long, you are going to have ground potential problems, due to the >> resistance (and most importantly the inductance) of the ground >> connection. > >When your max speed is 115K, and requirement surely much slower >there are no serious problems with running 3-4 feet max.
I've run over 10 feet using plain TTL (not open collector) over 30 AWG cable at around 50 kbps without any problems. The DC resistance of the ground connection is typically not a problem if you match the number of signal and ground wires and if you're not powering your device over the same cable. The inductance and capacitance of the cable does need to be accounted for, but placing suitable series resistors on both ends of each signal line and limiting your data rate will reduce the effects. The series resistors can also offer a degree of protection and support for hot-plugging if your TTL ports include clamping diodes. Now, the original requirements called for a protocol that can support all three types of transfers: master to slave, slave to master, and slave to slave. There was no mention of any timing or latency restrictions so something like MODBUS could be used and each slave to slave transfer would be substituted by a pair of master/slave transfers. However without knowing more details like maximum payload size, minimum latency, types of devices connected to the bus (FPGA, MCU, PC), buffering, media access, flow control, etc. it's hard to recommend a solution. Assuming low latency, small payload, MCU controlled devices, I would go for something that uses non-destructive arbitration like CAN. If you don't have/want a CAN controller then try something like SAE J1850, which uses a single data line and can easily be bit-banged from a small MCU.
Grant Edwards wrote:
>> Incorrect, but commonly used. > > It must be regional. I've been doing microprocessor stuff > involving serial ports for 25 years, and I don't think I've > ever heard it used that way.
I have heard beginners use terms like this all the time. When I correct them, they say "whatever". So. commonly used by beginners. don
don wrote:
> Grant Edwards wrote: >>> Incorrect, but commonly used. >> >> It must be regional. I've been doing microprocessor stuff >> involving serial ports for 25 years, and I don't think I've >> ever heard it used that way. > > I have heard beginners use terms like this all the time. > > When I correct them, they say "whatever". > > So. commonly used by beginners. > > don
Well, guess I've been a beginner for 25 years.
Hi Paul,
if he does implement a "RS-485 or CAN bus" as you suggested, what chips do 
you recommend he use?.





"Paul Keinanen" <keinanen@sci.fi> wrote in message 
news:jmme65ts44hpgk5i5n2kdue9se6sf7ulft@4ax.com...
> On Wed, 22 Jul 2009 07:03:07 -0700, Rumpelstiltskin <rumpy@abc.biz> > wrote: > >>Since distance is only 4 feet, >>simplest way is to make a TTL level >>RS232 wire-or'd bus. Just requires >>adding an open collector TTL buffer >>to each transmit line, and resistor pullup. > > While wire-ORing some TTL open collector outputs would be sufficient > to implement a bus _within_ a single PCB, there are hardly any PCBs > more than 1 m long these days :-) > > When interconnecting any PCBs with cables at least a few centimeters > long, you are going to have ground potential problems, due to the > resistance (and most importantly the inductance) of the ground > connection. > > When transferring data from one PCB to an other, I really would > suggest using some kind of differential signaling such as RS-485 or > CAN bus. The other alternative is to use for instance Biphase-M > coding, which will pass through transformers and hence the PCBs can be > galvanically isolated from each other. > > Paul >
On Wed, 22 Jul 2009 18:59:09 -0700, Rumpelstiltskin <rumpy@abc.biz>
wrote:

> > > The signal polarity >> (mark-high versus mark-low) is also flipped and there are a number of >> other constraints that follow the designation. > >Use a 74HCT09 instead of 74HCT07, polarity solved.
I guess that you would have to run with Vcc at +3.5 V and Gnd at -3.5 V and there would still be questions, if even the required +/-3 V receiver voltage swing could be obtained. But clearly it is not within the required _transmitter_ voltage swing. Also running 74HCT chips at 7 V is at the absolute maximum limit. Paul
On Wed, 22 Jul 2009 19:04:46 -0700, Rumpelstiltskin <rumpy@abc.biz>
wrote:

>Paul Keinanen wrote:
>> When interconnecting any PCBs with cables at least a few centimeters >> long, you are going to have ground potential problems, due to the >> resistance (and most importantly the inductance) of the ground >> connection. > >When your max speed is 115K, and requirement surely much slower >there are no serious problems with running 3-4 feet max.
The original requirement was less than 1 Mbit/s, so speeds below 115 might be sufficient, or perhaps not.
>> When transferring data from one PCB to an other, I really would >> suggest using some kind of differential signaling such as RS-485 or >> CAN bus. The other alternative is to use for instance Biphase-M >> coding, which will pass through transformers and hence the PCBs can be >> galvanically isolated from each other. >> >> Paul > >IMO, that is overkill for coms of 4 feet max. >Especially in the context of the original intention of poster.
Balanced connections may be an overkill, if devices are powered from the same power supply or they are separately battery powered or each powered through isolation transformers. However, if the devices are powered by separate mains power supplies and the signal ground is connected to the chassis and PE connector, you may have quite a lot of problems, if the power cords are connected into different mains sockets when TN-C or TN-C-S mains wiring convention is used. In such sockets, the potential difference between the PE connector of two mains sockets can be several volts and quite large currents will flow in your _signal_ ground connector from the PE terminal of one mains socket to the PE terminal of an other mains socket. In the old days, even with proper RS-232 voltages, the ground potential differences caused a lot of problems when dumb terminals were connected to a computer from different rooms with different ground potential. TTL has mach lower noise margin than RS-232, so any extra current flowing in the signal ground would cause problems. Differential connections such as RS-422/485 and CAN can tolerate several volts of common mode voltage, so this will solve most of the problems associated with TN-C and TN-C-S mains wiring. Paul
Rumpelstiltskin wrote:
> Rich Webb wrote: >> On Wed, 22 Jul 2009 07:28:08 -0700, Rumpelstiltskin <rumpy@abc.biz> >> wrote: >> >>> Grant Edwards wrote: >>>> On 2009-07-22, Rumpelstiltskin <rumpy@abc.biz> wrote: >>>> >>>>> Since distance is only 4 feet, simplest way is to make a TTL >>>>> level RS232 wire-or'd bus. >>>> Since "TTL level" and "RS232" are mutually exlusive, can you >>>> explain what you mean by "TTL level RS232"? >>>> >>> The output of a UART is TTL. UART output is generally referred >>> to as RS232, >> >> You misspelled "generally" as "incorrectly." > > Incorrect, but commonly used. >
I've also heard people say "RS232" when they mean a UART output, but it's generally from people with little technical experience. There are many different ways to pass UART signals around (RS232, RS485 and RS422 are common, but you get transparent radio modems, line drivers, power line modems, fibre, simple transistor drivers, direct connection, etc.). I think the only sensible way to refer to UART signalling is "UART". That's pretty clear to most people in most context. "async" or just "serial communication" are often used, and are fine if the context makes it clear what you are talking about.