You are on page 1of 12

GETTING STARTED WITH

PIC18F SERIES
MICROCONTROLLER
The first thing you need to write A program for the
MICROCONTROLLER is a pc program which understands
the programming language you use, C in this case, and
provides a window for writing program. Besides, the
software must know the architecture of the
microcontroller in use. In this case, You need A compiler
for C language. We are using mikroC pro compiler,
which you can download from MIKROELEKTRONIKA
website.
STEP 1: Download and Install MikroC Pro.
Create a Folder for this Project in any of your drivers.
Open microC Pro For PIC.
STEP 2: Click on Project >> New Project.
Also you can import the Sample Examples from the last option of the Project Menu.
STEP 3: Click on Next to create Standard project. Mostly you have to select standard project.
STEP 4: In This step you have to do Project settings.
Enter your Project Name as per your choice.
And Save the Project to Your Directory wherever you want to Save it.
STEP 5: In This you have to select Your Device Name which is on your Microcontroller IC
Select clock frequency for Your Microcontroller on which you want operate it.
Clock Frequency is the frequency of oscillator used with microcontroller.
Here we use PIC 18F4520 microcontroller with 8MHz crystal.
STEP 6: Here we can Add Source File If we have already which is the C file (.c extension files).
If not then just Click on the Next.
STEP 7: For including all the Default Libraries select Include All(Default).
Click Finish, to complete the New Project Wizard.
Then you will see the editor, where you can enter the MikroC Code.
STEP 8: Write your C code in void main which is our main function.
So here we just writing simple LED BLINKING code.
Save it, In your Project directory for your easy access.
STEP 9: Next To Compile the Project Click on the Build OR just press the CTRL+F9.
It Automatically generates the HEX file which is Machine understanding language.
And to Load the this Hex code to your Connected Microcontroller Click on the Build+Program
which you will get under Build Option Menu.
STEP 10: After the Successful compiling & Loading of the project compiler automatically open the
MikroC prog suite software, this software actually Burn your Hex file to Microcontroller
and shows the process status.
Also you can Burn any PIC program Hex file using this software by just loading it.