Cerebot MX4cK™ Board Reference Manual Revision: December 15, 2011 Note: This document applies to REV C of the board. 1300 Henley Court | Pullman, WA 99163 (509) 334 6306 Voice and Fax Overview The Cerebot MX4cK is a microcontroller development board based on the Microchip PIC32MX460F512L, a member of the 32-bit PIC32 microcontroller family. It is compatible with Digilent’s line of Pmod™ peripheral modules, and is suitable for use with the Microchip MPLAB® IDE tools.
Cerebot MX4cK Reference Manual Functional Description The Cerebot MX4cK is designed for embedded control and robotics control applications as well as for general microprocessor experimentation. Firmware suitable for many applications can be downloaded to the Cerebot MX4cK’s programmable PIC32 microcontroller.
Cerebot MX4cK Reference Manual copy of the Microchip C32 compiler for use with the PIC32 microcontroller family. The licensed debugger is compatible with the MPLAB IDE version 8.63 or later. #pragma config ICESEL = ICS_PGx2 When creating a new project, use the “Configure.Select Device…” menu to specify the PIC32 device being used. Ensure that the device is set to PIC32MX460F512L.
Cerebot MX4cK Reference Manual • Use the “File Import…” dialog box to navigate to and select the boot loader programming downloaded from the Digilent web site. The file name will be something like: chipKIT_Bootloader_MX4cK.hex • Use the “Programmer.Program” command to program all memories on the device.
Cerebot MX4cK Reference Manual The PIC32MX3XX/4XX Family Data Sheet and the PIC32MX Family Reference Manual available from the Microchip web site: www.microchip.com Additional reference material for the chipKIT MPIDE system is included in the MPIDE software download, and on-line in the chipKIT wiki. Help with questions and problems using the board with the chipKIT MPIDE software can also be obtained in the chipKIT forums: www.github.com/chipKIT32 (software download) www.chipKIT.org/wiki www.chipKIT.
Cerebot MX4cK Reference Manual Board Hardware Description The following describes the various hardware features of the Cerebot MX4cK board and the PIC32XM460F512L microcontroller. 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. The Cerebot MX4cK may be USB powered via either the USB debug port, the USB UART port, or the USB device port.
Cerebot MX4cK Reference Manual Connector J14 is a two-pin male header that provides easy battery or battery-pack connection. Digilent has both two-cell and four-cell AA battery holders with two pin connectors available for connection to J14. Connector J18 is a screw terminal connector for an alternative power supply connection for use with higher current battery packs, bench supplies or other power sources where use of a hard wired power supply is desirable.
Cerebot MX4cK Reference Manual Pmod™ Connectors The Cerebot MX4cK has nine connectors for connecting Digilent Pmod peripheral modules. The Pmod connectors, labeled JA–JF and JH– JK, are 2x8 right-angle, female pin header connectors. Each connector has an associated power select jumper block labeled JPA–JPF and JPH–JPK. Digilent Pmods are a line of small peripheral modules that provide various kinds of I/O interfaces.
Cerebot MX4cK Reference Manual The PIC32 microcontroller can source or sink a maximum of 18mA on all digital I/O pins. However, to keep the output voltage within the specified input/output voltage range (VOL 0.4V, VOH 2.4V) the pin current must be restricted to +7/-12mA. The maximum current that can be sourced or sunk across all I/O pins simultaneously is +/-200mA. The maximum voltage that can be applied to any digital I/O pin is 5.5V.
Cerebot MX4cK Reference Manual Push Buttons and LEDs When using the Cerebot MX4cK with the chipKIT MPIDE the functions pinMode(), digitalRead(), and digitalWrite() are used for digital pin I/O. The pinMode() function is used to set the pin direction. Pin direction can be set to: INPUT, OUTPUT, or OPEN. OPEN is used for opendrain and implies output. The digitalRead() and digitalWrite() functions are used to read or write the pins.
Cerebot MX4cK Reference Manual accessed through the JC connector if they're not being used to control a servo. RC Servos use a pulse width modulated signal, PWM, to control the servo position. The 16-bit timers in the PIC32 microcontroller have the ability to generate PWM signals using the output compare registers. However, it is also possible to use timer interrupts to accomplish this same thing.
Cerebot MX4cK Reference Manual Cerebot MX4cK to operate with 5V logic devices. 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. The digital I/O pins on the PIC32 microcontroller are 5V tolerant.
Cerebot MX4cK Reference Manual PIC32 Peripheral Devices The following describes the peripheral devices available in the PIC32MX460F512L microcontroller and how they are accessed on the Cerebot MX4cK board. CPU Clock Source The PIC32 microcontroller supports numerous clock source options for the main processor operating clock.
Cerebot MX4cK Reference Manual 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.
Cerebot MX4cK Reference Manual When operating as a USB host, the PIC32MX460 microcontroller controls application of power to the connected device via the VBUSON control pin. 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. Pin 20 of the PIC32MX460 microcontroller is used for the VBUSON function.
Cerebot MX4cK Reference Manual Detailed information about the operation of the UART peripherals can be found in the PIC32 Family Reference Manual, Section 21, UART. The USB Serial converter is connected to UART1. The MPIDE uses this to communicate with the boot loader. This can also be used for a serial communications interface between the Cerebot MX4cK board and other software running on a PC.
Cerebot MX4cK Reference Manual The standard SPI library supports access to a single SPI port, SPI2. This is accessed using the SPI object. The DSPI library supports access to both SPI ports. The DSPI0 object class is used to create an object used to access the default SPI port, SPI2, connector JB. The DSPI1 object class is used to access SPI1, connector J1. I2C™ Interface The Inter-Integrated Circuit (I2CTM) Interface provides a medium speed (100K or 400K bps) synchronous serial communications bus.
Cerebot MX4cK Reference Manual • • • • • • J2-3 – SDA1 J2-4 – SDA1 J2-5 – GND J2-6 – GND J2-7 – BRD_3V3 J2-8 – BRD_3V3 Connector J6, I2C2 • J6-1 – SCL2 • J6-2 – SCL2 • J6-3 – SDA2 • J6-4 – SDA2 • J6-5 – GND • J6-6 – GND • J6-7 – BRD_3V3 • J6-8 – BRD_3V3 On-Board I2C Peripheral Devices The Cerebot MX4cK provides two on-board I2C peripheral devices, a Microchip 24LC256 serial EEPROM, and a Microchip MCP4725 Digital to Analog Converter. These devices are both connected to I2C2.
Cerebot MX4cK Reference Manual • A12 – JB-07, digital pin 12, RB15 • A13 – JB-10, digital pin 15, RB14 using the analogReference() function. The following values can be used with analogReference(): A/D Converter Reference The PIC32 microcontroller provides two reference inputs to the analog to digital converter. Vref- is used set the lower reference level and Vref+ is used to set the upper reference level.
Cerebot MX4cK Reference Manual • TCK3 – JD-10, digital pin 31, RC02 • TCK4 – JE-10, digital pin 39, RC03 • TCK5 – JK-10, digital pin 71, RC04 For detailed information on the operation of the PIC32 timers, refer to the PIC32 Family Reference Manual, Section 14, Timers. When using the chipKIT MPIDE software, the symbols PIN_TCK2, PIN_TCK3, PIN_TCK4, and PIN_TCK5 can be used to access the timer input pins.
Cerebot MX4cK Reference Manual The following gives the Pmod connector position, chipKIT pin number, and microcontroller port and bit number for the input capture units input pins: • • • • • IC1 – JH-09, digital pin 54, RD08 IC2 – JD-03, digital pin 26, RD09 IC3 – JD-03, digital pin 30, RD10 IC4 – JE-09, digital pin 38, RD11 IC5 – JK-09, digital pin 70, RD12 When using the chipKIT MPIDE software, the symbols PIN_IC1, PIN_IC2, PIN_IC3, PIN_IC4, and PIN_IC5 can be used to access the capture input pins.
Cerebot MX4cK Reference Manual Appendix A: Connector Descriptions and Jumper Settings Label J1 Function SPI port #1 connector Because of multiple uses for the pins, the signals for SPI port #1 are scattered across multiple Pmod connectors. This connector provides all of the SPI port #1 signals on a single connector. All of the signal pins on this connector are shared with pins on various Pmod connectors.
Cerebot MX4cK Reference Manual J12 Power supply source select This jumper is used to select the source of main board power. Place a shorting block in the USB position to have the board powered from the USB device connector, J15. Place a shorting block in the EXT position to have the board powered from one of the external power connectors, J13, J14, or J18. Place a shorting block in the DBG position to have the board powered from the debug USB connector, J9.
Cerebot MX4cK Reference Manual J18 External power connector This is a two pin screw terminal connector that can be used to supply external power to the board. J19 Auxiliary Power Out This connector provides access to the unregulated power bus BRD_VU and GND. It can be used to distribute power to other boards from the Cerebot MX4cK. JP1 Connect VS bus to BRD_VU bus This jumper is used to connect the VS bus to the BRD_VU bus. The VS bus provides power to the servo connectors, S1-S8.
Cerebot MX4cK Reference Manual JP8 USB Serial converter reset disconnect This is used to connect/disconnect the USB serial converter reset circuit from the PIC32 MCLR pin. The shorting block must be in place on this jumper when using the chipKIT MPIDE development tools. Remove the shorting block if the USB serial converter is interfering with proper operation of the licensed debugger circuit. JP9 Do not use Used for manufacturing test purposes.
Cerebot MX4cK Reference Manual Appendix B: Example of Configuration Values The following example illustrates setting the configuration values in the PIC32 microcontroller on the Cerebot MX4cK. The microcontroller configuration should be done in a single source file in the project, and is typically done in the ‘main’ project source file. This example sets all configuration values to valid values for the Cerebot MX4cK board.
Cerebot MX4cK Reference Manual Appendix C: Connector Pinout Tables Arranged by Microcontroller Pin Number PIC32 Pin # Connector Pin # chipKIT Pin # 1 JC-04 19 MCU Port Bit RG15 PIC32 Signal Name Notes RG15 also servo S4 3 JA-08 5 RE05 PMD5/RE5 4 JA-09 6 RE06 PMD6/RE6 5 JA-10 7 RE07 PMD7/RE7 6 JD-04 27 RC01 T2CK/RC1 7 JD-10 31 RC02 T3CK/RC2 8 JE-10 39 RC03 T4CK/RC3 9 JK-10 71 RC04 SDI1/T5CK/RC4 10 JB-04 11 RG06 PMA5/SCK2/CN8/RG6 11 JB-03 10 RG07 PMA4/SD
Cerebot MX4cK Reference Manual 44 JB-07 12 RB15 PMALL/PMA0/AN15/OCFB/CN12/RB15 47 JE-01 32 RD14 CN20/U1CTS/RD14 48 JE-04 35 RD15 U1RTS/BCLK1/CN21/RD15 49 JH-03 50 RF04 PMA9/U2RX/CN17/RF4 50 JH-02 49 RF05 PMA8/U2TX/CN18/RF5 51 N/A N/A RF03 USBID/RF3 USB-4 52 JE-03 34 RF02 U1RX/RF2 53 JE-02 33 RF08 U1TX/RF8 56 N/A N/A RG03 D-/RG3 USB-2 57 N/A N/A RG02 D+/RG2 USB-3 58 J6-1,J6-2 72 RA02 SCL2/RA2 I2C2 59 J6-3,J6-4 73 RA03 SDA2/RA3 I2C2 60 JF-09 4
Cerebot MX4cK Reference Manual 93 JA-01 0 RE00 PMD0/RE0 94 JA-02 1 RE01 PMD1/RE1 95 JC-03 18 RG14 TRD2/RG14 also servo S3 96 JC-01 16 RG12 TRD1/RG12 also servo S1 97 JC-02 17 RG13 TRD0/RG13 also servo S2 98 JA-03 2 RE02 PMD2/RE2 99 JA-04 3 RE03 PMD3/RE3 100 JA-07 4 RE04 PMD4/RE4 www.digilentinc.com page 29 of 35 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Cerebot MX4cK Reference Manual Arranged by Connector Pin Number and Digital Pin Number PIC32 Pin # Connector Pin # 93 JA-01 0 MCU Port Bit RE00 94 JA-02 1 RE01 PMD1/RE1 98 JA-03 2 RE02 PMD2/RE2 99 JA-04 3 RE03 PMD3/RE3 100 JA-07 4 RE04 PMD4/RE4 3 JA-08 5 RE05 PMD5/RE5 4 JA-09 6 RE06 PMD6/RE6 5 JA-10 7 RE07 PMD7/RE7 14 JB-01 8 RG09 PMA2/SS2/CN11/RG9 12 JB-02 9 RG08 PMA3/SDO2/CN10/RG8 11 JB-03 10 RG07 PMA4/SDI2/CN9/RG7 10 JB-04 11 RG06 PMA5/SCK2/CN8
Cerebot MX4cK Reference Manual 19 JE-07 36 RE09 INT2/RE9 78 JE-08 37 RD03 OC4/RD3 71 JE-09 38 RD11 IC4/PMCS1/PMA14/RD11 8 JE-10 39 RC03 T4CK/RC3 66 JF-01 40 RA14 SCL1/INT3/RA14 also J2-01,J2-02 I2C1 67 JF-02 41 RA15 SDA1/INT4/RA15 also J2-03,J2-04 I2C1 91 JF-03 42 RA06 TRCLK/RA6 also BTN1 92 JF-04 43 RA07 TRD3/RA7 also BTN2 17 JF-07 44 RA00 TMS/RA0 38 JF-08 45 RA01 TCK/RA1 60 JF-09 46 RA04 TDI/RA4 61 JF-10 47 RA05 TDO/RA5 40 JH-01 48 RF12 U
Cerebot MX4cK Reference Manual 51 N/A N/A RF03 USBID/RF3 USB-4 56 N/A N/A RG03 D-/RG3 USB-2 57 N/A N/A RG02 D+/RG2 USB-3 63 N/A N/A RC12 OSC1/CLKI/RC12 Primary Oscillator 64 N/A N/A RC15 OSC2/CLKO/RC15 Primary Oscillator 73 N/A N/A RC13 SOSCI/CN1/RC13 Secondary Oscillator 74 N/A N/A RC14 SOSCO/T1CK/CN0/RC14 Secondary Oscillator www.digilentinc.com page 32 of 35 Copyright Digilent, Inc. All rights reserved.
Cerebot MX4cK Reference Manual Arranged by Microcontroller I/O Port Name and Bit Number PIC32 Pin # Connector Pin # 17 JF-07 44 MCU Port Bit RA00 38 JF-08 45 RA01 TCK/RA1 58 J6-1,J6-2 72 RA02 SCL2/RA2 I2C2 59 J6-3,J6-4 73 RA03 SDA2/RA3 I2C2 60 JF-09 46 RA04 TDI/RA4 61 JF-10 47 RA05 TDO/RA5 91 JF-03 42 RA06 TRCLK/RA6 also BTN1 92 JF-04 43 RA07 TRD3/RA7 also BTN2 28 JK-07 68 RA09 PMA7/Vref-/CVref-/RA9 29 JK-08 69 RA10 PMA6/Vref+/CVref+/RA10 66 JF-01 40
Cerebot MX4cK Reference Manual 72 JH-08 53 RD00 SDO1/OC1/INT0/RD0 76 JD-02 25 RD01 OC2/RD1 77 JD-08 29 RD02 OC3/RD2 78 JE-08 37 RD03 OC4/RD3 81 JB-09 14 RD04 PMWR/OC5/CN13/RD4 82 JB-08 13 RD05 PMRD/CN14/RD5 83 JD-07 28 RD06 PMD14/CN15/RD6 84 JD-01 24 RD07 PMD15/CN16/RD7 68 JH-09 54 RD08 IC1/RTCC/RD8 also J1-08 69 JD-03 26 RD09 IC2/SS1/RD9 also J1-01 70 JD-09 30 RD10 IC3/SCK1/PMCS2/PMA15/RD10 also J1-04 71 JE-09 38 RD11 IC4/PMCS1/PMA14/RD11 79 J
Cerebot MX4cK Reference Manual 11 JB-03 10 RG07 PMA4/SDI2/CN9/RG7 12 JB-02 9 RG08 PMA3/SDO2/CN10/RG8 14 JB-01 8 RG09 PMA2/SS2/CN11/RG9 96 JC-01 16 RG12 TRD1/RG12 also servo S1 97 JC-02 17 RG13 TRD0/RG13 also servo S2 95 JC-03 18 RG14 TRD2/RG14 also servo S3 1 JC-04 19 RG15 RG15 also servo S4 www.digilentinc.com page 35 of 35 Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.