Shop OBEX P1 Docs P2 Docs Learn Events
Edge interrupts not working? — Parallax Forums

Edge interrupts not working?

dat
		orgh	0

		org

		setb	dirb, #0	'make that pin an output
		setb	dirb, #1

		waitx	##25_000_000	'wait 1/2 second for INB to figure itself out

		setedg	#%0_10_1_11011	'falling edge on inb[27]

		mov	ijmp1, #isr
		setint1 #%010		'edge-triggered event

'loop		waitint
'		jmp	@loop

loop		waitedg	
		notb	outb, #1	'toggle LED
		waitx	##5_000_000	'wait 1/10th of a second for lazy debounce
		polledg			'clear
		jmp	@loop		'repeat

isr		notb	outb, #0	'toggle LED
		waitx	##5_000_000	'wait 1/10th of a second for lazy debounce
		polledg			'clear
		reti1

Given the above code, the ISR never executes. WAITEDG and POLLEDG are working, though.

Comments

  • cgraceycgracey Posts: 14,152
    Do 'SETINT1 #3'.

    I'm documenting this today.
    wire [7:0] ints		= {	fbw_event,	// interrupt sources
    				xro_event,
    				wrl_event,
    				rdl_event,
    				edg_event,
    				pat_event,
    				cnt_event,
    				1'b0 };
    
  • That worked. Thanks.

    (note: yeah, I knew you were documenting it. I was just being impatient. :) )
  • cgraceycgracey Posts: 14,152
    edited 2015-10-13 01:08
    Seairth wrote: »
    That worked. Thanks.

    (note: yeah, I knew you were documenting it. I was just being impatient. :) )

    Actually, I haven't even gotten back to the documentation today, yet, because I've been working on the assembler syntax.
Sign In or Register to comment.