[Oberon] Preaching against USB

Ken Boak ken.boak at gmail.com
Wed Feb 17 09:47:44 CET 2016


Wojtek,

I had a "run-in" with the Cypress FX2 about 5 years ago.  I was forced to
use it because it was used on my then employers previous product.

I am not a natural C programmer, and forced to having to use this IC I
guess put about 3 months on the project.

The FX2 is a 8051 based microcontroller
You need to get hold of the C compiler - Keil uVision  - at whatever cost
You have to fight your way around the 8051 architecture

I never did come to terms with the code that ran the USB - I just accepted
that was present on the device, and tried to concentrate on getting my
application to work.

I ended up implementing bit-banged SPI on the FX2, to copy a few bytes into
a serial SRAM, for which I created a dual port arrangement to the C2000 DSP
I was using.

Did I learn anything useful about USB from my FX2 experience? - just never
use an 8051 or FX2 ever again!

The FX2 adds about $5 the product.  There's really no place left for it
nowadays when you can by an easy to use USB to serial converter IC for
under $0.50, and every ARM chip from $1.50 upwards has USB on chip.

I am a solid proponent of keep it simple. I am pleased to add Nicklaus
Wirth to my shortlist of computer heroes, including Charles H. Moore,
Gordon Bell, Ed de Castro - who offer a voice of sanity in an otherwise
insane world.






On 17 February 2016 at 04:56, <skulski at pas.rochester.edu> wrote:

> 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
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160217/f452eaad/attachment-0001.html>


More information about the Oberon mailing list