[Oberon] Preaching against USB

skulski at pas.rochester.edu skulski at pas.rochester.edu
Wed Feb 17 05:56:55 CET 2016


enso wrote:

>[USB] requires a working computer system with substantial resources,
> the opposite of what you need in an embedded or experimental system.

Not true. I built embedded systems with EZ-USB from Cypress. It is a very
popular chip originally developed by Anchor which Cypress acquired. I used
the FX and FX2 versions. (The newest version is FX3.) The working USB
system consists of a single chip plus a few capacitors. There are no
"substantial resources" involved. The chip has 16 kB RAM and it is enough
for a very substantial project.

The FX2 software can be very simple because most of the USB protocol is
handled internally by the ASIC part of the chip. A page or two of code is
sufficient for a simple system. Example software is provided in FX2
documentation. A more complex one can use an embedded OS which Cypress
named Frameworks. It is neat, small, well written in plain C, and very
well documented.

The FX2 Technical reference manual is an outstanding source of knowledge
both on the chip and on the USB protocol and architecture.

> An asynchronous serial port sends data when it's ready,

Not that simple. A good reference book will explain a bit more. I
recommend Patterns for Time-Triggered Embedded Systems by Michael Pont
(available from Amazon). This book is very much in Oberon spirit. I once
wrote to Michael Pont that his architecture is very close to Oberon
System. He never heard of Oberon prior to my e-mail, but he checked and
acknowledged the similarity. His software provides an example how Oberon
System could have been if it was supported by a good industrial manager
like Michael.

> whereas USB has to packetize the data, causing
> unnecessary processing and making the timing less certain.

Let me point out that the USB-2 can achieve about 25 MBytes per second. It
supports up to 256 devices on a single bus. It has extensive
identification of devices and it can load and execute drivers. Saying that
these features are "unnecessary processing" is not even wrong.

USB-3 is even more impressive, but I am not an expert on USB-3. My working
knowledge only covers (parts of) USB-2.

> A serial port was an always-ready peripheral, easily configured
> with a couple of registers.

One host and a single peripheral. It is not much. As soon as you want to
develop something more substantial (like a network) "easily" does not
apply anymore. You must read a few books. I recommend Serial Port Complete
by Jan Axelson, or the Pont's book pointed above.

> Initializing a USB connection requires extensive negotiation
> and large tables, requiring kilobytes of RAM and a working CPU.

Use EZ-USB and USB will become almost as simple as the serial port. All
you need is some easy reading. The USB Complete by Jan Axelson is a good
beginning, and then the first few chapters from the FX or FX2 Technical
Reference Manual will put you on a path to success. The FX/FX2 chips will
take care of "extensive negotiation" for you.

It is very easy. Just a couple books and a couple months and you will
become a proficient USB developer, if you are not one already.

> Attaching a simple HID device like a keyboard,
> for those who complain about PS/2 ports, is not that easy.

Use the Cypress chip to handle the complexity and off you go. Also check
the following page: http://janaxelson.com/index.html

You can also use FTDI if you want a canned solutions. I recommend Cypress
because with Cypress you can take the lid off if you want to.

> Finally, as ubiquitous as USB is, it is not something
> that should be 'taught'.  It is a dumb, bloated and obfuscated
> spec with multiple standsards, connectors and extensions
> that is much like the US tax code.

I thought this mailing list was for engineers. I am surprised to find a
politician among us.

Thank you,
Wojtek



More information about the Oberon mailing list