USB or Ethernet for controller interface?

Working on 32-bit microcontroller design that needs to interface to industrial PC (mini-ITX, PC104, etc.) over short 3-meter cable. It is an industrial application and the design will be DIN rail mounted along side PLC's, relays, etc.

Any thoughts as to whether USB or Ethernet would be best?

Cost is a concern. Since this application's cable length requirement is short, does this make USB the obvious winner?

Or, is Ethernet more robust in an industrial environment?

Sorry if this has been debated in the past. I did a search, but didn't find much except for posts made in 2001. Let me know if there are articles that address this.

Thank you!

Reply to
Gary
Loading thread data ...

Ethernet provies galvanic isolation whereas USB does not.

Rene

Reply to
Rene Tschaggelar

Snip from Gary:

IMHO i don't think so. But again it depends what protocol you will use over Ethernet connectivity. I'll vote for USB with repeater/hub to cover the distance of three meter or above. CAN bus can be another option with low data rates;-)

ali

Reply to
Ali

What sort of data rates? RS-232 is the cheapest solustion or convert to RS-422 to give a bit more robustness but 232 should be fine for 3 meters.

Reply to
Tom Lucas

No mention of desired speed of communication, no indication of what type of equipment the microcontroller will be attached to (from a safety point of view) and certainly no mention of the safety requirements in the communications link (which you should not be entirely reliant on). You also do not mention the type of data you expect to be handled and what latency you could tolerate. So no hope of a really sensible answer.

There is a large number of communication possibilities from physical connection details to protocol choices (RS232, RS485, CAN, USB, Ethernet, etc.). A bit more detail from your side and maybe you will get an answer more appropriate to your situation.

--
********************************************************************
Paul E. Bennett ....................
 Click to see the full signature
Reply to
Paul E. Bennett

quoted text -

Thank you for the feedback. Here are more details:

100Mb/s Ethernet or USB are needed for thru-put. CAN & RS232/485 have been ruled out. Ethernet or USB data rate is needed because the design will be transferring large amounts of buffered data. The buffer will be large enough to handle Ethernet or USB latency and the PC's non-deterministic nature. The PC side will be used as the human- interface and data storage. Not for time or safety critical control.

The design will be doing basic control stuff - reading sensors & inputs and controlling actuators. The isolation Rene mentioned is very good feedback.

Reply to
Gary

No doubt about it. It is indeed cheap and easy communication link in terms of development time and cost. But don't know why people are getting rid of this valuable protocol, many computer manufacturers are eliminating RS-XXX at all. So the option would be using USB-to-RS-XXX converter at the top .

ali

Reply to
Ali

At my level of ignorance then the RS's are nice and simple and I can understand them. USB is pure witchcraft ;-)

Tread carefully with USB to serial converters - many have been stung because they don't always behave as expected, particularly with regard to timings.

Reply to
Tom Lucas

quoted text -

Go for Ethernet and the TCP/IP stack. You'll have problems on the non-transparency of USB protocols. The IP protocols on Ethernet are pretty standard, and the sheer mass of the TCP/IP community prevents any fast drastic changes, which is an absolute necessity in industrial applications.

(Been there - done that).

--
Tauno Voipio
tauno voipio (at) iki fi
 Click to see the full signature
Reply to
Tauno Voipio

Given the choice between Ethernet and USB, I'd recommend Ethernet any day.

Advantages of Ethernet over USB:

- electrically isolated

- optical PHY possible

- can use much longer cables

- may use already available infrastructure (data can be routed across the internet for example)

- no special drivers required

- multiple hosts can access simultaneously

- more robust, USB hosts may give up after just 3 failures

- easier to debug and monitor traffic

- cable can be unplugged/plugged without breaking the connection

- locking plugs

Reply to
Arlet

See, when you provide more detail in your enquiry the answers get better.

Isolation is important to consider in any application so always select interfaces that provide proper galvanic isolation. As Tauno has already responded, and as you feel you can live with the slower data rates of Ethernet (some dedicated USB 2.0 interfaces are supposed to be able to reach 480Mbps) then go with Ethernet. If your rate was not quite so demanding I would have suggested RS485 but you have, apparently, already ruled that out.

--
********************************************************************
Paul E. Bennett ....................
 Click to see the full signature
Reply to
Paul E. Bennett

The typical support in most OSses for ethernet is much more robust than USB. USB can be extremely flaky. If something goes wrong it is much easier to debug using standard ethernet tools. When wiring in existing conduit, 3m can quickly become 5m or more, which will be no problem for ethernet. Custom wire lengths for ethernet is simple. For USB you need molded cables, which comes in only a small selection of lengths.

Regards Anton Erasmus

Reply to
Anton Erasmus

I don't understand this statement. What about USB is not transparent?

USB is complex, but if you need its features (e.g. dynamic plug-n-play) or deterministic real-time behavior (e.g. isochronous and interrupt pipes) then USB has some nice features. Notice I didn't say it was simple ;-)

Reply to
Michael N. Moran

quoted text -

USB is only a little faster that RS-232.

Most computers are actually USB V1.2, 12 Mbit/sec.

With the overhead of USB, you can run a USB serial port at 230Kbit and some even faster.

So, data rate and data flow and safty isolation, Ethernet is the only way to go.

donald

Reply to
Donald

921 kbps is no sweat if you have the right chip...

--
Best Regards,
Ulf Samuelsson
 Click to see the full signature
Reply to
Ulf Samuelsson

Suggestions ??

Reply to
Donald

Use an FTDI USB chip (either UART, or FIFO interface depending on the electronics you are connecting to). They will give you up to 3 MBaud over a serial link using USB 1.1 at 12 MBit, and both the PC and the microcontroller can pretend you've got a straight-forward RS-232 connection.

The advantage of USB is that it's easy to use, easy on the electronics design, and easy to connect and configure (at least, using chips like these). It's not as fast or flexible as Ethernet, but it's a question of what is needed.

Reply to
David Brown

Yes - and totally controlled by the non-deterministic PC master.

--
Tauno Voipio
tauno voipio (at) iki fi
 Click to see the full signature
Reply to
Tauno Voipio

If you use the new W5100 IC from Wiznet, then implimenting a ethernet interface with TCP/IP interface is just as easy as using the FTDI chips. THe W5100 is an ethernet interface with hardware TCP/IP stack iwith a PHY. It can handle 4 simultanous connections in hardware. The MCU side is either 8 bit parallel interface or an SPI interface that can handle an SCK signal of 25MHz.

Regards Anton Erasmus

Reply to
Anton Erasmus

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.