DE3 User Manual
65
5.2
USB Device
Most USB applications and products operate as USB devices, rather than USB hosts. This
demonstration will show how the DE3 board can operate as a USB device, and be connected to a
host computer. In this demonstration, the USB port 1 (mini-AB port) on DE3 is configured as a
device port to connect with a host computer. The NIOS II processor communicates with host
computer through USB Bulk Transfer with user-defined command sets. The USB device driver is
implemented in NIOS C code. From the host computer side, a test program is used to communicate
with DE3. The test program can configure LED status and poll button status through the USB
connection.
The hardware system block diagram of this demonstration is the same as the USB Host
.
Figure 5.7
shows the NIOS II software stack of this demonstration. NIOS PIO block is provided from NIOS II
System. The block provides basic I/O functions IORD and IOWR to access hardware directly. The
function prototypes are defined in the header file <io.h>. The ISP 1761 HAL block implements
functions to access internal control/data registers of the USB chip ISP 1761. USB Peripheral
controller block implements control functions for ISP1761 Peripheral Controller. USB protocol
block implements USB protocol. USB Bulk Driver implements a device driver to provide two bulk
end-points, namely Bulk-In and Bulk-Out. Main program is implemented to communicate with a
host computer. It calls bulk-read function to receive commands from the host computer, and calls
bulk-write function to return data to the host computer.
NIOS II PIO
ISP 1761 HAL
USB Peripheral Controller
USB Protocol
USB Bulk Driver
Main
Figure 5.7. Software Stack of the USB-Device Demonstration
In the host computer, a test program named DE3_UsbControl.exe is used to communicate with DE3,
as shown in
Figure 5.8
. At the first time when the host when computer connected to DE3 USB
device port, a dialog will pop up to request a USB driver to be installed. The driver is available in
the current demo folder, named terasic_usb.sys and terasic_usb.inf. After the driver is installed,
users can launch the test program to communicate with the DE3.
Summary of Contents for Altera DE3
Page 1: ...Altera DE3 Board ...
Page 67: ...DE3 User Manual 64 Figure 5 5 Plug USB Devices into DE3 Figure 5 6 Display Device Information ...
Page 75: ...DE3 User Manual 72 Figure 5 14 Display SD Card Information for the SD Card Demonstration ...
Page 79: ...DE3 User Manual 76 Figure 5 19 Parameter Settings in DDR2 Controller ...
Page 114: ...DE3 User Manual 111 Figure D 5 The reported message of the invalid I O pins ...