[sdiy] PIC16F84 ASM TMR0/Prescaler delay question

trevor at resonance.fsnet.co.uk trevor at resonance.fsnet.co.uk
Wed Jan 2 15:14:51 CET 2002


>   Are delays being rigged off of the timer?  Not all pic asm routines do 
> this.  If you are increasing the clock from 8 to 10, then time delays need 
> o be increased by the same (10/8=1.25) proportion.  TMR0 is a 
> down-counter, so whatever value it is loaded with at 8MHz needs to be 1.25 
> times larger at 10MHz.  The only caveat here is that the new value, if 
> larger than 255, will not work.

On PIC16F84 devices, TMR0 isn't a down counter - it increments. Interrupt occurs on overflow from FFh to 00h. Therefore, writing a smaller value to the Timer0 register will actually result in a longer time delay (takes longer to count to FF). Therefore writing a value 1.25 x the original value won't work. 

Or did you mean something else? Have I got the wrong end of the stick here?

Cheers,

Trevor.





_______________________________________________________________________
Never pay another Internet phone bill!
Freeserve AnyTime, for all the Internet access you want, day and night, only £12.99 per month.
Sign-up at http://www.freeserve.com/time/anytime





More information about the Synth-diy mailing list