1) First of all, we need a project. Each microcontroller program needs a project to generate a hex file. Go to Project > Project Wizard

2) You will be brought to the Project Wizard window. Click on Next

3) Choose your PIC Device. In the autocar case, use the PIC18F4520. Note that the picture shows PIC18F452.

4) There after, hit Next

5) You will be brought to the Language Toolsuite selection. This part is to make your C programming file compiled into Hex file. Hex file is the program to be loaded into the microcontroller

6) If everything goes well, the assembler, compiler, linker and librarian will be found by the MPLAB. Make sure to install the Microchip C18 C compiler first. If somehow the content cannot be found, you will have to browse to the installation file for the C18 C compiler. Hit Next

7) Click Browse

8) Browse to a desired folder and enter a project name. Hit Save

9) Then Hit Next

10) We can skip this step. This is actually the part to select you desired H file and C file. Since we have not yet created the C file or H file, we can skip this step. We will show you next on C file creation.

11) After that, we will be brought to the workspace. For ease, bring out the project window and output window. Go to View > Project

12) Click on Output too.

13) We shall proceed to the C file creation. Go to File > New

14) Enter the include and main function in the MPLAB IDE Editor to include the p18f4520.h header file. Note that this file is an extension-less file. Which means it don't have .txt or .c or .h or anything.

15) Next, we shall save the file. Click File > Save As...

16) For ease, save the file in the folder where you have created the project. REMEMBER to save with .c extension

17) Note that the text in the editor will change to C file compatible colours.

18) Although the file was created, it have not yet been added into the project. Right click on the source file in the project panel and click add file.

19) Choose your C file.

20) Then we are ready. Hit on Build All...

21) If everything goes well, we will see Build Succeeded. If anything goes wrong, try to see what is the error from the Output panel. Try to solve it yourself first, only seeking help from the members.