Digilent I/O Explorer Podręcznik referencyjny - Strona 8

Przeglądaj online lub pobierz pdf Podręcznik referencyjny dla Systemy wejścia/wyjścia Digilent I/O Explorer. Digilent I/O Explorer 17 stron.

I/O Explorer™ USB Reference Manual
2
10 Private I
C Bus
When the I/O Explorer is operating using user developed firmware in the primary microcontroller, there is a
private I2C bus controlled by the primary microcontroller that is used to talk to two peripheral devices: The
secondary microcontroller, and the Microchip MCP4728 Digital to Analog (D/A) converter.
When running the factory firmware in the secondary microcontroller, this microcontroller appears as an I2C slave
device on the private bus. The command protocol for this interface is described in the document: Digilent I/O
Explorer Slave Device Communications Protocol available on the Digilent web site. This document is contained in
the reference design example that illustrates the used of the command protocol to talk to the secondary
microcontroller. The primary microcontroller can send commands to the secondary microcontroller for access to
many of the on-board I/O devices, such as the switches, push buttons, LEDs, etc.
In addition to the secondary microcontroller, there is also a Microchip MCP4728, four channel, D/A converter on
the private I2C bus. When using the factory firmware in the primary microcontroller, this D/A converter provides
the analog outputs accessible through the DAIO API functions. When running user defined firmware on the
primary microcontroller, this device is directly accessible to the user firmware.
The AT90USB646 microcontroller has a single TWI controller. This TWI controller is used to provide the public
DTWI (I2C) interface, and is not used for the private I2C bus. The private I2C bus is controlled using a 'bit-banged'
software I2C implementation. Digilent provides a reference design example as part of the I/O Explorer support
documentation to illustrate this 'bit-banged' I2C implementation.
11 Developing Custom Firmware for the I/O Explorer
Although the I/O Explorer is primarily intended to function as a dedicated USB peripheral device to provide I/O
expansion capability for PC application programs, it can also be used as a microcontroller development platform to
run user developed custom firmware.
Connectors are provided for in-system-programming and for debugging firmware running on each microcontroller.
Connectors JP1 and J3 are the programming and debugging connectors respectively for the primary
microcontroller, IC1, an Atmel AT90USB646. Connectors JP2 and J6 are the programming and debugging
connectors respectively for the secondary microcontroller, IC2, an Atmel ATmega165P.
The programming connectors are intended for use with a Digilent JTAG/SPI programming cable, such as the
Digilent JTAG-USB Full Speed Module, although other programmers can be used with a suitable connector adapter.
The debugging connectors are suitable for use with an Atmel JTAG ICE mk II or an Atmel AVR Dragon for in-system
programming and debugging.
In order to restore the I/O Explorer to its original functionality after having programmed it with custom firmware,
it is necessary to re-program the original firmware into whichever of the two microcontrollers have been
programmed with custom firmware. Digilent makes the factory firmware images available as part of the support
documents for the I/O Explorer on the Digilent web site. There are two firmware image files for each
microcontroller: one to restore the program flash memory, and one to restore the EEPROM. Both firmware images
must be programmed into the microcontroller.
The filenames for the firmware image files for the primary microcontroller are of the form:
AvrFW_29_000003F2_XXXX.hex and AvrFw_29_000003F2_XXXX.eep, where "XXXX" represents the firmware
version number. The .hex file is the image for the program flash, and the .eep file is the image for the EEPROM.
Copyright Digilent, Inc. All rights reserved.
Page 8 of 16
Other product and company names mentioned may be trademarks of their respective owners.