Which compiler do you use? C++ is rarely used in programming PIC micros.
You can use Microchip's C18 compiler.It's free and also have lots of library functions.You don't have to deal with calculations.Functions take of them.
Sorry...
Here to make the amendment....
The language I using for the project is C language and the compiler I using is MPLAB....
The pic is p18f4520......
My problem is my project requirement is how to use timer to generate delay...
I really need the answer and it's hard to me for search from the website that I couldn't find it...