Brian Griffin WROTE:Do not depend too much on the simulation. Interrupts are not simulated properly in software. Things can be wrongly simulated and this may produce even more misleading results. Test them on that chip.
For the Timer0, did you set it to 16-bit? All set up at the start? Double check the values.
If you want a one second interrupt from Timer0, you may need to double check the TMR0H and TMR0L values. The int_count variable is not probably neccessary at the first place.
Get a pencil and a paper and calculate this again, and come back to us if you have problems calculating it.
Hint: [ (Oscillator Freq.) / 4 ] / Prescaler = Timer0 Frequency.
Hello brian , nice to hear from you again ..
actually for pic 16f877a , TIMER0 is set to 8 bit .. , it is timer1 or timer2 which are of 16 bits ...
concerning the calculation . Among my readings , i did refer to this site : http://www.microcontrollerboard.com/pic ... orial.html
and from there , the Timer frquency calculation is different that ours .. very confused

But based on your formula ,
4 Mhz (internal Oscillator)
the Timer Frequency , will be = -------------------------------------------------
4 * 256(maximun prescaler value)
Timer Frequency = 3.906KHz
so the delay brought in , will be of 25.6ms ....