Difference between revisions of "Pic16f877a MPLABx Setup"
Line 4: | Line 4: | ||
=Keil Setup Steps= | =Keil Setup Steps= | ||
− | <b>Step1:</b> Open the | + | <b>Step1:</b> Open the MPLABx software and select the New project from File Menu as shown below.<br> |
− | + | ||
− | + | ||
− | + | ||
[[File:Pic16F877A_MplabX_Setup01.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup01.png]]<br><br> | ||
− | <b> | + | |
+ | <b>Step2:</b> Selcet the Standalone option for the project. | ||
[[File:Pic16F877A_MplabX_Setup02.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup02.png]]<br><br> | ||
− | <b> | + | |
+ | <b>Step3:</b> Choose the Controller(PIC16f877A) from the device drop down. | ||
[[File:Pic16F877A_MplabX_Setup03.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup03.png]]<br><br> | ||
− | <b> | + | |
+ | <b>Step4:</b> Select the required programmer. In this case it is Pickit2 the IC(PIC16f877A) from the drop down. | ||
[[File:Pic16F877A_MplabX_Setup04.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup04.png]]<br><br> | ||
− | <b> | + | |
+ | <b>Step5:</b> Choose the xC8/Hitech compiler which ever is installed. | ||
[[File:Pic16F877A_MplabX_Setup05.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup05.png]]<br><br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <b> | + | <b>Step6:</b> Provide the project name and select the project project folder. |
+ | [[File:Pic16F877A_MplabX_Setup06.png]]<br><br> | ||
+ | |||
+ | |||
+ | <b>Step7:</b> Now the required project is created. Create a new .c/main.c to write the code. | ||
[[File:Pic16F877A_MplabX_Setup07.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup07.png]]<br><br> | ||
− | <b> | + | |
+ | <b>Step8:</b> Save the file with C extension. | ||
[[File:Pic16F877A_MplabX_Setup08.png]]<br><br> | [[File:Pic16F877A_MplabX_Setup08.png]]<br><br> | ||
− | |||
− | |||
− | <b> | + | <b>Step9:</b> Type the code or Copy paste the below code snippet and save it<br> |
− | [[File: | + | [[File:Pic16F877A_MplabX_Setup09.png]] |
+ | <html> | ||
+ | <script src="https://gist.github.com/SaheblalBagwan/cb2cf78aadc724737d79.js"></script> | ||
+ | </html> | ||
+ | <br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <b> | + | <b>Step10:</b> Build the project and fix the compiler errors/warnings if any.<br> |
− | [[File: | + | [[File:Pic16F877A_MplabX_Setup10.png]]<br><br> |
− | <b> | + | |
+ | <b>Step11:</b> Code is compiled with no errors. The <b>.hex</b> file is generated.<br> | ||
+ | [[File:Pic16F877A_MplabX_Setup11.png]]<br><br> | ||
− | |||
− | |||
− | |||
=Uploading the Hex file= | =Uploading the Hex file= | ||
After generating the .hex file check this tutorial for [[LPC1768: Uploading Hex and Bin files|uploading Hex and Bin files.]] | After generating the .hex file check this tutorial for [[LPC1768: Uploading Hex and Bin files|uploading Hex and Bin files.]] | ||
<br><br> | <br><br> |
Revision as of 16:12, 22 April 2016
In this tutorial we will see how to setup a Mplabx project to generate .hex file for Pic16f877a
Keil Setup Steps
Step1: Open the MPLABx software and select the New project from File Menu as shown below.
Step2: Selcet the Standalone option for the project.
Step3: Choose the Controller(PIC16f877A) from the device drop down.
Step4: Select the required programmer. In this case it is Pickit2 the IC(PIC16f877A) from the drop down.
Step5: Choose the xC8/Hitech compiler which ever is installed.
Step6: Provide the project name and select the project project folder.
Step7: Now the required project is created. Create a new .c/main.c to write the code.
Step8: Save the file with C extension.
Step9: Type the code or Copy paste the below code snippet and save it
Step10: Build the project and fix the compiler errors/warnings if any.
Step11: Code is compiled with no errors. The .hex file is generated.
Uploading the Hex file
After generating the .hex file check this tutorial for uploading Hex and Bin files.