Hi,
As Richard pointed out earlier, something like TRISA = %11111100 or PortA = %00000001 compiles to TWO assembly instructions:
movlw low (0FCh)
movwf TRISA
each taking one instruction cycle. If the PIC is clocked at 4MHz, one instruction cycle is 1us so TRISA = %11111100 takes two us.
The Goto MainLoop compiles to a bra instruction which takes two instructions.
Your complete program executes in 14 cycles, or 14us at 4MHz.
Then, as have also been pointed out, the compiler MAY inject a clear WDT instruction. Turn it off and tell the compiler to stop tickle the dog if you want to be sure.
/Henrik.
Bookmarks