how can i get a 1 msec delay ?

Status
Not open for further replies.

zika1212

New Member
i'm using pic16f84a and programming it using assembly ,,
how can i write a code to get a 1 msec delay ??
 
According to my test's on MPLAB 6.42 this will give you exactly 1000uS delay using 4MHz clock.

Code:
DEL	MOVLW	.2         ;Delay start here, count back onece from 75 and onece from 255.
	   MOVWF	DELF2      ;990 cycle plus the 4 mov cycle=4 and the 2 goto=6 Equall 1000 cycle.
	   MOVLW	.75        ;=1ms
	   MOVWF	DELF1
DEL0  DECFSZ  DELF1      ;Start decrementing the file registers.
	   GOTO	 DEL0
	   DECFSZ  DELF2
	   GOTO	 DEL0
	   RETURN             ;Go back if is done

I'm sure there is other way to do it, I just can't find it right now.
ps:I'm learning assembler myself to
Comments are welcome.

STEVE
 
What a relief, I thought I'm on their BLACk LIST.

I don't get the NOT AUTHORISED MESSAGE anymore, I got this
"The page cannot be displayed"

They must have some restriction for something....
I do remember downloading some math routine last year from piclist!

STEVE
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…