Introduction and purpose of the IDE
MPIDE (Multi-Platform Integrated Development Environment) is an Arduino-like project of chipKIT™, which allows you to reprogram the board with different custom sketches. The IDE is free and can be downloaded from their official site.
It is used to reflash the program memory of the microcontroller without an external programmer after a bootloader (check Software tab) is uploaded.
As a difference of the other similar IDEs (like Arduino, Maple, Pinguino etc.) this one gives you the opportunity to work with different kind of microcontrollers. You don't have to change the IDE, in case you need to work with another family of microprocessor.
MPIDE inherits all the core functions from Arduino IDE. In addition to these it has some specific libraries.
Without any modifications MPIDE 0.023 provides the following libraries:
- SD card
- Software Serial
- Wire (I2C)
and for chipKit there are few additional libraries:
Detailed information about all of them can be found on the page chipKIT™ Libraries
For all those libraries chipKit™ also provides an examples to demonstrate functionality of all of them. In addition to all these they have also simple examples like blinking LED, push button, serial communication etc.
Inside the IDE there is an embedded Serial Monitor which allows you easily to communicate with the host computer via virtual USB COM port. This is possible only when the board is not in programming (bootloader) state. So with this feature you don't need an external terminal program like PuTTY, Siow, HyperTerminal, TeraTerm etc. in order to transfer data between the host and the device.
In order to adapt bootloader for your custom board, chipKIT™ are providing source code of their projects on GitHUB: chipKIT™ bootloaders
Uploading of the bootloader requires external programmer (for example PicKit3).
For this moment Olimex provides support for 6 of our boards:
1) PIC32-Pinguino and MPIDE Library
2) PIC32-Pinguino-OTG and MPIDE Library
3) PIC32-Pinguino-Micro and MPIDE Library
4) PIC32-T795H and MPIDE Library
5) DUINOMITE-MEGA and MPIDE Library
6) DUINOMITE-eMEGA and MPIDE Library
Each of these libraries consist of:
1) Demo (dir)
1.1) Demo description.txt - description about the demo and the menu displayed on the terminal
1.2) Demo.pde - this is the sketch witch to be compiled and uploaded with MPIDE
2) Olimex_<board name> (dir) - the files inside contain the pinout of the board
3) MPIDE board selection.txt - this text should be appended to "..\MPIDE 0.023\hardware\pic32\board.txt". When this is done the board will be visible inside the MPIDE
4) MPIDE <board name> bootloader.hex - this is the prebuilt hex file of the bootloader for the respective board
5) ReadMe.txt - a short help file which describes the pins of the board and the steps to make this library work
Q1: Why I can't upload to the board the sketch which I just compiled.<br\>
A1: Check whether your device is recognized as "chipKIT USB Serial" in Device Manager, sections "Ports (COM & LPT)" or "Other Devices" (in case you didn't install the drivers). If there is no such device the bootloader isn't available. In this case check question 2.<br\>
A2: Did you select the right Serial port number inside the MPIDE?<br\>
A3: Is the device in programming state (bootloader mode)? Is the Green LED blinking? If no - then reset the board while you hold the user button.<br\>
A4: Close any kind of terminal programs that uses the same serial port (including the the embedded terminal of MPIDE) and reset the bootloader.<br\>
Q2: When I connect the board to the host computer I can't find the "chipKIT USB Serial" in the Device Manager. Why is that happening?<br\>
A: Initially all these boards were designed for other purpose:<br\>
Pinguino, Pinguino-OTG and Pinguino-Micro - for Pinguino IDE, so they are programmed with Pinguino bootloader;
PIC32-T795H, DuinoMite Mega, DuinoMite eMega - for DuinoMite Basic interpreter and they have the DuinoMite bootloader.<br\>
So by default none of these 6 boards have the MPIDE bootloader and before everything else you must program them with MPIDE bootloader in the archive using external programmer. After this you won't need it (the programmer) to update the firmware.<br\>
Q3: Why I can't find the board I want from: "Main menu --> Tools --> Board --> ..."?
A1: Did you append the content of the file "MPIDE board selection.txt" to the end of "..\MPIDE 0.023\hardware\pic32\board.txt" file?
A2: If you have already done it - restart the MPIDE. The changes will not take effect until reboot.
Q4: Why I get errors when trying to compile a simple project (or the demo) with any of your boards?
A1: Did you copy the folder with pinout description (Olimex_<board name>) to the directory: "..\MPIDE 0.023\hardware\pic32\variants"?
A2 If you have already done it - restart the MPIDE. The changes will not take effect until reboot.
Q5: Which of the pins on the processor are accessible with this library?
A: Most of the pins which can be manipulated with this software are extended to the connectors. For example: Pinguino, Pinguino-OTG and DuinoMite boards have the "Arduino connectors"; Pinguino-Micro has 2 connectors of 20 pins; PIC32-T795H 1 connector of 48 pins; DuinoMite eMega has Parallel Master Port; and all of the boards have UEXT. All those extension pins connected to GPIO ports on the processor are accessible.
There are also exceptions like Pinguino's RD1 (Yellow LED) which isn't connected to extension but is still accessible.
Q6: How can I understand which pin of the processor of which number (in the mapping of the IDE) it corresponds?
A: The easiest way to find out is to check the "ReadMe.txt" file inside the library archive. There you can see connector's name and the numbers of the pins included in this connector.
Q7: How can I understand which ANALOG pin of the processor of which number it corresponds?
A: Pinguino, Pinguino-OTG, DuinoMite Mega and DuinoMite eMega, they have separate connector for only analog pins. So you can just check the "ReadMe.txt". But for Pinguino-Micro and PIC32-T795H isn't so simple since they don't have such connector but instead their analog pins are just scattered among the digital pins. So you have 2 options:
1) look at the schematic where the pins with analog functions are extended and their number on the extension. This is the number you need.
2) Open "Board_Data.c" file (the one with pinout description) and find the definition of the array "digital_pin_to_analog_PGM". All the pins that have analog functions must have value like this: _BOARD_AN<x>, where 'x' is the number of analog pin on the processor. If the value is: NOT_ANALOG_PIN - then this pin has no analog function.