hi guys,
i'm now trying to use Timer0 of 16f877a to overflow every 6.25ms. So this is how i calculate the TMR0 value. i'm using 4Mhz XTAL. and my prescaler is set to 1:256.
4Mhz/4= 1Mhz
1Mhz/256 = 3906.25hz
1/3906.25hz = 256us
6.25ms/256us=24.41
256 - 24.41 = 231.58
so i decided to use 232 as my TMR0 value. So am i correct?
in my program, i complement my LEDs everytime interrupt occur which mean every 6.25ms. But when i measure the period from my logic analyzer i found that the period time is not correct. SO i'm wonder maybe is my calculation problem or other .
thank you.
i'm now trying to use Timer0 of 16f877a to overflow every 6.25ms. So this is how i calculate the TMR0 value. i'm using 4Mhz XTAL. and my prescaler is set to 1:256.
4Mhz/4= 1Mhz
1Mhz/256 = 3906.25hz
1/3906.25hz = 256us
6.25ms/256us=24.41
256 - 24.41 = 231.58
so i decided to use 232 as my TMR0 value. So am i correct?
in my program, i complement my LEDs everytime interrupt occur which mean every 6.25ms. But when i measure the period from my logic analyzer i found that the period time is not correct. SO i'm wonder maybe is my calculation problem or other .
thank you.