MPIDE Quick Start Guide

 

Overview:

In this tutorial, the standard “Hello World” program (blinking LED) is used to help familiarize you with the chipKIT™ Development Platform and  the Multi-Platform Integrated Development Environment (MPIDE) and basic language functions.

Reference:

During the course of this tutorial, various terms will be referenced including:

  • Sketch
  • Function
  • Variable
  • HIGH and LOW
  • INPUT and OUTPUT

We recommend that you read the following sections on the Arduino™ homepage to get a better understanding of these terms:

Hardware Used:

The hardware used in this tutorial will be the chipKIT™ uC32 manufactured by Digilent Inc. The reference guide for this board, schematics and other resources are available on the chipKIT™ uC32 homepage at: http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,1035&Prod=CHIPKIT-UC32 

Procedure:

  1.  To open MPIDE, navigate to the extracted files in the folder you selected when you downloaded the source files. Locate the MPIDE executable (Windows® folder shown): openMPIDE Double click the executable to open the MPIDE Hint: At this point it is a good idea to create a shortcut to the mpide.exe and place on your desktop.
  2. The first time you open MPIDE, you will be notified that a “sketchbook folder” will be created: scketchbookFolder
  3. In Windows, this folder will be located in the “My Documents” directory. Click OK to continue.
  4. The MPIDE Window should appear. Note the following main areas of the IDE Window: MPIDE Workspace button overview
  5. The chipKIT MPIDE comes with a variety of examples that can be used to help explore some of the various features of both the MPIDE and the chipKIT Platform. To access these examples, select File>Examples. examples
  6. Note that there are all kinds of examples from lighting an LED on the chipKIT Board to different types of displays.Under File>Examples>Basic, there is an example called Blink. This example blinks an LED on the chipKIT Board ON/OFF in 1 second intervals. This little program is what is known as the “Hello World” program as it is usually the first application new users create who are using a Microcontroller for the first time.This example could easily be opened and run as is. However, in order to highlight some of the features of the MPIDE, this example will be recreated from scratch.
  7. Save the current sketch by clicking the Save button. The default directory will be the mpide folder created when the MPIDE was first started. Name the sketch something meaningful. Click Save to close the window.Note: If you navigate to the mpide folder, there will now be a new folder with the name of the sketch you just saved. sketch folder
  8. In this part of the tutorial, you will create a simple routine that will blink LED 5 (LD5 top right corner of board) on the chipKIT uCO32 Board.LED 5  is physically connected to PIN 43 on the uC32 board.Add the following code into the MPIDE editor:
    int ledPin = 43;                 // LED connected to digital pin 26
    void setup()
    {
      pinMode(ledPin, OUTPUT);      // sets the digital pin as output
    }
    void loop()
    {
      digitalWrite(ledPin, HIGH);   // sets the LED on
      delay(1000);                  // waits for a second
      digitalWrite(ledPin, LOW);    // sets the LED off
      delay(1000);                  // waits for a second
    }
  9. There are quite a few things going on with this sketch. Under the “References” section at the top of the page, links are provided that will explain much of the content.
  10.  Make sure that the chipKIT uC32 is connected via the mini-B connector on the board and an available port on the computer.Note: The chipKIT Boards use the FTDI USB to Serial Converter chip during download. If this is the first time that the board is connected to this PC, the FTDI drivers may need to be installed. The directions for installing the FTDI drivers can be found on the Arduino™ website at: http://arduino.cc/en/Guide/Windows#toc4
  11.  In MPIDE, select Tools>Board>chipKIT uc32 to identify the uC32 Board as a target select board
  12. Next, select Tools>Serial Port>COMxx. This will depend on which port was assigned to the chipKIT uC32 Board when first connected.
  13. To load your sketch onto the chipKIT uC32 board’s Microcontroller, press the upload button. This will compile your sketch (check for errors) and then send to the Microcontroller.
 

Verifying Operation:

After the sketch is sent to the chipKIT uC32 board’s Microcontroller, LED 5 (LD5) on the chipKIT uC32 should flash on and off in 1 second intervals.

uC32LED5

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS