These example programs explore some of the intricacies of the EZ-USB
controller. All of them are distributed under the GPL license and come without
any warranty of any kind, not even the implied warranty of merchantability or
fitness for a particular purpose.
All programs have been successfully compiled with AS31.
The schematic and PCB were drawn with Eagle. A free demonstration
version (but more than useable for small projects, and even available for Linux)
can be downloaded from: www.cadsoft.de.
*led2.asm
Basic test. Demonstrates the usage of the ports and how to set-up the various
registers and how to write data to a port.
*button.asm
Simple test. A led follows the state of a button.
*buttonint.asm
Slightly more complex variation. It uses the extra interrupts provided by
the chip and demonstrates how to read and write from/to a port.
*encoder.asm
A simple way to decode a rotary encoder. Interrupt driven and combines the
techniques from the previous examples.
*LCD.asm
Some routines to interface with a standard LCD-module. Not the prettiest in
their kind but it works. And yes, the 3.3V controller can interface with the
5V module without any further provisions. Although native 3.3V LCD-modules
exist.
*I2C.asm
My masterpiece ;-). It demostrates the use of the I2C interface with an external
EEProm. Also shown is how to use the twin dptrs of the EZ-USB chip. But more
importantly, the program contains a bootloader! It actually programs itself,
according to the rules stipulated by the EZ-USB lootloader protocol, into the
external EEProm. After it has run once, it disables itself leaving you with a
programmed and self-starting controller. Thus making the unit operate without
having to download the code after every power-up. This is intended for
stand-alone applications, like my own. (Note that the programming process takes
a minute or so. Please be patient.)
More information in the actual source code itself.
Beware! The schematic included is NOT public domain! It is included for
your reference only. It may only be used and distributed under a GPL license.
Furthermore, there will be glitches here and there. It works with the examples
provided and can serve as a guide on how to connect the controller in
a working fashion. Again both the schematic as the adapter board come without
any warranty of any kind, not even the implied warranty of merchantability or
fitness for a particular purpose. All of this is (a small) part of my graduation
thesis. My promotor has given me the right to make everyting public, under GPL.
I may even do so using my own name. What isn't here is propriatary. It's that
simple.
Have fun!
Greetings,
Tom De Rybel