
USB to SPI Interface Evaluation Board, Rev. 1.0
6
Freescale Semiconductor
The USB signal lines are buffered by 27 ohm resistors (R1 and R2) and the D+ line is pulled up to +3.3 volts via a 1.5K resistor
(R3) as per the USB specification. Ferrite inductor filters are provided on the +5 volt and Ground lines of the USB connector to
prevent EM radiation.
A Reset button and bypass capacitor is provided on board to manually reset the JW32, if necessary.
Software Description
There are three main components that comprise the Evaluation Board software system.
1) The firmware that runs on the JW32 is a compiled C and assembly language program, that is programmed into flash RAM.
2) The user interface software (GUI) that sends USB messages to the Evaluation Board, and runs under Windows 2000 or
Windows XP, is called the “SPIGen” program, which is written in Visual Basic.
3) The third piece of software is a “device driver” called
spi_usbio.sys
and it interfaces the SPIGen program I/O through the
Windows operating system to the USB port on the user’s PC. The device driver interfaces to the Visual Basic program, through
a special “wrapper” library called
usbiocom.dll
that translates the Visual Basic COM interface, into the lower level calls in the
device driver. These two pieces of software were licensed from Thesycon, a software development company in Germany.
All of the source code that is available is provided on the Installation CD in a directory called “source”.
For an explanation of the SPIGen program, the user is referred to the documentation that comes with the disk for that program.
JW32 Software Code
The software for the JW32 was written in C and HC08 assembly language using the CodeWarrior version 5.0 software
development environment.
Below is a listing of the source code modules and their descriptions:
The following files are include (header) files to support the above:
main.c
Beginning module, contains service loop.
main.asm
Generated by CodeWarrior, used for additions to main.c written in assembly language.
MCHC908JW32FC.C
Defines the 16 and 8 Bit Registers
constant.c
Random data to fill unused flash RAM
isr.c
Interrupt service routine for the timer
pll.asm
Sets up the PLL using 4.00 MHz reference frequency
spi.c
SPI read and write handlers and initialization routine
tb.c
Initializes the time base for the JW32
timer.c
Initializes the timer and PWM output (not used)
USB_descriptor.asm
Defines the USB information such as VID, PID, etc.
USB_driver.c
Handles USB setup, decode and interrupt service
utilities.c
Misc. routines for delay and debug
application.h
Defines some outputs and some useful macros
derivative.h
Generated by CodeWarrior to define the MCU used
derivative.inc
Generated by CodeWarrior for COP