I cannot give you the code, but I can tell you how to do it. Set up your Timer to give a timeout of x milliseconds. Set up a global variable that stores a counter. Set up the interupts to interrupt on Timer overflow. Inside the interrupt service routine, increment the global variable and setup your main code to look to see when the global variable reaches a certain value.
This is all assuming that your Timer cannot produce a delay of 1 second (and you need several loads of your Timer to produce 1 Second delay).
Also look into prescalers to slow down the incrementing of your Timer.
Sorry I cannot be of more assistance, but I am a PIC person (C and assembler)
Here is the code generated by the Delay Calculator/Generator given above, it is a code for a delay of 50ms, repeat it 20 times(run a counter to repeat the code by using a variable) :
//Configure and Enable timer.
//Timer Clk=12/12*1 = 1.0 MHz
hey guyz,i'm trying to write a programm using MPLAB IDE and the pic that i'm using is a 16F690 and my program has a delay on it but when i run it it giv me errors saying "symbol not previous defined" and is refering to the registers like status registers,ports and others. Did i mis something in my program?
hey guyz,i'm trying to write a programm using MPLAB IDE and the pic that i'm using is a 16F690 and my program has a delay on it but when i run it it giv me errors saying "symbol not previous defined" and is refering to the registers like status registers,ports and others. Did i mis something in my program?
If you would have given the program then it would have been possible to correct the error. Otherwise you can also use Multicalc for Delays and stuff using PIC's.