eBlocks : Embedded Systems Building Blocks
University of California, Riverside
Department of Computer Science
Riverside, CA 92521

MPLAB IDE - Compilation (.hex to be used with FPP + NOPPP programmer)

Compilation and Device Programming

  1. Setup Project Directory
    • Create directory C:\tut
    • Copy main.c into project directory.
  2. Start MPLAB IDE
  3. Start a new project
    • Project -> New
    • Fill in project name and directory, press OK

    • Project -> Add Files to Project...
    • Select the main.c file you downloaded. You should now see main.c added to your project.

  4. Set Configuration Bits
    • Configure->Configuration Bits...
    • Set Oscillator to INTRC I/O and set everything else to Off or Disabled by clicking on each row, your window should look like below

    • Close the Configuration Bits window by clicking on the "X" in the upper right corner
  5. Set Project Options
    • Project->Build Options...->Project
    • Select the HI-TECH Linker Tab, you should see the following

    • Check the Alternate Setting box and set it to -O"$(TARGETBASE).cod", click OK
  6. Select PIC device
    • Click on Configure->Select Device...
    • You should see the Select Device box shown below

    • In the drop down menu select PIC16F627, click OK. Although we are programming a PIC16F628, we chose the PIC16F627 since this is what is supported by the compiler currently used.
  7. Compile Program
    • Project -> Build All
    • You should see the below output window, since there are no error you are now ready to download the program

  8. You should now have a .hex file which can be downloaded to your PIC

eBlock Catalog
›   Yes/No eBlocks
›   Number eBlocks
Sample eBlock Systems
›  Yes/No eBlocks
›  Number eBlocks
Other Links
›   Related Projects
›   PIC Tools
›   Articles
›   Internal Documents