> use timer 2 in time delay calculation Are you still counting pulses per sec ? Timer2 is an 8-bit timer, with a maximum 1:16 prescaler and a maximum 1:16 postscaler. This makes it effectively a 16-bit timer with upper byte resolution If you want to time exactly one second then you'll have to work out how many instruction cycles of your oscillator that will take Assuming you use the full pre- and post- scalers, the simplest way would be to choose a crystal that has a hex value and is divisible by 256, as that will be the coarseness of Timer2 For example, say you choose 19.6608MHz, which is close to the maximum speed of the 16F887 Fosc =3D 19.6608MHz, Fcy =3D 4.9152MHz. Divide by 256 (the scaler count) and then divided by 256 (the TMR2 register count) this equates to exactly 75 TMR2 interrupts per second So, you set TMR2 to free-run, with no loading. Just let everything roll over Every time the postscaler rolls over, it generates a TMR2 interrupt. In the ISR you increment a RAM register and test for 75. Or set the RAM register to 75 and count down, testing for 0. Either way, there's your second If you choose a different crystal then obviously a different number of interrupts per sec will be generated A decimal crystal, such as 10.0000MHz, is going to require TMR2 reloads, because it is not exactly divisible by 2^x Joe --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .