chipKITTM DP32TM Reference Manual Revision: July 10, 2013 Note: This document applies to REV B of the board. 1300 NE Henley Court, Suite 3 Pullman, WA 99163 (509) 334 6306 Voice | (509) 334 6300 Fax Overview The chipKIT DP32 is a chipKIT/MPIDE compatible prototyping and project development board from Digilent. It combines the power of the Microchip(R) PIC32MX250F128B with a wire wrap prototyping area, provision for an EEPROM non-volatile memory, and analog temperature sensor, a potentiometer, buttons and LEDs in a single board. The mounting hole footprint on the board is designed to fit in the Hammond 1591XXSSBK project box. The DP32 takes advantage of the powerful PIC32MX250F128B microcontroller. This microcontroller features a 32-bit MIPS processor core running at 40Mhz, 128K of flash program memory and 32K of SRAM data memory. It is suitable for building projects directly on the board utilizing the provided prototyping area, but it can also be used as a device programmer to program the microcontrollers for inclusion in custom built projects. The DP32 can be programmed using the Multi-Platform Integrated Development Environment, MPIDE, an environment based on the open source Arduino IDE modified to support the PIC32 microcontroller. The board provides everything needed to start developing embedded applications using the MPIDE. The DP32 is also fully compatible with the advanced Microchip MPLAB(R) IDE. To develop embedded applications using MPLAB, a separate device programmer/debugger, such as the Digilent chipKIT PGM or the Microchip PICkit3TM is required. Features Include: * * * * * * * * * * Microchip(R) PIC32MX250F128B microcontroller (40/50 MHz 32-bit MIPS, 128K Flash, 32K SRAM) 5 - 12 Volt recommended operating voltage 19 available I/O pins Up to 9 analog inputs 1 Potentiometer connected to an analog input Four user LEDs Two user push button Wirewrap prototype area Provision for an SPI EEPROM and an analog temperature sensor Mounting Hole compatible with Hammond 1591XXSSBK project box Doc: 502-280 page 1 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 Functional Description The PIC32MX250F12B microcontroller features a 32-bit MIPS processor core capable of running at up to 50 MHz. The DP32 operates the microcontroller at 40Mhz by default.The microcontroller features 128 KB of flash program memory and 32 KB of SRAM data memory. Programming the DP32 can be done using the Multi-Platform Integrated Development Environment (MPIDE) or with the advanced Microchip MPLAB(R) IDE with the addition of a PICKit3 or chipKIT PGM in-system programmer/debugger. The DP32 provides 19 I/O pins as located on two through-hole header footprints. Some pins share functions with the onboard circuits such as the on-board 8 MHz oscillator or USB data lines (see the schematic for details). If these peripherals are needed in the design then the microcontroller can be reconfigured to allow these pins can be used for other purposes. Nine of the digital I/O pins are shared with the analog inputs and can be used as analog input pins. The PIC32MX250F128B microcontroller supports peripheral functions such as UART, SPI, and I2C, as well as pulse-modulated outputs. To use the peripheral functions the PIC32MX2xx family of microcontrollers features a mappable I/O system called peripheral pin select (PPS), which allows select peripheral functionality to be mapped to a multiple pins on the device. The default DP32 board support files provide a specific mapping of peripheral functions to microcontroller pins. This default pinout can be over-ridden by the user's sketch if a different mapping is desired. Additional features of the board include an 8-pin DIP header labeled IC4 that is mapped for use with a customer supplied Microchip 25LC256 EEPROM. The SPI bus and power signals are mapped to the correct pins so that the user can solder in an 8-pin dip socket or directly solder the IC into the holes. Similarly the IC3 header on the board is mapped for a customer supplied Microchip MCP9701A analog temperature sensor. chipKIT DP32 Hardware Overview The DP32 has the following hardware features: 1. J2 - USB Connector for USB Serial Converter This connects to a USB port on the PC to provide the communications port for the MPIDE to talk to the DP32 board. This can also be used to power the DP32 when connected to the PC. 2. JP6 - Microchip Debug Tool Connector This connector is used to connect Microchip and Digilent programmer/debugger tools, such as the PICkitTM3 or Digilent chipKIT PGM. This allows the DP32 board to be used as a traditional microcontroller development board using the Microchip MPLAB(R) IDE. 3. J6 - External Power Screw Terminal Connectors This screw terminal connector may be used to provide up to 15VDC to the DP32. The polarity of the terminals is marked on the silkscreen and must be followed to avoid damaging the board. 4. JP7 - Power Select Jumper This jumper may be set to either power the DP32 via USB (J2), or Screw Terminal (J6). To power via USB, set the jumper to short the pins with VIN and VUSB directly to their right. To power via external supply, short the two pins nearest the screw terminal. www.digilentinc.com page 2 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 5. JP1 - USBID Jumper for use with USB OTG This jumper allows Digital I/O pin 0 (RB5) to be disconnected from the USBID line on the USB Port. If JP1 is shorted, pin 0 may not operate as expected. Some users may wish to keep JP1 shorted for USB operations. 6. JP2 and JP3 - D+ and D- USB Signals These jumpers are shipped unloaded. The trace between the two terminals may be cut if USB functionality is required to be permanently disabled. Once the traces have been cut, it is possible to solder jumper pins in these locations to re-enable the D+ and D- signals as desired. 7. IC4 - SPI EEPROM Device (Microchip 25LC256) Loading Point This 8-pin DIP footprint is designed so that a SPI controlled EEPROM device could be added at a later time if desired. It is intended that an 8-pin DIP socket or a Microchip 25LC256 device would be soldered into this location. 8. VR1 - Analog Potentiometer An analog potentiometer connected to chipKIT analog pin A2. When rotated fully counter clockwise, 0V is read on the pin. When rotated fully clockwise, 3.3V is read on the pin. 9. User LEDs Four LEDs connected to digital signal pins 11, 12, 13, and 14. 10. Reset Button When pressed, the microcontroller resets the currently loaded sketch. If Button 2 (BTN2/PGM) is held down while pressing the reset button, the microcontroller will start from the boot loader, allowing a new sketch to be loaded. 11. BTN2/PGM and BTN3 User Buttons These user buttons are connected to digital signal pins 1 and 17. They produce a logic high signal when depressed, and a logic low signal when released. 12. JP4/JP5 - Pullup/Pulldown jumpers These jumpers are used to add pullups or pulldowns to the digital signal pins 2 and 3. Pullups are necessary when utilizing I2C on these two pins. These two jumpers can be used as settable logic states either pulled high or pulled low depending on the jumper settings. In addition, if no pullups or pulldowns are desired, the jumper may be safely removed completely, allowing the pins to be used for other input/output purposes. 13. IC1 PIC32 Microcontroller The PIC32MX250F128B microcontroller is the main processor for the board. 14. J4 - Digital and Analog I/O Connector #1 The set of Digital I/Os with chipKIT numbers 0 through 8 and Analog pins A0-A2. See table 1 in appendix A for more details. 15. IC3 - Analog Temperature Sensor (Microchip MCP9701A) Loading Point This 3-pin footprint is intended for an analog temperature sensor to be loaded by the user. It was designed with the Microchip MCP9701A Linear Active Thermistor in mind. The pin one www.digilentinc.com page 3 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 (square pin) is for VCC3V3 of the device, pin two (center pin) is for the VOUT pin of the device, and pin three is for the ground pin. 16. J3 - Digital and Analog I/O Connector #2 The set of Digital I/Os with chipKIT numbers 9 through 18 and Analog pins A3-A8. See table 1 in appendix A for more details. 17. Prototyping Area This area may be used to prototype any desired hardware designs using standard wire wrapping methods. Programming the chipKIT DP32 MPIDE Development Tool The DP32 uses the PIC32MX250F128B onboard USB peripheral to program the microcontroller with the MPIDE environment. This requires a driver to be installed to accommodate this programing solution. The driver file is called Stk500v2.inf and is available in the drivers folder in the MPIDE distribution. Once the driver is installed and the computer has recognized the board, it is ready to be programmed. The board has two modes of operation. The first is the bootloader mode, to enter this mode you must press and hold down BTN2/PGM button while pressing the RESET button then release both to set the board into program mode. In program mode LD1 will flash to show you that the bootloader is running and the board is ready to be programmed. Once the board is programmed it will be reset and will execute the programmed sketch. If there is a sketch loaded on the board and you cycle power to the board, it will automatically reenter sketch mode. To exit sketch mode you must press and hold the BTN2/PGM and press RESET button then release both buttons. Since the board resets between program mode and sketch mode the serial port will disconnect and then reconnect. The MPIDE serial monitor will not work unless there is a delay of at least 5 seconds in the user sketch before it begins to send data to the computer. To ensure the serial monitor is ready it is recommended that users watch the device manager or similar program for your OS after the reset to watch for the reconnection of the serial port before attempting to open the Serial Monitor in MPIDE. The delay is required for proper operation of the serial port so that the board can disconnect and reconnect to the computer before the DP32 begins sending data out while the OS is not listing. This is a byproduct of the embedded USB controller solution on the DP32. Microchip MPLAB(R) IDE Development Tool Compatibility In addition to being compatible with the MPIDE, the DP32 board can be used as a more traditional microcontroller development board using Microchip Development Tools. The unloaded connector JP6 on the right side of the board is used to connect to a Microchip development tool, such as the PICkit3TM or the Digilent chipKIT PGM. The holes for JP6 are staggered so that a standard 100-mil spaced 6-pin header can be press fit to the board without the need to solder it in place. Any Microchip development tool that supports the PIC32MX2xx microcontroller family and can be used provided is uses the same 6-pin interface as the PICkit3. www.digilentinc.com page 4 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 Typically, a right-angle male connector is used in JP6 so that a PICkit3 can be attached coplanar with the DP32 board. The connector can be loaded from the top, or it can be loaded from the bottom. In either case the programmer will be face down (buttons or LEDs not visible). The Microchip MPLAB(R) IDE or the MPLAB(R) X IDE can be used to program and debug code running on the DP32 board. These tools can be downloaded from the Microchip website. Using the Microchip development tools to program the DP32 board will cause the boot loader to be erased. To use the board with the MPIDE again, it is necessary to program the boot loader back onto the board. The bootloader image can be downloaded from the DP32 product page on the Digilent website. chipKIT DP32 Jumper Settings JP1 USBID Connect (USB OTG) Loaded: USBID is connected to Digital I/O pin 0 (RB5) and is usable by the microcontroller. Unloaded: Pin 0 is unconnected to USBID and freely usable. JP2 JP3 USB Data+ USB Data- For most users, these traces should be left uncut. Cutting the trace will remove the ability to program the microcontroller from the USB Port. Users may optionally add jumper pins and a shorting block to restore the original functionality of the DP32 if the traces have been cut. JP4/JP5 Default configuration is with the shorting blocks loaded on pins 1 and 2, which results in pullup configuration. Shorting pins 2 and 3 results in pulldown operation. Users may choose to remove shorting blocks entirely if no pullup/pulldown settings are desired. JP7 Power Select Jumper Default power select is with the shorting block connecting the two pins directly next to VBUS, providing power from the USB connector. If external power is desired, connect the two pins nearest the external power screw terminal labeled VIN. Power Supply The DP32 is designed to be powered either via USB or from an external power supply. Only one supply should be selected at a time. The DP32 has a single voltage regulator which regulates either 5V from USB to 3.3V, or a maximum of 15V external voltage to 3.3V. The 3.3V regulator is a Microchip MCP1703. This regulator is rated for a maximum output current of 250mA. The absolute maximum input voltage for the MCP1703 is 16V. This regulator has internal short circuit protection and thermal protection. It will get noticeably warm when the current consumed by the VCC3V3 bus is close to the 250mA maximum. www.digilentinc.com page 5 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 Due to the internal USB circuit on the PIC32MX250F128B requiring 5VDC to operate, the USB hardware is only operational when powering off of USB. Do not attempt to power the USB circuitry with the external power screw terminal, unless it is a regulated 5V external power supply. 5V Compatibility The PIC32 microcontroller operates at 3.3V. There are two issues to consider when dealing with 5V compatibility for 3.3V logic. The first is protection of 3.3V inputs from damage caused by 5V signals. The second is whether the 3.3V output is high enough to be recognized as a logic high value by a 5V input. Only MIPDE pin numbers 0 - 3 on the PIC32 microcontroller are 5V tolerant all other pins are 3.3V tolerant only. To provide 5V tolerance on those pins, you will have to add clamping diodes and current limiting resistors to those pins. Please check the table 1 in appendix A to confirm 5V tolerant pins. The minimum high-voltage output of the PIC32 microcontroller is rated at 2.4V when sourcing 12mA of current. When driving a high impedance input (typical of CMOS logic) the output high voltage will typically be close to 3.3V. Some 5V devices will recognize this voltage as a logic high input, and some will not you will have to read the datasheet for the 5V parts you are using to ensure that 3.3V will satisfy the logic high conditions for the part. Many 5V logic devices will work reliably with 3.3V inputs. Input/Output Connections The DP32 board provides all 19 I/O pins of the PIC32MX250F128B microcontroller to through-hole points on the PCB. The PIC32 microcontroller can source or sink a maximum of 7mA on all digital I/O pins. The maximum current that can be sourced or sunk across all I/O pins simultaneously is +/- 200mA. For more detailed specifications, refer to the PIC32MX1XX/2XX Data Sheet available from the Microchip web site. The DP32 uses logical pin numbers to identify digital I/O pins. Pins 0 through 8 are located on J4, counting up from the square pad of J4. Pins 9 through 18 are located on J3, counting up from the square pad. In addition, several of these I/O pins share functionality with other devices on the board see table 1 in appendix A for more information. Pins 15 and 16 are shared with the crystal for the internal oscillator, and are not typically usable. Pin 6 is shared with the Analog Temperature Sensor. Pin 8 is shared with the onboard Potentiometer. Pins 4 and 5 are shared with the USB Data+ and Data- signals. Pin 0 is shared with the USBID function, but removing jumper 1 clears this conflict. Pins 9, 18, 7, and 10 are used for the SPI EEPROM device if it is loaded, on its Chip Select, Master Out/Slave In, Serial Clock, and Master In/Slave Out lines respectively. In addition to the digital I/O, there are Analog inputs available on the board, called A0 through A8. These pins are shared on digital pins 6 thru 14. Peripheral I/O Functions I2C: Synchronous serial interface. The I2C1 interface is available on pins 2 and 3. When using the I2C interface, it is necessary to set JP4 and JP5 such that pullups are present on the bus this is done by moving the jumpers to pins 2 and 3 on each jumper. www.digilentinc.com page 6 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 User LEDs: Pins 11 (LD4), 12 (LD3), 13 (LD2) and 14 (LD1) is shared between the through-hole connection and the LED. Driving the pin high turns the LED on, driving it low turns it off. User Buttons: Pins 1 (BTN2/PGM) and 17 (BTN3) is shared between a through-hole connection and a push button. Pushing the button drives the input high. Releasing it brings the input low. External Interrupts: Only INT0 is hard-mapped on the microcontroller. It is connected to pin 1. The other external interrupts are accessible via PPS described below. Reset: The Reset button is utilized to bring the MCLR pin low on the microcontroller, thus restarting the currently loaded sketch. If the user wishes to reprogram the device, it is necessary to first hold down BTN2/PGM, and then press the reset button. This forces the microcontroller to default to the boot loader. Peripheral Pin Select: An advanced feature of the PIC32MX1xx/2xx families of microcontrollers is the ability to re-map the locations of peripheral devices. This advanced feature is available only in MPLAB IDE or MPLAB X. PPS Assigned Peripherals: Output Compare: Pin 8 (OC1), Pin 2 (OC2), Pin 3 (OC3), Pin 13 (OC4), Pin 6 (OC5). Output compare allows for the implementation of PWM signals. Input Capture: Pin 6 (IC1), Pin 11 (IC2), Pin 2 (IC3), Pin 14 (IC4), Pin 13 (IC5). Input capture allows for the synchronization of timers with captured signals, along with the execution of interrupts. External Timer Input: Pin 18 (TCK1), Pin 14 (TCK2), Pin 12 (TCK3), Pin 6 (TCK4), Pin 3 (TCK5) allows for timers to be clocked from external sources. External Interrupt: Pin 3 (INT1), Pin 13 (INT2), Pin 2 (INT3), Pin 17 (INT4) allows for external interrupts to be triggered in their own ISRs. Interrupts may be edge triggered or level triggered, though only one of rising, falling, high, or low, may be chosen for trigger sensitivity. Change Notice Pins: All change notice pins are matched with their chipKIT pin numbers (e.g. CN0 is associated with Pin 0). There is a change notice pin for each I/O pin. UART: Pin 14 (U1TX), Pin 6 (U1RX), Pin 7 (U2TX) and Pin 10 (U2RX) are used to implement UART peripheral controls. Unlike other chipKIT boards, the USB Serial communication is not implemented using a UART controller. SPI: Synchronous serial port. Pin 9 (SS), Pin 18 (MOSI), Pin 7 (SCK), Pin 10 (MISO). This uses SPI1 on the PIC32 Microcontroller. The second SPI is implemented as Pin 14 (SS), Pin 2 (MOSI), Pin 13 (MISO), and Pin 8 (SCK). www.digilentinc.com page 7 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 Appendix A: Pinout Tables Table 1: Pinout Table by chipKIT Pin Number chipKIT Pin # Connector Pin # Pic32 Pin # 0* 1* 2* 3* 4 5 6/A0 7/A1 8/A2 9/A3 10/A4 11/A5 12/A6 13/A7 14/A8 15 16 17 18 RB5 RB7 RB8 RB9 RB10 RB11 RB13 RB14 RB15 RA0 RA1 RB0 PGC RB2 RB3 RA2 RA3 RB4 RA4 14 16 17 18 21 22 24 25 26 2 3 4 5 6 7 9 10 11 12 PIC32 Signal Notes TMS/RPB5/USBID/RB5 TDI/RB7/CTED3/PMD5/INT0/RB7 TCK/RPB8/SCL1/CTED10/PMD4/RB8 TDO/RPB9/SDA1/SCTED4/PMD3/RB9 PGED2/RPB10/D+/CTED11/RB10 PGEC2/RPB11/D-/RB11 AN11/RPB13/CTPLS/PMRD/RB13 CVREF/AN10/C3INB/RPB14/VBUSON/SCK1/CTED5/RB14 AN9/C3INA/RPB15/SCK2/CTED6/PMCS1/RB15 PGED3/VREF+/CVREF+/AN0/C3INC/RPA0/CTED1/PMD7/RA0 PGEC3/VREF-/CVREF-/AN1/RPA1/CTED2/PMD6/RA1 PGED1/AN2/C1IND/C2INB/C3IND/RPB0/PMD0/RB0 PGEC1/AND3/C1INC/C2INA/RPB1/CTED12/PMD1/RB1 AN4/C1INB/C2IND/RPB2/SDA2/CTED13/PMD2/RB2 AN5/C1INA/C2INC/RTCC/RPB3/SCL2/PMWR/RB3 OSC1/CLKI/RPA2/RA2 OSC2/CLKO/RPA3/PMA0/RA3 SOSCI/RPB4/RB4 SOSCO/RPA4/T1CK/CTED9/PMA1/RA4 USBID w/ JP1 short BTN3 PU/PD w/ JP5 PU/PD w/ JP6 USB Data+ USB DataAnalog Temp Pin A0 IC4 - Serial Clock Dial Pot - Pin A2 IC4 - Chip Select IC4 - Serial Out LD4 LD3 LD2 LD1 8 MHz Clock In 8 MHz Clock Out BTN4 IC4 - Serial In * Pins are 5V Tolerant www.digilentinc.com page 8 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. chipKIT DP32 Pinout Table by Socket Pin Socket Pin # chipKIT Pin # Connector Pin # 1* 2 3 4 5 6 7 8 9 10 11 12 13 14 * 15 * 16 * 17 * 18 * 19 20 21 22 23 24 25 26 27 28 9/A3 10/A4 11/A5 12/A6 13/A7 14/A8 15 16 17 18 0 1 2 3 4 5 6/A0 7/A1 8/A2 - RA0 RA1 RB0 RB1 RB2 RB3 GND RA2 RA3 RB4 RA4 VDD RB5 VBUS RB7 RB8 RB9 GND RB10 RB11 RB13 RB14 RB15 - PIC32 Signal Notes nMCLR PGED3/VREF+/CVREF+/AN0/C3INC/RPA0/CTED1/PMD7/RA0 PGEC3/VREF-/CVREF-/AN1/RPA1/CTED2/PMD6/RA1 PGED1/AN2/C1IND/C2INB/C3IND/RPB0/PMD0/RB0 PGEC1/AND3/C1INC/C2INA/RPB1/CTED12/PMD1/RB1 AN4/C1INB/C2IND/RPB2/SDA2/CTED13/PMD2/RB2 AN5/C1INA/C2INC/RTCC/RPB3/SCL2/PMWR/RB3 VSS OSC1/CLKI/RPA2/RA2 OSC2/CLKO/RPA3/PMA0/RA3 SOSCI/RPB4/RB4 SOSCO/RPA4/T1CK/CTED9/PMA1/RA4 VDD TMS/RPB5/USBID/RB5 VBUS TDI/RB7/CTED3/PMD5/INT0/RB7 TCK/RPB8/SCL1/CTED10/PMD4/RB8 TDO/RPB9/SDA1/SCTED4/PMD3/RB9 VSS VCAP PGED2/RPB10/D+/CTED11/RB10 PGEC2/RPB11/D-/RB11 VUSB3V3 AN11/RPB13/CTPLS/PMRD/RB13 CVREF/AN10/C3INB/RPB14/VBUSON/SCK1/CTED5/RB14 AN9/C3INA/RPB15/SCK2/CTED6/PMCS1/RB15 AVSS AVDD Reset Button Circuit IC4 - Chip Select IC4 - Serial Out LD4 LD3 LD2 LD1 8 MHz Clock In 8 MHz Clock Out BTN4 IC4 - Serial In USBID w/ JP1 short BTN3 PU/PD w/ JP5 PU/PD w/ JP6 USB Data+ USB DataAnalog Temp Pin A0 IC4 - Serial Clock Dial Pot - Pin A2 N/C * Pins are 5V Tolerant www.digilentinc.com page 9 of 9 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners. Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Digilent: 410-280P-KIT