MICRO
CONTROLLER
30
Elektor Electronics
11/2002
In the Windows Device Manager, you will see
all currently connected USB devices listed
under ‘USB Controller’.
Figure 1
shows the
entries for a USB device using the Cypress IC
with no EEPROM and a USB data spy for Bin-
Term.
Writing your own complete driver ‘from
the ground up’ is almost impossible for nor-
mal mortals. Fortunately, Cypress provides
the EZUSB driver not only as an installable
version, but also in the form of source
code.
A device driver is divided into two parts,
consisting of an INF file containing setup
information and a SYS file, which is the actual
device driver. The INF file can be edited using
a simple text editor. A C++ compiler is
necessary for generating the SYS file.
If you do not already know how to pro-
gram in C, that’s not such a big hurdle. You
will need Microsoft Visual Studio 6 with the
DDK (Driver Development Kit) addition for
Windows 2000, and naturally you will also
need the device driver source code from
Cypress.
Be sure to install Visual Studio and related
packages without modifying the installation
paths. For the device driver, you will need the
EZ-USB Development Kit, which you have
USB Driver
Programming (2)
writing your own device driver
By M. Müller and C. Ehmer
In the previous issue of
Elektor Electronics
, we described how device drivers
are used. Now it’s time to modify a Cypress device driver. You only need a
couple of programs for this, even if you have never worked with Microsoft
Visual Studios. All of the
necessary steps are
described in minute detail.
Figure 1. The Windows Device Manager list with a user-generated driver.
Required items
System requirements:
Windows 2000 or Windows XP
Internet access
Programs and tools:
MmVisual BinTerm, version 2.2.2421 or later
Borland Delphi 6 or Microsoft Visual Basic
Cypress Semiconductor EZ-USB Development Kit
Microsoft Visual C++ 6
Microsoft DDK2000 Driver Development Kit for Windows 2000
Hardware
A working Cypress AN2131SC IC (with EEPROM) connected to the USB, or a BinTerm
adapter connected to the USB. The latter circuit will be described in a coming issue of
Elektor Electronics
. A BinTerm adapter connected to the USB is highly suitable for
experimental projects, since it avoids the need to store program code in EEPROM. All
programs are transferred to the device by BinTerm at runtime.
Содержание EPROM
Страница 1: ......