It compiles to this:So as far as I can see the part IN the actual loop takes either 5 or 6 cycles, then the jump back to the start of the loop is another 2 cycles.Code:0001 M L00001 0001 140F M bsf PORTD, 000h 0002 3000 M movlw 0 0003 188F M btfsc PORTD, 001h 0004 3001 M movlw 1 0005 00BA M movwf _Sw1 0006 33FA M bra L00001
At 32MHz each instruction cycle is 125ns.
It doesn't seem to make any difference if it's for a 16F or 18F but be aware that if you have the WDT enabled it's possible that the compiler "injects" an instruction to clear it depending on where, in a larger program, this snippet ends up.
/Henrik.




Bookmarks