
Originally Posted by
scalerobotics
That was nice of you to do that Joe.
I think Darrel may have fixed that in his new version of interrupts. It is v1.00. You can find it at the bottom of this page:
http://darreltaylor.com/DT_INTS-14/intro2.html
It says it has GPC_INT -- GPIO Int On Change , among a bunch of other additions. But I have not played much with the DT-INTS-14 ... yet.
Thanks, I was still using ver .93, I will download the newer ver now. I am curious to see what I missed in my attempt. I got the defines and the ifdefs but couldn't figure out the flag handler.
EDIT:
Well Darrel's been busy ! Added GPIO and PortA interrupts too and it looks like a whole lot more. <font color=red>Thanks Darrel !,</font color>
So using DT_INTS-14.bas ver 1.0
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
DEFINE OSC 4
Include "DT_INTS-14.bas"
CMCON0 = 7 ' comparator pins configured as I/O
ANSEL = 0 ' all I/O as digital
OSCCON = %01100000 ' 96 decimal
GPIO = %00000000
TRISIO = %00001000 ' GPIO Input all others as Outputs
Option_Reg = %01000000 ' Interrupt on rising edge INTEDG bit
IOC = %00001000 ' Enable interrupt on change gpio.3
i var byte
Mainloop:
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler GPC_INT, _Do_This, ASM, no
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE GPC_INT ; enable external (INT) interrupts
for i = 0 to 9
GPIO.0 = 1
pause 500
gpio.0 = 0
pause 500
next i
gpio = 0
Goto Mainloop
end
Do_This:
gpio.1 = 1
goto mainloop
Do not forget to open DT_INTS and uncomment these 2 lines
Code:
wsave VAR BYTE $20 SYSTEM ' location for W if in bank0
wsave1 VAR BYTE $A0 SYSTEM ' location for W if in bank1
Bookmarks