I suggest you start your project with downloading the datasheet for the 16F877A and read it. You dont have to understand more of the datasheet than to remember that you have seen something about this...