Thanks for your reply mister_e. Tomorrow i will try in PBP and i will tell you my results.
Thanks for your reply mister_e. Tomorrow i will try in PBP and i will tell you my results.
i am using darrel's interrupts and 20MHz crystal. With mister_e calculator i found that i want prescaler 1:32 and preload 99 into tmr0.I don't know how to preload the value into timer.below i have the interrupt routine of my program. Is this correct for preload the value?
'---[TMR0 - interrupt handler]--------------------------------------------------
Tick0: ;every 1ms occurs
;make space for new sample
cp_old=cp_new ;save old value
cp_new.highbyte=CCPR1H ;take new capture
cp_new.lowbyte=CCPR1L
gosub samplebit ;take the sample bit
TMR0=99
@ INT_RETURN
thanks
if you're still using the 16F876 and want to have an interrupt each ~1mSec.. then yes.
Easy huh?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks mister_e.it was very easy to be true. I would like to ask you what is in your timer calc the re-load variable because i can't understand it.
thanks again for you reply.
regards
If you know how much clock instruction cycle it takes to reload your timer, you set Reload (instr. cycle) (some call it fudge factor) with this value to fine tune your Preload results.
If you don't know AND/OR don't need 100% accuracy, just forgive it
I understand how and why i'd place it there... but the language barrier stop me today... Darrel, Bruce, someone?
Last edited by mister_e; - 13th April 2008 at 21:58.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks