All, Or just add NOP's to fine adjust the routine. Regards, Jim On Thu, 04 January 2001, Drew Vassallo wrote: > > This should get you 0.985 seconds, which seems ok, unless you need better > precision: > > ;; Uses 2 registers as counters plus W > Delay_1sec > movlw 0x03 ; 3 * .328secs = .985 seconds > movwf Counter2 > clrf Delay_Count ; 256 loops @ 256*5us each ~= .328secs > clrw > Delay_L > addlw 0x01 > btfsc STATUS, Z ; check for overflow past 0 > decfsz Delay_Count > goto Delay_L > decfsz Counter2 > goto Delay_L > return > > If you need better precision, you can preload Delay_Count with a lower value > to make it overflow faster for the first loop, then increase Counter2 from > 0x03 to 0x04 to get that extra 15ms you need to bring it to 1.000 seconds. > I'll let you do the math. > > --Andrew > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. jim@jpes.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.