EmbeddedRelated.com
Forums

Do you still use "RS232" or something else?

Started by Oliver Betz January 14, 2011
On 16 Jan., 09:13, Glenn <glenn2...@gmail.com> wrote:
> On 14 Jan., 13:13, Oliver Betz <ob...@despammed.com> wrote: > > > Hello All, > ... > > > More alternatives? > > > Oliver > > -- > > Oliver Betz, Munich > > despammed.com is broken, use Reply-To: > > The alternative - long ago MacOS X begin to support IP-over-USB and IP- > over-firewire - but this is not the point though. > > The point is that you can communicate with your device via layer 2 mac/ > ethernet/physical-addresses ! > > You do not need IP and the DHCP functionality. > > You only need to write in the device mac-address to communicate with > it. In principle the mac-address is unique in the whole world, but the > mac-address is typically different on the different ports (USB, > ethernet...). > > With todays open-source ip-stacks, you can simply remove the ip-part > and only use layer 2 communication. Maybe you could use PPP over > ethernet II framing? > > - > > layer 2 protocols: > > http://en.wikipedia.org/wiki/List_of_network_protocols#Layer_2_protoc...http://en.wikipedia.org/wiki/Data_link_layer > > e.g. > > http://en.wikipedia.org/wiki/Ethernethttp://en.wikipedia.org/wiki/Ethernet_frame#Ethernet_frame_types > E.g. > Ethernet II frame = DIX frame - most used > > http://en.wikipedia.org/wiki/Point-to-Point_Protocol > > Other layer-2 examples over e.g. ethernet or 802.1 not used here: > dhcp > arp > 802.1x (http://en.wikipedia.org/wiki/IEEE_802.1x)
More about it: http://en.wikipedia.org/wiki/Ethernet_over_USB http://en.wikipedia.org/wiki/USB_communications_device_class Quote: "... Additionally this device class supports computer networking akin to a network card, providing an interface for transmitting Ethernet or ATM frames onto some physical media. Microsoft Windows versions prior to Windows Vista do not support the networking parts of the USB CDC, instead promoting Microsoft's own derivative named Microsoft RNDIS, a serialized version of the Microsoft NDIS (Network Driver Interface Specification). With a vendor-supplied INF file, Windows Vista supports USB CDC and USB WMCDC.[1] This class is generally implemented in embedded systems like mobile phones to achieve more than one functionality from the device, so that a phone may be used as a modem, fax or network port. The data interfaces are generally used to perform bulk data transfer. ..." http://en.wikipedia.org/wiki/RNDIS Quote: "... The Remote Network Driver Interface Specification (RNDIS) is a Microsoft proprietary protocol used mostly on top of USB. ... The USB Implementers Forum (USB-IF) defines at least three non- proprietary USB Communications Device Class (CDC) protocols with comparable "virtual Ethernet" functionality; one of them (CDC-ECM) predates RNDIS and is widely used for interoperability with non- Microsoft operating systems, but it has no native Windows support. ..." The GNU/Linux "usbnet" Driver Framework: http://www.linux-usb.org/usbnet/ Quote: "... Linux PDAs, and other embedded systems like DOCSIS cable modems, are much the same. They act as Hosts in the networking sense while they are "devices" in the USB sense, so they behave like the other end of a host-to-host cable. All that's needed is the USB-IF Communications Device Class (CDC) "Ethernet" class, or a simplified variant if the hardware can't implement CDC to spec. (Unless you listen to Microsoft, who will tell you not to use such vendor-neutral protocols. They think a complex and poorly documented protocol they defined, RNDIS, is better for them.) ... Another approach to using IP over USB is to make the device look like a serial line or telecommunications modem, and then run PPP over those protocols. This document doesn't address those approaches, used sometimes with USB drivers such as cdc_acm, usb-serial, and with adapters to IRDA or BlueTooth stacks. ... Zeroconf The current zcip software works with recent versions of usbnet. (There's also a version of this in current versions of Busybox.) It partially supports the goal of a fully hands-off user install experience, so that USB peripherals don't require any sysadmin attention at all during setup, even on networks without DHCP service. (Read more about the IETF Zero Configuration Networking working group.) ... NOTE for RNDIS users: MS-Windows has problems with its USB and RNDIS stacks, which can not be worked around by Linux peripherals. Symptoms include at one extreme a blue screen (panic), to stopping communication after a while, to (the mildest failure) just a temporary lockup that goes away after a while. ..." If you use ethernet over USB/bluetooth... you can use Wireshark to capture your ethernet for debugging purposes. http://en.wikipedia.org/wiki/Bluetooth#List_of_applications Quote: "... List of applications ... * Wireless bridge between two Industrial Ethernet (e.g., PROFINET) networks. ..."
On 16 Jan., 09:36, Glenn <glenn2...@gmail.com> wrote:
> On 16 Jan., 09:13, Glenn <glenn2...@gmail.com> wrote: > > > > > On 14 Jan., 13:13, Oliver Betz <ob...@despammed.com> wrote: > > > > Hello All, > > ... > > > > More alternatives? > > > > Oliver > > > -- > > > Oliver Betz, Munich > > > despammed.com is broken, use Reply-To: > > > The alternative - long ago MacOS X begin to support IP-over-USB and IP- > > over-firewire - but this is not the point though. > > > The point is that you can communicate with your device via layer 2 mac/ > > ethernet/physical-addresses !
... Microsoft seem to support USB-CDC - it just has to be enabled?: Drivers for the Supported USB Device Classes http://msdn.microsoft.com/en-us/library/ff538820%28v=vs.85%29.aspx Quote: "... Starting with Windows Vista, you can enable CDC and Wireless Mobile CDC (WMCDC) support by setting a registry value, as described in Support for the Wireless Mobile Communication Device Class. ..." Support for the Wireless Mobile Communication Device Class http://msdn.microsoft.com/en-us/library/ff538833%28v=vs.85%29.aspx
On 1/15/2011 5:12 PM, upsidedown@downunder.com wrote:
> On Sat, 15 Jan 2011 12:34:10 -0700, D Yuniskis > <not.going.to.be@seen.com> wrote: > >>> But I'm afraid our users won't use plain/clean Ethernet but switch to >>> "Screwed-Up-Profibus" which I won't implement unless I'm forced to. >> >> If you can live with the (short) distance limitations of USB, what if >> you made your device look like a mass storage device. I.e., damn >> near every USB host out there will recognize a USB "disk drive". >> >> User can mount the drive (which is often automatic) and then access >> X:\index.html to interact with it. That *static* page (i.e., a "file" >> on your device) can have links to: X:\status.html, X:\log.html, >> X:\diagnostics.html, etc. You don't even need a "web server" in >> your device -- instead, you watch to see which "files" are accessed >> and in which order. > > If you want to look like a USB drive, you must also act like an USB > drive (timeouts).
Sure. And if you want to look like a DTE or DCE you also have timing constraints -- that goes without saying. But, you can design an HTML "interface" that implicitly transfers information/commands just by noting which resources are accessed by the client. I.e., you don't have to dynamically serve up a (complex) page for each resource accessed. Without specific requirements, it's hard to say which, if any, alternatives *will* work -- though we can suggest approaches that *might* work! (the rest is left as an exercise for the reader :> )
> For more than two years ago, I had problems installing a wireless > broadband modem (Huawei). It used one Windows drive letter (file > system) for actual modem operation and an other for distributing the > (Windows) drivers. > > My installation attempts ended up with various timeout proplems. > > I finally figured out that by first copying the installation software > and drivers from the USB modem "disk drive" to an external drive (such > as USB memory stick) the installation process went OK. > > Apart from this, the modem has worked flawlessly, when I use the same > USB port. Unfortunately using a diffeent USB purt caused a lot of > problems.
On 16 Jan., 00:57, Clifford Heath <n...@spam.please.net> wrote:
> On 01/15/11 18:41, Glenn wrote:
...
> > The USB standard ought to be with for a long time - why?: > > It has only 1 twisted pair for bidirectional communication. It can not > > get any simpler in hardware ! > > At a huge cost in software though, especially host-side. > > Clifford Heath
I wil try to address this here, if you by cost mean money. If you choose the right microcontroller - the no: Generally: USB in a NutShell. Making sense of the USB standard: http://www.beyondlogic.org/usbnutshell/usb1.htm Have you tried running the USBCV (compliance verifier) tool with your device? It's at: http://www.usb.org/developers/tools http://www.usb.org/developers/docs/ - ARM: Migration from PIC to ARM Cortex MCU: http://www.eg3.com/webinars/video/20100518a-st.pdf Quote: "... Free USB device library from ST: ANSI-C source code available, supporting many USB classes (mass storage, HID, DFU, CDC, audio) ..." Embedded USB Device Stack: http://www.thesycon.de/eng/embusbdevice.shtml Quote: "...Memory Footprints..." http://www.thesycon.de/embusbdevice/embusbdevicestack.pdf LPC214x USB stack: http://sourceforge.net/projects/lpcusb Citat: "...This is a USB core stack for the built-in USB device of LPC214x microcontrollers. It handles the hardware interface and USB enumeration/configuration. Also included are examples like USB joystick HID, USB virtual COM port and USB mass storage on SD-card..." This page is the homepage for an open-source USB stack for the built- in USB controller in LPC214x microcontrollers: http://wiki.sikken.nl/index.php?title=3DLPCUSB Citat: "...LPC2148 microcontroller (I'm using an Embedded Artists LPC2148 quickstart board + prototype board) running on a 12 MHz crystal..." http://wiki.sikken.nl/index.php?title=3DMain_Page Does ARM provide drivers for the USB controller on my development board? http://www.arm.com/support/faqdev/13593.html Citat: "...Philips have now released their Linux drivers for ISP1761 under a GPL licence. These are available from...": http://sourceforge.net/users/philips_usb/ - AVR: V-USB is a software-only implementation of a low-speed USB device for Atmel=92s AVR=AE microcontrollers, making it possible to build USB hardware with almost any AVR=AE microcontroller, not requiring any additional chip: http://www.obdev.at/products/vusb/index.html "... V-USB can be licensed freely under the GNU General Public License or alternatively under a commercial license. ..." Implementing USB 1.1 in Firmware http://www.obdev.at/developers/articles/00003.html USBasp - USB programmer for Atmel AVR controllers http://www.fischl.de/usbasp/ - PIC: USB Framework for PIC18, PIC24 & PIC32: http://www.microchip.com/stellent/idcplg?IdcService=3DSS_GET_PAGE&nodeId=3D= 2680&dDocName=3Den537044 Quote: "...Microchip has USB software to support USB on 8-bit, 16-bit and 32-bit MCUs. This software is royalty free source code and also includes example projects..."
On 16/01/2011 8:20 PM, Glenn wrote:
....
> > AVR: > > V-USB is a software-only implementation of a low-speed USB device for > Atmel&#4294967295;s AVR&#4294967295; microcontrollers, making it possible to build USB > hardware with almost any AVR&#4294967295; microcontroller, not requiring any > additional chip: > http://www.obdev.at/products/vusb/index.html > "... > V-USB can be licensed freely under the GNU General Public License or > alternatively under a commercial license. > ..." > Implementing USB 1.1 in Firmware > http://www.obdev.at/developers/articles/00003.html > > USBasp - USB programmer for Atmel AVR controllers > http://www.fischl.de/usbasp/
The "latest" USB library for AVR is LUFA - Lightweight USB Framework for AVRs http://code.google.com/p/lufa-lib/ http://www.fourwalledcubicle.com/LUFA.php Free, reasonably mature, used in Arduino Uno Tom
On 1/16/2011 3:20 AM, Glenn wrote:
> On 16 Jan., 00:57, Clifford Heath<n...@spam.please.net> wrote: >> On 01/15/11 18:41, Glenn wrote: > .... >>> The USB standard ought to be with for a long time - why?: >>> It has only 1 twisted pair for bidirectional communication. It can not >>> get any simpler in hardware ! >> >> At a huge cost in software though, especially host-side. >> >> Clifford Heath > > I wil try to address this here, if you by cost mean money. > > If you choose the right microcontroller - the no:
Were those (elided) all *host* implementations? And, what's the relative cost (development time, memory usage, etc.) of writing a UART handler? The appeal of a serial port is that it is relatively light (in terms of pins on MCU), low memory requirements (buffers can be as small as you want (if you trade latency) numbering in handfuls of bytes, reasonably low overhead (especially if using a device with a deep buffer and/or carefully considering what you push through the interface), "simple" software design, appeal to existing devices (in industrial control applications), easier to test/validate (fewer "special cases") etc. USB is heavier-weight in all of these regards.
rickman wrote:

[...]

>> >But I'm looking forward to the day when 232 is replaced by USB, not >> >because laptop makers refuse to have them in the machine, but because >> >USB is so easy to add there is no reason to use 232. >> >> Maybe I have a different understanding of "easy". >> >> Using a terminal program (e.g the one supplied with the PC operating >> system) is easy. I can guide a customer's technician on the phone to >> do it. He doesn't even need Internet access there. >> >> Providing software to access the USB HID data for every operating >> system is IMNSHO less easy. Windows X86, Windows 64 bit, Linux, Mac OS >> X, to be supported for more than ten years. I don't like to do it. > >Why does this require more than a terminal program? I use a USB >serial port with all sorts of software that is written to talk to a
It requires drivers to be installed with admin rights.
>serial port. Can a USB device be configured to look like a serial >port independent of what the USB chip is actually connected to? I
Yes, using a virtual comm port driver. Installation with admin rights, huge impact on target system. Would you tolerate that every stupid device you want to configure installs a virtual port? You will run out of port numbers quickly. IMO that's the wrong way, better would be to stick with EIA-232 and the user installs _one_ good USB <-> serial converter. I already wrote this 2011-01-14. Oliver -- Oliver Betz, Muenchen (oliverbetz.de)
D Yuniskis wrote:

[...]

>> "Free form" diagnosis means for example that the user can start some >> self tests and gets results in human readable form. That's easy with a >> terminal program. >> >> With CANopen or Profibus, I had to get access to this bus from the PC >> and to supply host software to achive a similar result. That's >> impossible in most cases. >> >> Therefore I need a simple "interactive" access to the device. >> Currently EIA-232 if possible. Or UART data over 24V I/O with a >> primitive (even passive) level converter for small sensors. We did >> this long before IO-Link became popular. > >But you also need that to be some interface that the (typical) user >will have ready access to.
I don't know what you are speaking about. Physical interface: Connector, level converter? Logical interface?
> What distances are you concerned with?
The user will walk to the device, not lay a 100m cable to it. IOW 4m is long in this context. Really long cables will be the mentioned process data buses.
>And, how "interactive" does it have to be? E.g., entering the >current date is more interactive than *picking* the day-of-week.
Using a terminal program, there is little difference.
>>> OTOH, if your device is robust enough to be operational *including* >>> the networking aspects, then you could still support "configuration >>> and diagnosis" over the wire. >> >> If I had Ethernet anyway as Didi's spectrometer has, I would of course >> offer configuration and diags there. >> >> But I'm afraid our users won't use plain/clean Ethernet but switch to >> "Screwed-Up-Profibus" which I won't implement unless I'm forced to. > >If you can live with the (short) distance limitations of USB, what if >you made your device look like a mass storage device. I.e., damn >near every USB host out there will recognize a USB "disk drive". > >User can mount the drive (which is often automatic) and then access >X:\index.html to interact with it. That *static* page (i.e., a "file" >on your device) can have links to: X:\status.html, X:\log.html, >X:\diagnostics.html, etc. You don't even need a "web server" in >your device -- instead, you watch to see which "files" are accessed >and in which order.
The OS will assume exclusive access, therefore cache data. I think it will be difficult to establish a dynamic data exchange. And transferring arbitrary numbers from a web browser to a "mass storage" device will be also somewhat weird. Oliver -- Oliver Betz, Muenchen (oliverbetz.de)
On 2011-01-15, Oliver Betz <OBetz@despammed.com> wrote:
> rickman wrote: > > [...] > >>But I'm looking forward to the day when 232 is replaced by USB, not >>because laptop makers refuse to have them in the machine, but because >>USB is so easy to add there is no reason to use 232. > > Maybe I have a different understanding of "easy". > > Using a terminal program (e.g the one supplied with the PC operating > system) is easy.
The problem is that Windows doesn't supply a terminal program. All it comes with is "Hyperterminal". While it has the word "terminal" in it's name I don't think it qualifies as a terminal program. It's so bad it barely qualifies as a program at all. 1/2 ;) -- Grant
Grant Edwards <invalid@invalid.invalid> writes:

> On 2011-01-15, Oliver Betz <OBetz@despammed.com> wrote: >> rickman wrote: >> >> [...] >> >>>But I'm looking forward to the day when 232 is replaced by USB, not >>>because laptop makers refuse to have them in the machine, but because >>>USB is so easy to add there is no reason to use 232. >> >> Maybe I have a different understanding of "easy". >> >> Using a terminal program (e.g the one supplied with the PC operating >> system) is easy. > > The problem is that Windows doesn't supply a terminal program. All it > comes with is "Hyperterminal". While it has the word "terminal" in > it's name I don't think it qualifies as a terminal program. It's so > bad it barely qualifies as a program at all. > > 1/2 ;)
It doesn't even have Hyperterminal any more... For firmware updates I am just now trying a new method - for me - where the bootloader emulates a USB flash drive. It wasn't too hard to get going, has the advantage of no drivers required. Seems to work well. No more trying to get users to install drivers, or having the windows .exe attachments blocked by all three email accounts they give me. -- John Devereux