As promised, the link I was referring to in previous posts regarding PIC delay loop calculation. It is part of Sean Hugh Breheny's page which has other useful PIC info. http://www.people.cornell.edu/pages/shb7/lop.html Regards, Simon. --- At 05:19 PM 8/5/02 -0400, Michael A. Powers wrote: > bsf PORTB, 4 > bsf PORTB, 1 ;--------------------- > ; delay for at least 2ms > movlw 0x95 > movwf Dlay > movlw 0x02 > movwf Dlay + 1 > decfsz Dlay > goto $ - 1 > decfsz Dlay + 1 > goto $ - 3 > > bcf PORTB, 4 ; -------------------- > >When I measured this on an oscilloscope, the actual delay came to be 1.2 >ms. >If anything, it should be greater than 2 ms because I did not take the >extra >cycles that occur each borrow. Does each subtraction that does not borrow >take 3us to complete? (1us for decfsz, 2us for goto) -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.