[Oberon] Preaching against USB
skulski at pas.rochester.edu
skulski at pas.rochester.edu
Wed Feb 17 21:17:07 CET 2016
Ken:
so you are preaching against USB! Good!
> The FX2 is a 8051 based microcontroller
Yes it is. It is an "enhanced 8051" with 4 clock cycles per instruction.
The most important part of the FX2 is its USB part, which is a specialized
coprocessor which handles the USB on its own. Thus the 8051 only has to
set it up and then get out of the way. BTW, the new FX3 now uses ARM
rather than the 8051.
> You need to get hold of the C compiler - Keil uVision - at whatever cost.
In many projects the cost is zero because Keil compiler was a part of the
Cypress development kit. It was limited to 4kB code, which is enough for
many projects. If you need more code then you have to buy the full
compiler.
> You have to fight your way around the 8051 architecture.
Sure. Same with any architecture you are using. RISC5 is no exception. If
you are doing something then you need to know what you are doing.
Unfortunately.
> 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.
Sure. That's what most programmers do.
> I ended up implementing bit-banged SPI on the FX2
SPI is one of the hardware modes of the 8051 serial port. If you read that
part of the FX2 manual (which is outstanding) then you could set the port
to the SPI mode. SPI would then be handled in hardware.
I usually read manuals, so I discovered that feature and I used it.
> Did I learn anything useful about USB from my FX2 experience?
> - just never use an 8051 or FX2 ever again!
My experience was the opposite. 8051 is a great part. Very well
documented. The FX2 is exceptionally well done. The documentation was
outstanding. The Cypress support was very good. They answered all my
questions. My experience was very positive.
> 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.
Times are changing. It is called progress.
On the other hand, 8051 is a very capable chip.
I highly recommend asking Keil to send you a free CD with their free 8051
compiler, if they are still offering the CD. This compiler is limited to
2kB, so the Cypress version was better (4kB limit). However, there was one
treasure on that CD: a very comprehensive book on 8051. A glorious book.
Unfortunately, the title page was missing, so I do not know who wrote it.
The concluding chapter of that book discussed fuzzy logic implementation
on 8051. This chapter justified reading the whole book. I learned a lot!
> I am a solid proponent of keep it simple.
I am a proponent of reading the manuals... Many of them are very well
written and worth studying. You may even start liking the 8051 after you
see how well documented it is.
BTW, the Michael Pont book is about 8051. I still highly recommend reading
that book because it is in many respects as good as any Wirth book. Do not
get discouraged by the 8051. It is the clarity of thinking that matters.
Thank you,
Wojtek
More information about the Oberon
mailing list