Hello,
I'm starting with TMR0 interrupts handling and I'm completely lost in how to calculate all different timings.
Please correct me if I'm wrong!!!
As far as I got up to now, I gathered following informations:
a) the main PIC's "clock" is equal to the oscillator frequency;
b) at 4MHz, my PIC will handle around 1'000'000 instructions per second;
c) without Prescaler, 1 instruction will last 1us;
d) with Prescaler set to "1:4", 1 instruction will last 4us(?);
e) TMR0 will count from 0 to 255;
f) the PIC will generate an Interrupt when TMR0 reaches 255.
My questions are:
g) how do I know how many cycles this or that instruction needs?
h) how do I calculate the time for a TMR0 overflow?
Actually, I'm very confused and all documentation I have don't explain clearly how it works starting from the very beginning.
Thank you for your help.
Bookmarks