14
8/8/2019 Hitech c Pic User Guide http://slidepdf.com/reader/full/hitech-c-pic-user-guide 1/14 HI-TECH C CROSS COMPILER :  Create a Project on MPLAB IDE This is the default view of MPLAB IDE after you open it.  To create a new project, click Project and Project Wizard.

Hitech c Pic User Guide

Embed Size (px)

Citation preview

Page 1: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 1/14

HI-TECH C CROSS COMPILER :

 

Create a Project on MPLAB IDE 

This is the default view of MPLAB IDE after you open it.

 

To create a new project, click Project and Project Wizard.

Page 2: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 2/14

 

At the first page of Project Wizard, click Next.

 

Page 3: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 3/14

Next, you will need to select the device for your project. For this demonstration I will use

PIC16F877A as the device. After selecting the device, click Next.

 

 

Now, the step two, you need to select the compiler for your project. For your information, thereare quite a number of C compiler available for PIC16F and PIC18F. If you read the Install

MPLAB IDE page, you will found out that at the end of the installation, the installer will prompt

out a HI-TECH C (PIC 10/12/16) installer. That HI-TECH C compiler is the compiler that we

will use as the compiler for PIC16F877A. So, please make sure that you do follow the instruction

to install the HI-TECH C compiler.

Page 4: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 4/14

 

If you click the Active Toolsuite, it will list down all the Toolsuite that is supported for the

device you have selected in the previous step.

 

Page 5: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 5/14

In the next diagram, I purposely select a Toolsuite that is not installed on My PC, the CCS C

Compiler. Please take note that there will be a red colour “X” beside the CCS C Compiler, and

that “X” is actually the sign to let you know that the selected Toolsuite is not installed or notfound.

 

Now, select HI-TECH Universal ToolSuite, and the red “X” should disappear (for those with the

red “X”, please reinstall the HI-TECH C for PIC 10/12/16, download page). Click Next tocontinue.

Page 6: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 6/14

 

Now the step three, you need to select the directory to store your project and your project name.

Click on Browse to open a browser where you choose the directory and the project name. It is

advised that you use a new folder for a new project, and all the coding file (c file, h file, asm file,

…. ) should be stored under the same folder. 

Page 7: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 7/14

 

 

Step four, add existing file to your project. In this step you can include the coding file (template,

or existing code) to your project. If you don’t have those file now, just skip this step, you can

always add existing file even after you create the project

Page 8: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 8/14

 

Congratulation, you have successfully created the project. Click Finish to continue.

 

Page 9: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 9/14

The project that you create, will be open after you successfully create it, and this is what you will

see at the IDE, a Project window and an Output window. If you don’t have these window on

your IDE, you can always enable it back by clicking View and check the Project and Output.

 

For me, I don’t like how all the windows shown on the IDE. I will make all these window“Dockable”. To do so, right click on the top right cornel of the window, and select Dockable.

Then you will need to arrange those “Dockable” window nicely according to how you like it.

 

Page 10: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 10/14

 

To save the customized view, with all the windows Docked, you can save the view (MPLAB call

it “Window Set”). Click on Window, and click Create Window Set. Insert a name for the

Window Set as you like.

 

Next time, if the window mess around, you can simple click on Window > Window Sets >

[Window Set name] to restore it back.

Now you have all the window arrange nicely, you may continue to add the coding files to your

project. Click on the icon (New File) to create a new file. Please take not that this new file

Page 11: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 11/14

doesn’t create the file type yet. You will need to determine the file type (c file, asm file, h file)

when you save the file.

 

After create the new file, now save it. Click File and Save As.

 

To save it as a c file, put a “.c” at the File name of the file to save. This is same for “.asm”, “.h”,

…, and please save the file at the directory of the project. 

Page 12: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 12/14

 

So, even if you already save the file, same directory as your project, it is not included in your

project yet. This is same when you copy a code file into your project folder, it doesn’t

automatically include that file to your project, which also means that it will not compile the file

when you compile your project. To include a file into your project, right click at the Source File,

and click Add Files.

 

Select the file that is being saved.

Page 13: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 13/14

 

Now the code file “main.c” is added to your project. You can see that it is shown under the

Source Files at the Project window. Please take note that all the files in your project will be

divided according to the file type. For example “.c” file will be under the Source Files, “.h” file

will be under Header Files, “.o” file will be under Object File and …. 

 

 

 

Page 14: Hitech c Pic User Guide

8/8/2019 Hitech c Pic User Guide

http://slidepdf.com/reader/full/hitech-c-pic-user-guide 14/14

To compile the project, click on the Build Project button or the Rebuild project button.

 

---------------------------------------------------------------------------------------------------------------------

----Nitin