[sdiy] PIC16F84 ASM TMR0/Prescaler delay question

The Old Crow oldcrow at oldcrows.net
Wed Jan 2 03:27:44 CET 2002


On Tue, 1 Jan 2002, Rob B wrote:

> Okay, I have this bit of nifty code I got public domain, and it runs on
> 8mhz...
> 
> But, I have *loads* of 10 mhz parts, and I want to add a bit to the code
> too, so I def want the extra bit of speed..
> 
> Now, if I am porting it over to a 10mhz part from an 8mhz part, and want to
> make all the delays work properly, what should I do?
> 
> Should I change the value in TMR0?

  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.

Crow

/**/




More information about the Synth-diy mailing list