3 Delay Ecuation PIC16f877A (20MHz)

Thread Starter

Alexander Abad 1

Joined Feb 24, 2019
1
This is from a program...

; Delay = 1 seconds
; Clock frequency = 20 MHz

; Actual delay = 1 seconds = 5000000 cycles
; Error = 0 %

cblock
d1
d2
d3
endc

;5000000 cycles
movlw 0x2D
movwf d1
movlw 0xE7
movwf d2
movlw 0x0B
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0

I have this 0.2uS for each cycle

Inner loop 5*(d1-1) + 2
Second loop ((5*255)+5)(d2-1) + 2

with that I know the inner loop and second loop but I dont know why in the the third loop it has 5000000 cycles, Please anyone can help me with that ecuaction?
 
Top