janosandi
Full Member level 4
Hello Friends
I have a small problem with 16f628 delay routine which i couldnt just imagine Why it happens
i have a delay routine working on 16F84 which i've copy & paste it in my program
Would u plz check this with me
the firat one is for only 1 second which it works good
The previous Code works fine for 1 second Delay But the problem is when i need to multiply the time
if i add only just other Decfsz with number 0x02 it make about 50 seconds delay
In this Code the delay must be only 2 seconds But i have about 50 seconds delay
Anyone have an idea can help me with it
Thx Guys
I have a small problem with 16f628 delay routine which i couldnt just imagine Why it happens
i have a delay routine working on 16F84 which i've copy & paste it in my program
Would u plz check this with me
the firat one is for only 1 second which it works good
Code:
SettingCounters movlw 0xA7
movwf COUNT1
movlw 0x18
movwf COUNT2
movlw 0x06
movwf COUNT3
movlw 0x02
movwf COUNT4
return
HalfSecDelay decfsz COUNT1,1
goto HalfSecDelay
decfsz COUNT2,1
goto HalfSecDelay
decfsz COUNT3,1
goto HalfSecDelay
Call SettingCounters
return
The previous Code works fine for 1 second Delay But the problem is when i need to multiply the time
if i add only just other Decfsz with number 0x02 it make about 50 seconds delay
Code:
HalfSecDelay decfsz COUNT1,1
goto HalfSecDelay
decfsz COUNT2,1
goto HalfSecDelay
decfsz COUNT3,1
goto HalfSecDelay
decfsz COUNT4,1
goto HalfSecDelay
return
In this Code the delay must be only 2 seconds But i have about 50 seconds delay
Anyone have an idea can help me with it
Thx Guys