I am testing the following program:
It works just fine in the simulator. The interrupt works on the breadboard if I Plug a jumper from Pin c.1 to 3.3V for a duration of about 2 sec. The the interrupt does not fire if I quickly plug and unplug the jumper into 3.3V.
The attached push button circuit also does not fire the interrupt, but the circuit functions correctly; the output is low with the switch open and when grounded the output is 3.3V. Upon releasing the switch, the output returns to 0V after a short delay.
So it appears that Pin c.1 must go high for a certain period of time to invoke the interrupt in hardware, but it in the simulator it is instantaneous. I have searched the manuals, but cannot find any mention of this issue.
Baxter
N.B. I have commented out this statement: "if pinC.1 = 1 then interrupt" and the behavior is the same.
Code:
pause 1000
'set INT1 (C.1) to trigger Interrupt on rising edge
hintsetup %00100010
;enable interrupt flags INT1 (C.1)
setintflags %00000010,%00000010
setint %00000010,%00000010
main:
for b1 = 0 to 7
sertxd("The value of b1 is ",#b1,13,10)
pause 400
next b1
sertxd("Going to Sleep",13,10)
sleep 0
goto main
Interrupt:
if pinC.1 = 1 then interrupt
sertxd("Wakeup from INT1",13,10)
hint1flag = 0
setintflags %00000010,%00000010 're-enable interrupt flags INT1 (C.1)
Return
The attached push button circuit also does not fire the interrupt, but the circuit functions correctly; the output is low with the switch open and when grounded the output is 3.3V. Upon releasing the switch, the output returns to 0V after a short delay.
So it appears that Pin c.1 must go high for a certain period of time to invoke the interrupt in hardware, but it in the simulator it is instantaneous. I have searched the manuals, but cannot find any mention of this issue.
Baxter
N.B. I have commented out this statement: "if pinC.1 = 1 then interrupt" and the behavior is the same.
Attachments
-
9.2 KB Views: 12