User manual
DE2 User Manual
59
Figure 5.4 illustrates the setup for this demonstration.
Figure 5.4. The setup for the USB paintbrush demonstration.
5.4 USB Device
Most USB applications and products operate as USB devices, rather than USB hosts. In this
demonstration, we show how the DE2 board can operate as a USB device that can be connected to a
host computer. As indicated in the block diagram in Figure 5.5, the Nios II processor is used to
communicate with the host computer via the host port on the DE2 board’s Philips ISP1362 device.
After connecting the DE2 board to a USB port on the host computer, a software program has to be
executed on the Nios II processor to initialize the Philips ISP1362 chip. Once the software program
is successfully executed, the host computer will identify the new device in its USB device list and
ask for the associated driver; the device will be identified as a Philips PDIUSBD12 SMART
Evaluation Board. After completion of the driver installation on the host computer, the next step is
to run a software program on the host computer called ISP1362DcUsb.exe; this program
communicates with the DE2 board.
In the ISP1362DcUsb program, clicking on the Add button in the window panel of the software
causes the host computer to send a particular USB packet to the DE2 board; the packet will be
received by the Nios II processor and will increment the value of a hardware counter. The value of
the counter is displayed on one of the board’s 7-segment displays, and also on the green LEDs. If
the user clicks on the Clear button in the window panel of the software driver, the host computer
sends a different USB packet to the board, which causes the Nios II processor to clear the hardware
counter to zero.