Digilent 32MX7 User Manual

CCeerreebboott 3322MMXX77™
RReeffeerreennccee MMaannuuaal
Cerebot 32MX7 Circuit Diagram
Revision: October 20, 2011 Note: This document applies to REV C of the board.
™ BBooaarrdd
l
Overview
The Cerebot 32MX7 board is a useful tool for embedded control and network communications projects for both students and hobbyists.
Its versatile design and programmable microcontroller lets you access numerous peripheral devices and program the board for multiple uses. The board has many I/O connectors and power supply options. It’s network and communications features include 10/100 Ethernet interface, Full Speed USB 2.0 OTG interface, dual CAN network interfaces, dual I2C buses, up to three UART ports and up to three SPI ports.
The Cerebot 32MX7 works with the Microchip MPLAB development environment and provides built in programming and debugging support within MPLAB.
The Cerebot 32MX7 provides a number of connections for peripheral devices. It has six connectors for attaching Digilent Pmod™ peripheral modules. Digilent Pmod peripheral modules include H-bridges, analog-to-digital and digital-to-analog converters, a speaker amplifier, switches, buttons, LEDs, as well as converters for easy connection to RS232, screw terminals, BNC jacks, servo motors, and more.
Features include:
a PIC32MX795F512L microcontroller
support for programming and
debugging within the Microchip MPLAB development environment
six Pmod connectors for Digilent peripheral module boards
10/100 Ethernet
USB 2.0 Device, Host, and OTG
support
two CAN network interfaces
1300 Henley Court | Pullman, WA 99163
(509) 334 6306 Voice and Fax
three push buttons
four LEDs
multiple power supply options, including
USB powered
ESD protection and short circuit protection for all I/O pins.
Doc: 502-186 page 1 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Cerebot 32MX7 Reference Manual
Features of the PIC32MX795F512L include:
512KB internal program flash memory
128KB internal SRAM memory
USB 2.0 compliant full-speed On-The-
Go (OTG) controller with dedicated DMA channel
10/100 Ethernet controller
two CAN network controllers
up to four serial peripheral interfaces
(SPI)
up to six UART serial interfaces
up to four I2C serial interfaces
five 16-bit timer/counters
five timer capture inputs
five compare/PWM outputs
sixteen 10-bit analog inputs
two analog comparators
For more information on the PIC32MX795F512L microcontroller, refer to the PIC32MX5XX/6XX/7XX Family Data Sheet and the PIC32 Family Reference Manual available at www.microchip.com.
Functional Description
The Cerebot 32MX7 is designed for embedded control and network communications applications as well as general microprocessor experimentation. Firmware suitable for many applications can be downloaded to the Cerebot 32MX7’s programmable PIC32 microcontroller.
The board has a number of input/output connection options, and is specially designed to work with the Digilent line of Pmod peripheral modules with various input and output functions. For more information, see
www.digilentinc.com. In addition to the Pmod
connectors, the board provides three push buttons and four LEDs for user i/o, as well as providing connections for two I2C busses. A serial EEPROM is provided on one of the I2C busses.
The Cerebot 32MX7 can be used with the Microchip MPLAB development environment. In-system-programming and debug of firmware
www.digilentinc.com page 2 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
running on the PIC32MX795 microcontroller is supported using an on-board program/debug circuit licensed from Microchip.
The Cerebot 32MX7 features a flexible power supply system with a number of options for powering the board as well as powering peripheral devices connected to the board. It can be USB powered via either the debug USB port or the USB device port, or it can be powered from an external power supply or batteries.
Programming and In-System Debugging Using the MPLAB® IDE
The Cerebot 32MX7 board is intended to be used with the Microchip MPLAB® IDE for firmware development, programming and in­system debugging using a circuit licensed from Microchip. MPLAB version 8.63 or later is required for use of the on-board program/debug circuit. The licensed debugger is accessed via USB, using connector J15. This connector is a micro-USB connector on the lower left side of the board, near the power switch. The provided USB cable should be connected from J15 to a USB port on the development PC for access to the board.
When creating a new project, use the Configure.Select Device menu to specify the PIC32 device in use. Ensure that the device is set to PIC32MX795F512L.
To use the on-board program/debug circuit it must be selected as the debugger or programmer within the MPLAB IDE. Use the
Debugger.Select Tool menu, or the Programmer.Select Tool menu, and select “Licensed Debugger” as the programmer or
debugger.
The in-system programming/debugging interface uses two pins on the PIC32 microcontroller. The PIC32 devices support two alternate pin pairs for this interface: PGC1/PGD1 or PGC2/PGD2. PIC32 devices use PGC2/PGD2 by default. Due to conflicting uses of the microcontroller pins, the Cerebot
Cerebot 32MX7 Reference Manual
32MX7 is designed to use PGC1/PGD1. Because of this, it is necessary to select the use of PGC1/PGD1 for the debugging interface. This is done using configuration variables set using the
#pragma config
statement. The following statement must be used to configure the microcontroller for use with the on-board licensed debugger circuit:
#pragma config ICESEL = ICS_PGx1
The MPLAB IDE may report an error indicating that the device is not configured for debugging until a program containing this statement has been programmed into the board.
Board Power Supply
Switch SW1, in the lower left corner of the board is the power switch. Place this switch in the ON position to turn on board power and in the OFF position to turn off board power.
There are three power options for main power to the board: USB powered from the debug USB connector, USB powered from the USB device connector, or external, non-USB powered. Jumper block J16, (above the Ethernet connector, J11) is used to select the main power source. To select USB powered from the debug connector, place the shorting block in the DBG position. To select USB power from the USB device connector, place the shorting block in the USB position. This option is used when the board is being used to implement a bus powered USB device. To power the board from an external power supply, place the shorting block in the EXT position. The board comes from the factor jumpered for USB power from the debug USB connector.
When powering the board from an external power supply, there are two power supply connectors that can be used: J17 and J18.
The barrel connector, J17, is used to power the board from a “wall wart” style power supply. This type of power supply is available from many sources. Digilent has an optional power
Supply, that can be used with connector J17. Connector J17 is a 2.5mm x 5.5mm coaxial connector wired with the center terminal as the positive voltage.
Connector J18 is a screw terminal connector for an alternative power supply connection for use with battery packs, bench supplies or other power sources where use of a hard wired power supply is desirable.
The Cerebot 32MX7 is rated for external power from 3.6 to 5.5 volts DC. Using a voltage outside this range will damage the board and connected devices. For most purposes, when using external power, a regulated 5V supply should be used. When operating the board from an external supply with a voltage less than 5V, some features of the board won’t work correctly.
When the Cerebot 32MX7 is operating as a USB host, an external power supply connected to either J17 or J18 must be used to power the board. In addition to powering the logic on the Cerebot 32MX7 board, this supply provides the USB bus voltage supplied to any connected USB device and must be a regulated 5V with at least 500mA current capability to meet the USB specifications.
The CAN bus operates at 5V, and therefore the transceivers for the two CAN interfaces require 5V to operate correctly and within the CAN specification. When using the CAN network interfaces, the board should be operated from a 5V supply if using an external power supply.
Connectors J17, and J18 are wired in parallel and connect to the “External Power” position (center position) on the Power Select jumper block J16. A shorting block should be placed on the “EXT” position of J16 when using this option for board power. Only one of the external power connectors should be used at a time. If multiple power supplies are connected simultaneously, damage to the board or the power supplies may occur.
supply available, the 5V Switching Power
www.digilentinc.com page 3 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Cerebot 32MX7 Reference Manual
The power supply selected by the shorting block on J16 will appear on the input power supply bus, labeled VIN in the schematic. This voltage is regulated to 3.3V to power the debug circuit by IC11, a Microchip MCP1801 Low Dropout voltage regulator. This regulator is turned on and the debug circuit is powered whenever the power switch is in the on position.
The USB specification requires that USB devices not draw more than 100mA of current until they have enumerated on the USB bus and informed the host that they want to consume more current. To meet this specification, the debug circuit turns on main board power by driving the PWR_ON signal high after successfully enumerating on the USB bus. The bus labeled on the schematic as VCC5V0 is switched on when this occurs. The VCC5V0 bus powers the input to the main board voltage regulator, the input voltage to the USB bus voltage load switch used when using the board as a USB host, the power supply voltage for the CAN transceivers, and the 5V0 side of the power select jumpers for the Pmod connectors. The voltage on the VCC5V0 bus will be 5V when the board is being operated from USB power or an external regulated 5V supply. If a different external supply voltage is used, that voltage will appear on the VCC5V0 bus.
Note: The signal labeled DBG5V0 on the schematic comes from the debug USB connector. If the debug USB connector is not connected to a live USB port, this voltage will not be present and the debug circuit is not involved in turning on board power. In this case, the board power is turned on when the power switch is placed in the ON position.
The PIC32 microcontroller and on-board I/O devices operate at a supply voltage of 3.3V provided by the VCC3V3 bus. The regulated voltage on this bus is provided by a Microchip MCP1726 Low Dropout voltage regulator, IC10. This regulator is capable of providing a maximum of 1A of current. The PIC32 microcontroller will use approximately 85mA when running at 80MHz. The SMSC LAN8720
Ethernet PHY consumes approximately 45mA when operating at 100Mbps. The Microchip MCP2551 CAN transceivers can draw up to 75mA each when operating the CAN busses. The other circuitry on the board will draw 10-20 mA. The remaining current is available to provide power to attached Pmods and I2C devices. The voltage regulator is on the bottom of the board, approximately under the “3” in the Cerebot 32MX7 logo, and will get warm when the amount of current being used is close to its limit.
The Cerebot 32MX7 can provide power to any peripheral modules attached to the Pmod connectors, JA-JF, and to I2C devices powered from the I2C daisy chain connectors, J7 and J8. Each Pmod connector provides power pins that can be powered from either the switched main power bus, VCC5V0, or regulated voltage, VCC3V3, by setting the voltage jumper block to the desired position. The I2C power connectors only provide the regulated voltage, VCC3V3.
USB Interface
The PIC32MX795 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 Cerebot 32MX7 provides an 8Mhz clock to the PIC32
www.digilentinc.com page 4 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Cerebot 32MX7 Reference Manual
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
config
statement. The following statements
#pragma
must be used to configure the PIC32 microcontroller for use of the USB controller:
#pragma config UPLLEN = ON #pragma config UPLLIDIV = DIV_2
When operating as a USB device, the Cerebot 32MX7 can be used 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 (J17 or J18) and a shorting block placed on the center, “EXT” position of J16. The external power supply must be a regulated 5V supply. To operate as a bus powered device, the shorting block should be placed in the USB Device position, “USB”, on J16.
Connector J19, 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 Cerebot 32MX7 must be externally powered. Connect a regulated 5V power supply to one of the external power connectors (J17, or J18) and ensure that the shorting block is in the center, “EXT” position of J16. The power supply used must be a regulated 5V supply. The Cerebot 32MX7 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 Cerebot 32MX7 board and/or the USB device being used.
Jumper JP10 is used to route power to the host connector being used. Place the shorting block in the “A” position when using the
Place the shorting block in the “MICRO” position for use with the USB micro-AB (OTG) connector, J19.
When operating as a USB host, the PIC32MX795 microcontroller controls application of power to the connected device via the VBUSON control pin (labeled P32_VBUSON in the schematic). Bus power is applied to the device by driving the VBUSON pin high. Power is removed from the device by driving the VBUSON pin low. The VBUSON pin is accessed via bit 3 of the U1OTGCON register.
The VBUSON pin drives the enable input of a TPS2051B Current-Limited Power Distribution Switch to control the application of USB power to the host connector. This switch has over­current detection capability and provides an over-current fault indication by pulling the signal P32_USBOC low. The over-current output pin can be monitored via the INT1/RE8 pin on the PIC32MX795 microcontroller. Details about the operation of the TPS2051B can be obtained from the data sheet available at the Texas Instruments web site.
There are reference designs available on the Microchip web site demonstrating both device and host operation of PIC32 microcontrollers. These reference designs are suitable to use for developing USB firmware for the Cerebot 32MX7 board.
Ethernet Interface
The Cerebot 32MX7 provides the ability to interface with 10Mbps or 100Mbps Ethernet networks. The PIC32MX795 microcontroller contains a 10/100 Ethernet Medium Access Controller (MAC). External to the microcontroller, the Cerebot 32MX7 board provides an SMSC LAN8720 Ethernet Physical Layer Transceiver (PHY). Together, the MAC and PHY in combination with an appropriate coupling transformer and RJ45 jack provide a standard 10/100 Ethernet interface.
standard USB type A (host) Connector, J20.
www.digilentinc.com page 5 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Cerebot 32MX7 Reference Manual
The RJ45 connector J11, provides the physical connection to an Ethernet network using a standard Ethernet cable.
All devices on an Ethernet network must have a unique address. This address is used to direct packets on the network to a specific device and to identify the device that originated a packet. An Ethernet MAC uses a 48-bit address value, commonly called the “MAC Address”. These address values are globally unique to ensure that no two devices on a network can have conflicting addresses. MAC addresses are assigned by the IEEE. The address to use with the Cerebot 32MX7 is printed on a sticker attached to the bottom of the board. The address is a twelve digit hexadecimal number of the form: 00183Exxxxxx, where xxxxxx represents six hexadecimal digits. This value is used to initialize the Ethernet Controller MAC Station Address registers in the Ethernet controller of the PIC32MX795 microcontroller.
In order to connect to and operate with an Ethernet network, the PIC32 microcontroller must be running network protocol stack firmware. Normally, the TCP/IP (Transmission Control Protocol/Internet Protocol) network protocol is used and “TCP/IP Stack” software must be used. The Microchip Applications Library, available for download from the Microchip web site provides full protocol stack support compatible with the PIC32MX795 MAC and the LAN8720 PHY. Microchip also provides numerous example programs illustrating the use of their network protocol stack for various applications.
When not using the Microchip network protocol stack, refer to the manufacturer documentation for the PIC32MX795 and LAN8720, plus network protocol documentation, for operation of the Ethernet interface.
The PIC32MX795 microcontroller provides two alternate sets of pins that can be used to connect the MAC to the external PHY. It also provides two alternate standard MAC/PHY interface signaling conventions. The Cerebot
the alternate) pins, and to use the RMII (not the MII) interface signaling convention. These options are selected using the configuration variables in the PIC32 microcontroller and are specified using the
#pragma config
statement. To enable the Ethernet controller in the correct configuration, the following statements must appear in the main program module:
#pragma config FETHIO=ON #pragma config FMIIEN=OFF
The LAN8720 PHY has a reset signal, labeled NRST in the schematic, that can be used to reset the PHY. This signal is connected to the INT2/RE9 pin on the PIC32 microcontroller. The NRST signal is active low. Configure the microcontroller pin as an output and drive it low to reset the PHY, or drive it high to allow the PHY to come out of reset and begin operation. The NRST signal is pulled low on the board, so that the PHY is held in reset by default. To allow the PHY to operate, this pin must be driven high. This reset operation is not part of the Microchip network protocol stack, and so driving NRST high must be done before initializing the Microchip network stack.
CAN Interfaces
The Controller Area Network (CAN) standard is a control networking standard originally developed for use in automobile systems, but has since become a standard used in various industrial control and building automation networking applications as well.
The PIC32MX795 microcontroller contains two independent CAN network controllers. These CAN controllers in combination with two Microchip MCP2551 CAN transceivers allow the Cerebot 32MX7 board to operate on up to two independent CAN networks. Refer to the PIC32MX7XX data sheet and the PIC32 Family Reference Manual, plus CAN network documentation for information on operation of the CAN controllers and CAN networking in general.
32MX7 is designed to use the standard (not
www.digilentinc.com page 6 of 19
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Loading...
+ 13 hidden pages