Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

16F628 Delay routine Problem

Status
Not open for further replies.

janosandi

Full Member level 4
Full Member level 4
Joined
Jan 23, 2010
Messages
210
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,788
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

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
 

Just a guess; what crystal were you using with the 16F84? And the 16F628? Remember the 16F628 would default to its built-in clock.

Anand Dhuru
 

Just a guess; what crystal were you using with the 16F84? And the 16F628? Remember the 16F628 would default to its built-in clock.

Anand Dhuru

Thx Mr
Im using the internal oscillator of 16F628
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top