Instruction Cycle Calculator
Calculate execution times for PIC assembly instructions and analyze program timing for precise control applications.
Input Parameters
Calculation Results
Total Instructions:
-
Total Cycles:
-
Execution Time (μs):
-
Execution Time (ms):
-
Instruction Rate:
-
Cycle Time:
-
Timing Analysis:
; Timing analysis will appear here
Instruction Cycle Reference
Single Cycle (1 cycle)
- ADDWF, ANDWF, CLRF, CLRW
- COMF, DECF, DECFSZ, INCF
- INCFSZ, IORWF, MOVF, MOVWF
- NOP, RLF, RRF, SUBWF
- SWAPF, XORWF
Branch Instructions (2 cycles)
- BTFSC, BTFSS (skip = 2 cycles)
- DECFSZ, INCFSZ (skip = 2 cycles)
- GOTO (2 cycles)
Call/Return (2 cycles)
- CALL (2 cycles)
- RETURN (2 cycles)
- RETLW (2 cycles)
- RETFIE (2 cycles)
How It Works
PIC microcontrollers execute most instructions in 1 instruction cycle, which equals 4 oscillator periods:
1 Instruction Cycle = 4 / FOSC
Execution Time = Number of Cycles × Cycle Time
Execution Time = Number of Cycles × Cycle Time
Branch instructions that skip the next instruction take 2 cycles instead of 1, and call/return instructions also take 2 cycles.