you misunderstoot my post. TIMER0 is what i want to use for this new function, i'm already using, or are planning on using, TIMER1 and TIMER2 On Mon, 11 Jun 2001 13:04:37 -0400, Olin Lathrop wrote: >I never got the original of this message for some reason. > >> >16F877 chip @ 4 Mhz >> > >> >i'm considering using the timers in a project .. what i'd like is an >> >interrupt every .250 seconds >> > >> >i'm already using timer2 for PWM >> >i'd *like* to use timer1 for a counter >> > >> >somebody check my math for me please : >> > >> >timer0 runs at 1 Mhz (Fosc/4) .. >> > >> >most prescale you can get is 256 .. >> > >> >8 bit counter .. >> > >> > >> >working all this out, the *slowest* i can get timer0 to run (on my >> >calculator) is .065536 seconds >> > >> >is this right ? > >No. Timer 1 has a 3 bit prescaler (divide by 1, 2, 4, or 8), but is a 16 >bit counter. You want an interrupt every 250,000 instructions. With a >prescaler of 4, you want an interrupt every 62,500 timer 1 increments, which >is within its 16 bit range. You can use the second CCP to automatically >provide the period value, or you can interrupt on timer 1 overflow and then >adjust timer 1 in the interrupt routine to "skip over" the extra 65536 - >62500 = 3036 increments. > > >******************************************************************** >Olin Lathrop, embedded systems consultant in Littleton Massachusetts >(978) 742-9014, olin@embedinc.com, http://www.embedinc.com > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads