[sdiy] PIC16F84 ASM TMR0/Prescaler delay question
Rob B
cyborgzero at home.com
Wed Jan 2 06:12:28 CET 2002
OKAY, this is EXACTLY what I needed to hear! ;)
The TMR0 is being used to delay into the midi byte for a verfied start bit
for a software based uart routine, then its uses again to output a pulse..
The code is pretty convoluted, not exactly the way I would do it (well, once
I understand it better I might if its honestly better)
There is plenty of value left to be able to set the prescaler in TMR0... I
dunno, I always thought that you were supposed to use a middle value in your
OPTION register and then set your TMR0 accordingly so if you did add code or
change the speed it would be easy to reset the OPTION register to match up
the speed and not have to dig through the rest of the code..
Ah well.. Maybe I will sit down and do that after I get this project
finished, but I am in a time crunch.
Rob
----- Original Message -----
From: "The Old Crow" <oldcrow at oldcrows.net>
To: "Rob B" <cyborgzero at home.com>
Cc: "synth DIY" <synth-diy at dropmix.xs4all.nl>
Sent: Tuesday, January 01, 2002 9:27 PM
Subject: Re: [sdiy] PIC16F84 ASM TMR0/Prescaler delay question
>
> 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