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.

Simulation Problem

Status
Not open for further replies.
Kane2oo2 said:
no im not using the interrupt.

but if i didnt debounce then when its first pressed the lights would go off ... but then it will get back to checking the port again before the switch would have time to settle? so the lights might come back on again.


but anyway ... even if i used the delay in a circuit that needed debouncing ...would a delay of 10 ms do it?

thanks
Kane
i suppose it would depend on the type of switch
 
Hi, I have a similar problem -----
cant get out of delay loop with PIC simulator IDE - any help appreciated
Code:
---------------EQUATES----------------------
MCOUNT			EQU		0X0C			
NCOUNT			EQU		0X1D
--------------------------------------------------
;---------------------------------------DELAY--------------------------------------------------

DELAY			MOVLW	0XFF			;0.2S DELAY
				MOVWF	MCOUNT			;MOVING CONTENTS OF WORKING REGISTER TO MCOUNT
GET_N			MOVLW	0XFF			;LOAD WORKING REGISTER WITH VALUE
				MOVWF	NCOUNT			;MOVING CONTENTS OF WORKING REGISTER TO NCOUNT
DEC_N			DECFSZ	NCOUNT,F		;DECREMENT NCOUNT AND SKIP IF ZERO
				GOTO	DEC_N	
				DECFSZ	MCOUNT,F		;DECREMENT MCOUNT AND SKIP IF ZERO
				GOTO	GET_N
				RETURN



Thanks in advance
 
Just add a breakpoint after the delay loop. (Use a NOP, if necessary, but it usually isn't needed.) Then use "run" and you will hardly notice it is there. You can also comment out the delay, but I don't like doing that.

John
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top