Delay Calculator
Convert between instruction cycles, microseconds, and milliseconds. Calculate delay loop parameters for precise timing.
Input Parameters
Calculation Results
Instruction Cycles:
-
Time (μs):
-
Time (ms):
-
Time (s):
-
Loop Count:
-
Assembly Code:
; Delay code will appear here
How It Works
PIC microcontrollers execute most instructions in 1 instruction cycle (4 oscillator periods). The delay calculation uses:
1 Instruction Cycle = 4 / FOSC
Simple Loop: 3 cycles per iteration
Nested Loop: Variable cycles per iteration
Triple Loop: Variable cycles per iteration
Simple Loop: 3 cycles per iteration
Nested Loop: Variable cycles per iteration
Triple Loop: Variable cycles per iteration
The calculator finds the optimal loop count to achieve the desired delay with minimal error.