Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
chipkit_cmod:chipkit_cmod [2015/03/18 22:28] – [7 Peripheral I/O Functions] brandon marcum | chipkit_cmod:chipkit_cmod [2021/10/07 19:27] (current) – Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== chipKIT Cmod™ Reference Manual ====== | + | ~~REDIRECT> |
- | {{ : | + | |
- | ---- | + | ====== chipKIT Cmod Resource Center====== |
- | ==== Revision History | + | |
- | Revised November 2013 | + | {{ : |
- | This manual applies | + | **Welcome |
- | {{ : | + | |
- | ---- | + | Here you will find all the reference materials that Digilent has created for this board, as well as links to any external content we have tracked down. |
- | ===== Overview ===== | + | |
- | The chipKIT Cmod is a chipKIT/ | + | The chipKIT™ Cmod is a microcontroller development |
- | The chipKIT Cmod takes advantage of the powerful [[http:// | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | The chipKIT Cmod can be programmed using the Multi-Platform Integrated Development Environment, | ||
- | |||
- | {{ : | ||
- | |||
- | The chipKIT Cmod is also fully compatible with the advanced Microchip MPLAB® IDE. To develop embedded applications using MPLAB®, a separate device programmer/ | ||
- | |||
- | Features Include: | ||
- | {{: | ||
- | |||
- | * Microchip® PIC32MX150F128D microcontroller (40/50 Mhz 32-bit MIPS, 128K Flash, 32K SRAM) | ||
- | * Convenient 600-mil, 2x20-pin DIP package | ||
- | * 5V – 12V recommended operating voltage | ||
- | * 33 available I/O pins | ||
- | * Two user LEDs | ||
- | * PC connection uses a USB A to micro B cable (not included) | ||
- | * 13 analog inputs | ||
- | * 3.3V operating voltage | ||
- | * Two Pmod connectors for Digilent peripheral module boards | ||
---- | ---- | ||
- | ===== 1 Functional Description ===== | ||
- | {{ : | ||
+ | =====Revision History ===== | ||
- | The PIC32MX150F128D microcontroller features a 32-bit MIPS processor core capable | + | We are currently on Revision E of the chipKIT™ Cmod. |
+ | You can find the revision of your board by looking on the underside, near the white bar-coded box. | ||
+ | {{ : | ||
- | The chipKIT Cmod provides 33 I/O pins located on the 40-pin DIP package. Some pins share functions with the onboard circuits such as the on-board LEDs, the UART data lines used by the USB serial converter, or the Pmod connectors (see the schematic for details). If these peripherals are needed in the design, then the microcontroller can be reconfigured to allow these pins to be used for other purposes. Thirteen of the digital I/O pins can also be used as analog input pins. | ||
- | The PIC32MX150F128D microcontroller supports peripheral functions such as UART, SPI, and I2C, as well as pulse-width-modulated outputs. To use the peripheral functions the PIC32MX1xx family of microcontrollers features a mappable I/O system called peripheral pin select (PPS), which allows select peripheral functionality to be mapped to multiple pins on the device. The default chipKIT Cmod board support files provide a specific mapping of peripheral functions to microcontroller pins. This default pin mapping can be over-ridden by the user’s MPLABX program if a different mapping is desired (this requires the mentioned, compatible debugger). | ||
- | ==== 1.1 Hardware Overview ==== | ||
- | |||
- | {{ : | ||
- | |||
- | ^ Call Out ^ Component Description | ||
- | | 1 | J3 USB connector for USB serial converter | ||
- | | 2 | JP2 Microchip ICSP Connector | | ||
- | | 3 | J1-J2 Digilent Pmod connectors | ||
- | | 4 | 40 Pin DIP connector | ||
- | | 5 | User LEDs | | ||
- | | 6 | Reset button | ||
- | | 7 | PIC32 Microcontroller | | ||
- | | 8 | DIP Pin 1 external power connector | | ||
- | | 9 | DIP Pin 3 USB 5.0V power connector | ||
---- | ---- | ||
- | ===== 2 Programming Tools ===== | + | ===== Documentation |
- | The ChipKIT Cmod can be used with either the MPIDE development environment or the Microchip MPLAB® development environment. When used with the MPLAB® IDE, in-system-programming and debugging of firmware running on the PIC32MX150 microcontroller is supported using an external programming/ | + | |
- | The ChipKIT | + | * **Schematic** -- {{: |
+ | * PDF Schematic of the PCB generated by Altium | ||
+ | * **Reference Manual** -- [[refmanual|Wiki]] {{: | ||
+ | * Technical description of the chipKIT | ||
+ | * **Sell Sheet** -- {{: | ||
+ | * Quick and easy breakdown of the chipKIT Cmod features. | ||
+ | * **Fritzing Part** -- {{: | ||
+ | * The Fritzing part that can be uploaded and used to create circuit images. | ||
+ | * **Eagle Project** {{: | ||
+ | * Open source project | ||
- | ==== 2.1 MPIDE and USB Serial Communications | + | ===== Design Resources |
+ | * **Bootloader** -- {{: | ||
+ | * chipKIT bootloader image loaded into the chipKIT CMOD's PIC32 microcontroller at the factory. | ||
- | The chipKIT Cmod board is designed to be used with the Multi-Platform IDE (MPIDE). The MPIDE development platform was created by modifying the Arduino™ IDE. It is backwards-compatible with the Arduino IDE. | + | ===== Tutorials |
- | {{ : | + | * **Installing |
- | + | * Instructions for installing MPIDE or Arduino IDE with the chipKIT core | |
- | The MPIDE uses a serial communications port to communicate with a boot loader running on the chipKIT Cmod board. The serial port on the board is implemented using an FTDI FT232R USB serial converter. Before attempting to use the MPIDE to communicate with the board, the appropriate USB device driver must be installed. | + | |
- | + | ||
- | The chipKIT Cmod uses a standard micro-USB connector for connection to a USB port on the PC. A USB-A to Micro-B cable, not supplied, is used to connect the board to a USB port on the host computer. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | When the MPIDE needs to communicate with the chipKit Cmod board, the board is reset and starts running the boot loader. The MPIDE then establishes communications with the boot loader and downloads the program to the board. | + | |
- | + | ||
- | When the MPIDE opens the serial communications connection on the PC, the DTR pin on the FT232R chip is driven low. This pin is coupled through a capacitor to the MCLR pin on the PIC32 microcontroller. Driving the MCLR line low resets the microcontroller, | + | |
- | + | ||
- | Two red LEDs (LD1 and LD2) will blink when data is being sent or received between the chipKIT Cmod and the PC over the serial connection. | + | |
- | + | ||
- | ==== 2.2 Microchip Development Tool Compatibility | + | |
- | + | ||
- | In addition to being used with the MPIDE, the chipKIT Cmod board can be used as a more traditional microcontroller development board using Microchip' | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Typically, a right-angle male connector is used in JP2 so that the programmer can be attached coplanar with the chipKIT Cmod. The connector can be loaded from the top or the bottom. In either case, the programmer will be upside-down while the chipKIT Cmod board is upright (button, LEDs, and Pmod connectors visible). Ensure that pin 1 on the programmer is connected to the square solder pad on JP2. In some cases, because of mechanical clearance limitations, | + | |
- | + | ||
- | The Microchip MPLAB® IDE or the MPLAB® X IDE can be used to program and debug code running on the chipKIT Cmod board. These programs can be downloaded from the Microchip web site. | + | |
- | + | ||
- | ==== 2.3 Reloading the Boot Loader | + | |
- | Using the Microchip development tools to program the 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 boot loader compiled image can be found on the chipKIT | + | |
- | + | ||
- | To reprogram the boot loader using MPLAB X, perform the following steps: | + | |
- | + | ||
- | - Open MPLAB X, click on " | + | |
- | | + | |
- | | + | |
- | - With your board connected to the programmer and the programmer connected via USB cable to your PC, the programmer SN will load automatically under " | + | |
- | - Click the " | + | |
- | - Rename the project if you wish. The name of the .hex file is used by default. | + | |
- | - Choose where to place your project. The file where your boot loader is located is used by default. | + | |
- | - Click " | + | |
- | - Right-click the project name and select "Make and Program Device" | + | |
---- | ---- | ||
- | ===== 3 Power Supply | + | ===== External Links ===== |
- | + | * [[https://forum.digilentinc.com/index.php?/forum/5-chipkit-boards/|Digilent Forum]] | |
- | + | ||
- | The chipKIT Cmod is designed to be powered via USB (J3) or from an external power supply connected to pin 1 of the DIP package. | + | |
- | + | ||
- | The chipKIT Cmod has a single voltage regulator which regulates either 5V from USB, or a maximum of 15V external voltage. A series diode between the DIP pin 1 (VIN) and DIP pin 3 (USB5V0) prevents an external voltage applied to pin 1 being fed back onto the USB 5V supply when powering the board via DIP pin 1. All power supply options are regulated to 3.3 V to provide power to the VCC3V3 bus that powers the PIC32 microcontroller. The output of the on-board 3.3V regulator is available at DIP pin 2 and can be used to power external circuitry. | + | |
- | + | ||
- | The 3.3V regulator is a Microchip MCP1703. The 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. | + | |
- | + | ||
- | ---- | + | |
- | ===== 4 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. When driving a high impedance input (typical of CMOS logic), the output high voltage from the PIC32 microcontroller will be close to 3.3V. Some 5V devices will recognize this voltage as a logic high input, and some won’t. Many 5V logic devices will work reliably with 3.3V inputs. Please check the datasheet for the 5V components you are using to ensure that 3.3V will satisfy the logic high conditions for the components. | + | |
- | + | ||
- | Some of the digital I/O pins on the PIC32 microcontroller are 5V tolerant. The analog capable I/O pins are not 5V tolerant. | + | |
- | + | ||
- | ---- | + | |
- | ===== 5 Pmod™ Connectors ===== | + | |
- | + | ||
- | The chipKIT Cmod has two connectors for connecting Digilent Pmod peripheral modules. The Pmod connectors, labeled J1 and J2, are 2x6, female pin header connectors. | + | |
- | + | ||
- | The Pmod connectors on the chipKIT Cmod are both twelve-pin connectors. The connectors use standard pin headers with 100-mil spaced pins. The twelve-pin connectors have the pins in a 2x6 configuration. | + | |
- | + | ||
- | The twelve-pin connectors provide eight I/O signals, two 3.3V power pins, and two ground pins. The twelve-pin connectors have the signals arranged so that one twelve-pin connector is equivalent to two of the six-pin connectors. Pins 1–4 and 7–10 are the signal pins, pins 5 and 11 are the ground pins, and pins 6 and 12 are the power supply pins. | + | |
- | + | ||
- | The pin numbering that Digilent uses on the twelve-pin Pmod connectors is non-standard. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The upper row of pins are numbered 1–6, right to left (when viewed from the end of the connector), and the lower row of pins are numbered 7–12, right to left. This is in keeping with the convention that the upper and lower rows of pins can be considered to be two six-pin connectors stacked. | + | |
- | + | ||
- | It is important to note that the Pmod connectors on the chipKIT Cmod are rotated 180 degrees in relation to each other. Pin 1 of each Pmod connector is marked on the board. When viewing the top of the board, pin 1 of Pmod connector J2 is the upper right pin, and pin 7 is immediately below it. For Pmod connector J1, pin 1 is in the lower left corner and pin 7 is immediately above it. Connecting peripheral modules incorrectly could result in damaging the peripheral module or the chipKIT Cmod. \\ | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | See the attached pinout diagram and tables in the appendices for more information about connecting peripheral modules and other devices to the chipKIT Cmod. These tables describe the mapping between pins on the PIC32MX150F128D microcontroller and the pins on the connectors. | + | |
- | + | ||
- | ---- | + | |
- | ===== 6 Input/ | + | |
- | + | ||
- | + | ||
- | The chipKIT Cmod board provides 33 of the I/O pins from the PIC32MX150F128D microcontroller to pins on the DIP connector. | + | |
- | + | ||
- | The chipKIT Cmod and the MPIDE system uses logical pin numbers to identify digital I/O pins. All digital I/O pins share their numbering with their DIP connector pin. Valid pin numbers on the chipKIT Cmod are 4-8, 10-27, and 29-38. Pin numbers 1-3 and 39-40 refer to pins connected to power buses on the board and are not available for use as I/O. Pin 9 can be used to reset the PIC32 microcontroller and pin 28 is unconnected. In addition, several of these I/O pins share functionality with other devices on the board. See the attached pinout tables for more information. | + | |
- | + | ||
- | The DIP connector uses standard DIP package pin numbers. Pins 1- 20 count up from the square pad labeled ‘1’ on the lower DIP connector. Pins 21-40 count up from the pin near the label ‘Q1’ to the pin labeled ‘GND’ on the other DIP connector. | + | |
- | + | ||
- | Pins 18 and 19 are normally the reference voltages for the microcontroller’s A/D converter, but can also be used as digital I/O pins. | + | |
- | + | ||
- | In addition to the connector pin, Pin 14 is also connected to the user LED LD3. Pin 12 also connects to the user LED LD4. (Note: When using MPIDE, LD3 is assigned to macro PIN_LED1 and LD4 is assigned to macro PIN_LED2.) | + | |
- | + | ||
- | In addition to digital I/O, there are analog inputs available on the board, called A0 through A12. These pins are shared with digital pins 12, 13, and 16 through 26. Refer to the attached pinout tables for the correct mapping of these signals. | + | |
- | + | ||
- | ---- | + | |
- | ===== 7 Peripheral I/O Functions ===== | + | |
- | + | ||
- | The PIC32 microcontroller on the chipKIT board provides a number of peripheral functions. The following peripherals are provided: | + | |
- | + | ||
- | **I< | + | |
- | + | ||
- | **Note:** The I< | + | |
- | + | ||
- | **User LEDs:** Pins 12 (LD4) and 14 (LD3). Both Pin 12 and Pin 14 are shared between a connector pin on the chipKIT Cmod and an LED. Driving the pin high turns the LED on, driving it low turns it off. (Note: When using MPIDE, LD3 is assigned to macro PIN_LED1 and LD4 is assigned to macro PIN_LED2.) | + | |
- | + | ||
- | **External Interrupts: | + | |
- | + | ||
- | **A/D Converter Reference: | + | |
- | + | ||
- | **Reset:** The PIC32 microcontroller is reset by bringing its MCLR pin low. The MCLR pin is connected to the P32_RST net on the circuit board. A reset button is located on the right side of the board. Pressing this button resets the PIC32 microcontroller. | + | |
- | + | ||
- | Reset of the PIC32 microcontroller can be initiated by the USB serial converter. The USB serial converter brings the DTR pin low to reset the microcontroller. The P32_RST net is connected to Pin 9 of the DIP package. This allows external circuitry to reset the microcontroller, | + | |
- | + | ||
- | ---- | + | |
- | ===== 8 Peripheral Pin Select ===== | + | |
- | + | ||
- | An advanced feature of the PIC32MX1xx/ | + | |
- | + | ||
- | The PPS Peripherals are pre-assigned to the following pins when programming the chipKIT Cmod with MPIDE. These assignments are also included in the Notes sections of the attached pinout tables. | + | |
- | + | ||
- | **Output Compare:** Pin 29 (OC1), Pin 38 (OC2), Pin 4 (OC3), Pin 22 (OC4), Pin 13 (OC5). Output compare allows for the implementation of pulse width modulated (PWM) signals using the analogWrite() function. | + | |
- | + | ||
- | **Input Capture:** Pin 36 (IC1), Pin 10 (IC2), Pin 31 (IC3), Pin 37 (IC4), Pin 25 (IC5). Input capture allows for the synchronization of timers with captured signals, along with the execution of interrupts. | + | |
- | + | ||
- | **External Timer Input:** Pin 30 (TCK1), Pin 18 (TCK2), Pin 27 (TCK3), Pin 32 (TCK4), Pin 26 (TCK5) allows for timers to be clocked from external sources. | + | |
- | + | ||
- | **External Interrupt: | + | |
- | + | ||
- | **Change Notice Pins:** All change notice pins are matched with their chipKIT pin numbers (e.g. CN4 is associated with Pin 4). There is a change notice pin for each I/O pin. | + | |
- | + | ||
- | **UART:** Asynchronous serial port. Pin 23 (U1TX), Pin 5 (U1RX). These pins use UART1 on the PIC32 microcontroller and are connected to the FT232RQ serial converter. It is possible to use these pins to connect to an external serial device when not using the USB serial interface. Pin 20 (U2TX) and Pin 21 (U2RX) are used to implement UART2 on the PIC32 microcontroller. | + | |
- | + | ||
- | **SPI:** Synchronous serial port. Pin 24 (SS), Pin 35 (MISO), Pin 25 (MOSI), Pin 16 (SCK). This uses SPI1 on the PIC32 Microcontroller. SPI2 is implemented as Pin 33 (SS), Pin 36 (MOSI), Pin 32 (MISO), and Pin 17 (SCK). | + | |
- | + | ||
- | When using the chipKIT Cmod with MPIDE, the SPI ports are accessed using either the standard chipKIT SPI library or using the Digilent DSPI library. The standard SPI library supports access to a single SPI port, SPI1. This is accessed using the SPI object. | + | |
- | The DSPI library supports access to both SPI ports. The DSPI0 object class is used to access the default SPI port, SPI1. The DSPI1 object class is used to access SPI2. | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== Appendices ===== | + | |
- | + | ||
- | The following tables give the relationship between the chipKIT digital pin numbers, the connector pin numbers, and the microcontroller pin numbers. | + | |
- | + | ||
- | In the following tables, columns labeled chipKIT pin # refer to the digital pin number. This is the value that is passed to the pinMode(), digitalRead(), | + | |
- | + | ||
- | The signals mapped by using Peripheral Pin Select are included in the following tables. They are listed with the default pins assigned to them when using MPIDE. If the locations of peripheral devices are re-mapped, these signals may no longer be associated with the same pin as listed below. | + | |
- | + | ||
- | ---- | + | |
- | ==== Appendix A: Pinout Diagram ==== | + | |
- | {{ : | + | |
- | ==== Appendix B: Pinout Table by DIP Connector/ChipKIT Pin Number ==== | + | |
- | + | ||
- | ^ DIP Pin # ^ chipKIT Pin # ^ Connector Pin # ^ PIC32 Pin # ^ PIC32 Signal ^ Notes^ | + | |
- | | 1 | + | |
- | | 2 | + | |
- | | 3 | + | |
- | | 4 | + | |
- | | 5 | 5 | | + | |
- | | 6 | + | |
- | | 7 | + | |
- | | 8 | + | |
- | | 9 | + | |
- | | 10 | | + | |
- | | 11 | | + | |
- | | 12 | | + | |
- | | 13 | | + | |
- | | 14 | | + | |
- | | 15 | | + | |
- | | 16 | | + | |
- | | 17 | | + | |
- | | 18 | | + | |
- | | 19 | | + | |
- | | 20 | | + | |
- | | 21 | | + | |
- | | 22 | | + | |
- | | 23 | | + | |
- | | 24 | | + | |
- | | 25 | | + | |
- | | 26 | | + | |
- | | 27 | | + | |
- | | 28 | - | - | - | | + | |
- | | 29 | | + | |
- | | 30 | | + | |
- | | 31 | | + | |
- | | 32 | | + | |
- | | 33 | | + | |
- | | 34 | | + | |
- | | 35 | | + | |
- | | 36 | | + | |
- | | 37 | | + | |
- | | 38 | | + | |
- | | 39/40 | + | |
- | * Indicates 5V tolerant pin on the PIC32MX150F128D | + | |
- | + | ||
- | ==== Appendix C: Pinout Table by Pmod Connector Pin Number ==== | + | |
- | ^ Connector Pin # ^ DIP Pin # ^ chipKIT Pin # ^ PIC32 Pin # ^ PIC32 Signal ^ Notes^ | + | |
- | | J1-01 | | + | |
- | | J1-02 | | + | |
- | | J1-03 | | + | |
- | | J1-04 | | + | |
- | | J1-05 | 39/40 | - | 6/ | + | |
- | | J1-06 | 2 | - | | + | |
- | | J1-07 | 7 | 7 | 4* | + | |
- | | J1-08 | 6 | 6 | 3* | + | |
- | | J1-09 | | + | |
- | | J1-10 | 8 | 8 | 5* | + | |
- | | J1-11 | 39/40 | - | 6/ | + | |
- | | J1-12 | 2 | - | 28/40 |VDD | + | |
- | | J2-01 | | + | |
- | | J2-02 | | + | |
- | | J2-03 | | + | |
- | | J2-04 | | + | |
- | | J2-05 | 39/40 | - | 6/ | + | |
- | | J2-06 | 2 | - | 28/40 |VDD | VCC3V3 | | + | |
- | | J2-07 | | + | |
- | | J2-08 | | + | |
- | | J2-09 | | + | |
- | | J2-10 | | + | |
- | | J2-11 | 39/40 | - | 6/ | + | |
- | | J2-12 | 2 | - | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | | | + | |
- | * Indicates 5V tolerant pin on the PIC32MX150F128D | + | |
- | + | ||
- | + | ||
- | ==== Appendix D: Pinout Table by PIC32 Microcontroller Pin ==== | + | |
- | ^ PIC32 Pin # ^ DIP Pin # ^ chipKIT Pin # ^ Connector Pin # ^ PIC32 Signal ^ Notes^ | + | |
- | | 1* | + | |
- | | 2* | + | |
- | | 3* | + | |
- | | 4* | + | |
- | | 5* | + | |
- | | 6 | 39/40 | - | - | VSS/ | + | |
- | | 7 | | + | |
- | | 8* | + | |
- | | 9* | + | |
- | | 10 | | + | |
- | | 11 | | + | |
- | | 12* | + | |
- | | 13* | + | |
- | | 14 | | + | |
- | | 15 | | + | |
- | | 16 | | + | |
- | | 17 | | + | |
- | | 18* | + | |
- | | 19 | | + | |
- | | 20 | | + | |
- | | 21 | | + | |
- | | 22 | | + | |
- | | 23 | | + | |
- | | 24 | | + | |
- | | 25 | | + | |
- | | 26 | | + | |
- | | 27 | | + | |
- | | 28 | 2 | - | - | VDD | VCC3V3 | | + | |
- | | 29 | | + | |
- | | 30 | | + | |
- | | 31 | | + | |
- | | 32* | + | |
- | | 33 | | + | |
- | | 34 | | + | |
- | | 35* | + | |
- | | 36 | | + | |
- | | 37* | + | |
- | | 38* | + | |
- | | 39 | 39/40 | - | - | VSS/ | + | |
- | | 40 | 2 | - | - | VDD | VCC3V3 | + | |
- | | 41* | + | |
- | | 42* | + | |
- | | 43* | + | |
- | | 44* | + | |
- | | - | 1 | - | - | N/A | VIN/ | + | |
- | | - | 3 | - | - | N/A | USB5V0/ | + | |
- | | - | | + | |
- | * Indicates 5V tolerant pin on the PIC32MX150F128D | + |