Jinx wrote: > If a 32.768kHz crystal is on TMR1 OSC pins, TMR1 will > increment at (32768 / 8) = 4096Hz > > Timer1 is 16-bits ( = h10000 = d65536) wide so it will "roll > over" from FFFF to 0000 (65536 / 4096) = 16 times per > second No. This is exactly why units should always be carried thru any calculations. (65536 increments/rollover) / (4096 increments/second) = 16 seconds/rollover. With a 1:1 prescaler you can get 2 seconds/rollover. If you want 1Hz = 1 second/rollover, then you have to diddle the timer value each interrupt. The easiest way is to write 80h to TMR1H upon interrupt. That effectively pre-loads the timer with 32768 so that there are only 32768 increments left until the next rollover. You can safely write to TMR1H if it is done soon after the interrupt because it will be 256 oscillator cycles before the first carry from TMR1L into TMR1H. > #define led portb,7 ;any I/O pin will do for LED > > w_temp ;you need these variables in the list > status_temp > counter > shadowb I don't know what you're trying to do here, but you can't just use a variable name as an opcode. What would you want it to do anyway? > movlw 0x08 ;or use .8 for a decimal value, see MPLAB > Help Please don't use the . syntax. For a while it was removed from the documentation. I think Microchip would like to get rid of it and keeps it for compatibility with ancient code. If the assembler ever support fixed or floating point formats natively, this could lead to lots of confusion, not to mention the confusion others will have that are not that familiar with this obscure corner of MPASM syntax. Personally I always set decimal as the default radix. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist