8 usb interface – Digilent 410-295P-KIT User Manual
Page 15
ChipKIT Pro MX4 Reference Manual
Copyright Digilent, Inc. All rights reserved.
Other product and company names mentioned may be trademarks of their respective owners.
Page 15 of 37
8 USB Interface
The PIC32MX460 microcontroller contains a USB 2.0 Compliant, Full Speed Device and On-The-Go (OTG) controller.
This controller provides the following features:
• USB full speed host and device support
• Low speed host support
• USB OTG support
• Endpoint buffering anywhere in system RAM
• Integrated DMA to access system RAM and Flash memory.
The USB controller uses a phased lock loop, PLL, to generate the necessary USB clock frequency from the external
primary oscillator input frequency. By default, this PLL is disabled. In order to use the USB controller, it is necessary
to enable the USB PLL, and set the input divider to the correct value to generate a valid USB clock. The input to the
USB PLL must be 4Mhz. The ChipKIT Pro MX4 provides an 8Mhz clock to the PIC32 microcontroller, so a USB PLL
input divider value of 2 must be used. These parameters are set in the PIC32 microcontroller configuration
registers using the #pragma config statement. The following statements must be used to configure the PIC32
microcontroller for use of the USB controller:
#pragma config UPLLEN = ON
#pragma config UPLLIDIV = DIV_2
When using the chipKIT MPIDE development environment, these will have been set by the boot loader, so no
action is needed.
When operating as a USB device, the ChipKIT Pro MX4 can be operated as a self-powered device or as a bus
powered device. To operate as a self-powered device, an external power supply should be connected to one of
the external power connectors (J13, J14 or J18) and a shorting block placed on the “EXT” position of J12. To
operate as a USB bus powered device, the shorting block should be placed in the USB Device position, “USB”, on
J12.
Note that when operating as a bus powered device, the ChipKIT Pro MX4 and all devices connected to it are limited
to using no more than 500mA of current.
Connector J15, on the bottom of the board in the lower right corner is the Device/OTG connector. This is a
standard USB micro-AB connector. Connect a cable with a micro-A plug (optionally available from Digilent) from
this connector to an available USB port on a PC or USB hub for device operation.
When operating as a USB host, the ChipKIT Pro MX4 must be externally powered. Connect a regulated 5V power
supply to one of the external power connectors (J13, J14, or J18) and ensure that the shorting block is in the
center, “EXT” position of J12. The power supply used must be a regulated 5V supply. The ChipKIT Pro MX4 board
provides power to the attached USB device when operating as a host, and the USB specification requires the use of
a 5V power supply. NOTE: Providing a voltage greater than 5V can damage the ChipKIT Pro MX4 board and/or the
USB device being used.
Connector J17, on the top of the board in the lower right corner is the USB host connector. This is a standard USB
type A receptacle. USB devices may be connected either directly or through a standard USB cable.