Showing posts from March, 2014

How to set Configuration bits in Code PIC16F877.

This post will provide a tutorial of how to set configuration bits in code for PIC16F877 an 8 bit microcontroller from microchip. Configuration bits are special features registers in CPU described in section “14 named Special features of the CPU” in datasheet of PIC16F877. This method also works for all PICs. Code is written in C language and I used the latest compiler XC8 with MPLABX IDE.
In this post I assumed that you must know following if not then please read them before proceeding further "How to use MPLAB X IDE".
You may download code, schematic and Proteus simulation from the download section at the bottom of this page. I am using MPLAB X IDE, XC8 Compiler.
Setting configuration bits allows you to start microcontroller from very basic level. So here is a shortcut. But you must know what these register means by reading the section 14 of datasheet. When you done with the code use following to set configuration bits easily. Go to windows->PIC memory Views->Configur…