Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how can i get a 1 msec delay ?

Status
Not open for further replies.
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 :D
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.

Latest threads

New Articles From Microcontroller Tips

Back
Top