Thanks to visit codestin.com
Credit goes to www.scribd.com

100% found this document useful (1 vote)
166 views11 pages

C18 Compiler Installation Guide

The document provides a guide for installing the C18 compiler in MPLAB IDE and creating a basic project to blink an LED using a PIC18F2550 microcontroller on a Bolt system board. It includes steps to download and install the C18 compiler, download a compiler project template for the Bolt board, create a new project in MPLAB configured to use the compiler tools, write a simple LED blinking program, and compile and run the program on the Bolt board.

Uploaded by

Jarfo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
166 views11 pages

C18 Compiler Installation Guide

The document provides a guide for installing the C18 compiler in MPLAB IDE and creating a basic project to blink an LED using a PIC18F2550 microcontroller on a Bolt system board. It includes steps to download and install the C18 compiler, download a compiler project template for the Bolt board, create a new project in MPLAB configured to use the compiler tools, write a simple LED blinking program, and compile and run the program on the Bolt board.

Uploaded by

Jarfo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1

GUIDE FOR THE INSTALLATION OF C18 COMPILER IN MPLAB IDE


Index:
1. How to install C18 compiler
2. How to download a C18 template folder
3. How to create a C18 project in MPLAB
4. How to write a new program and compile
1. How to install C18 compiler
-Previously, you should have already installed MPLAB IDE software in your PC. If you have
not done so, please refer to the following guide:
http://puntoflotante.net/MPLAB-IDE-INSTALLATION-GUIDE.pdf

- Please download C18 installation files directly from Microchips site:


http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010014

Once in Microchips site, choose to download this file: MPLAB C for PIC18 v3.46 in LITE mode.
And the name of the downloaded file is:
mplabc18_v3.46_windows_lite.exe.

C18 compiler installation guide. Punto Flotante, S.A. 2013

2
-Execute file. Click to accept licence agreement. Next.

-this window shows the path where the compiler will be installed.

C18 compiler installation guide. Punto Flotante, S.A. 2013

3
-Continue installation. When the last window appears, click Finish.

- The installation program generates 4 applications: mcc18.exe (compiler), mplink.exe (linker),


mplib.exe (library management) and MPASMWIN.EXE (assembler). These 4 applications must
be included by the user in any C18 project, following the instructions given right away.
2. How to download a C18 template folder for Bolt 18F2550 system
- Download the .zip file with the template files and libraries for 18F2550 Bolt system from the
following link:
http://puntoflotante.net/BOLT-18F2550-PROGRAMS/C18-BOLT-TEMPLATE-AND-LIBRARIES.zip

C18 compiler installation guide. Punto Flotante, S.A. 2013

-Extract the files and you will have a project folder looking like this:

This a C18 project folder for the Bolt 18F2550 system. It includes a template source file (.c),
several libraries for Bolt system (.h) and the linker script (.lkr).
By using this folder as a template for your C18 projects, you guarantee that the compiler will
operate without errors and that within MPLAB IDE software, you will be able to load the
executable files in the Bolt 18F2550 board.
Now go to next step and create a C18 project in MPLAB.

C18 compiler installation guide. Punto Flotante, S.A. 2013

5
3. How to create a C18 project in MPLAB
Open MPLAB IDE and select option Project wizard. Select microcontroller 18F2550

***THIS IS A VERY IMPORTANT STEP***


In the next step (Step Two), select "Microchip C18 Toolsuite" and assign one by one, the four
applications with their corresponding path using the "Browse" button.
The paths where the 4 applications are located are:
C:\Program Files (x86)\Microchip\mplabc18\v3.40\bin
(for mcc18.exe, mplink.exe and mplib.exe)
C:\Program Files (x86)\Microchip\mplabc18\v3.40\MPASM
(for MPASMWIN.EXE)

C18 compiler installation guide. Punto Flotante, S.A. 2013

In step 3 (Step Three), use "Browse" to locate the template folder where your files of C18
project are stored. Remember that you have already this folder available.

C18 compiler installation guide. Punto Flotante, S.A. 2013

7
Once in the Project folder, just type the first letter of the name of source file. Choose that
name (BOLT-C18-TEMPLATE) and erase the last two characters, ie .c, so that the name of
project is the same as the name of the source file. Click Save.

Click on Next:

C18 compiler installation guide. Punto Flotante, S.A. 2013

8
In the next window (Step four) select the files of your project in the left window and then the
Add option to pass them to the right window. In this case you will have in your project: the
template source file (.c), a library file (.h) and the linker script (.lkr). Click Next.

Click on Finish to end

C18 compiler installation guide. Punto Flotante, S.A. 2013

9
4. How to write a program and compile
This is the window you will see in MPLAB, after finishing the creation of C18 project:

Edit the source file .c before compiling, adding the following lines to the main function, as
shown. This program will flash led B0 every 500 ms in your Bolt 18F2550 system.
void main( )
{
init_bolt( );
loop:
RB0=1;
delay_ms(500);
RB0=0;
delay_ms(500);
goto loop;
}

//initialize ports

//flash led B0.

C18 compiler installation guide. Punto Flotante, S.A. 2013

10
Your MPLAB window will look like this:

Then choose options Project and Built all to compile. The window below shows a
succesful compilation:

C18 compiler installation guide. Punto Flotante, S.A. 2013

11
Go to the your original project folder, and observe, among many others, the executable file
(.hex) created by the compiler and ready to be loaded in the system Bolt 18F2550:

Load this file to your Bolt 18F2550 system using software Bolt v.1.0.1. If you havent done so
before, use this guide:
http://puntoflotante.net/BOLT-18F2550-SYSTEM-PROGRAMMING-MANUAL.pdf

This program will flash led B0 every 500 ms in your Bolt 18F2550 system!

Should you have any questions please contact:


[email protected]

C18 compiler installation guide. Punto Flotante, S.A. 2013

You might also like