It makes me sad that so many people are trying to help you and you are saying that you'll do it when you want to.
Not including the while loop may(and probably will) cause your program to not function the way you'd like.
Now, that being said, I think most PIC programs should be in the following form:
Now, then... Read through the section on the ADC module in the 16F877A datasheet. You'll find a register called ADCON1 on page 130. Read about it.
As a bit of a preemptive answer to another thread on the subject, one thing to note about an actual 16F877A, there is no internal oscillator, you'll need to provide a clock/crystal.
Not including the while loop may(and probably will) cause your program to not function the way you'd like.
Now, that being said, I think most PIC programs should be in the following form:
Rich (BB code):
(includes)
void Initialize();
void main()
{
Initialize();
while(1)
{
//this is repeated endlessly
}
}
void Initialize()
{
//Initialize your device
}
As a bit of a preemptive answer to another thread on the subject, one thing to note about an actual 16F877A, there is no internal oscillator, you'll need to provide a clock/crystal.