finally had some time to debug this , and found the error , lov simulators , the problem was , if you have a look at the code / descriptions is that this routine WAS called from the main program loop .
When it was changed for this test to be called by the event of change on interupt , the section directly after the pulsin command where the if signal length <800 then return etc , well that needed to be changed to the @ int _return
I still need this routine to be both called when its - standing by - looking for input as a change on interrupt ,
but i also need the routine be called from other parts of the program for input traps to be tested and triggered and so i have left in the normal " returns " in
I think that "@ int_returns" are not acted upon , unless the " @ INT_ENABLE GPC_INT" is enabled , as such a normal call to this subroutine would skip the "@ int_returns" statement as i see it.
Changed code is
Code:
GetIRcode:
TRISIO.0 = 1 ' setup input=1,output=0 GPIO.0 = 1 to input
PULSIN IR,1,Leader ' get leader high pulse time value in on GPIO.0 ( pulsin_max set to 4000 = 20ms )
IF Leader < 800 tHEN ' look for 4500us high pulse below 4000us then its 2nd key area pulse or data/ address bits (800^ 5us= 4000us)
@ INT_RETURN
return
endif
IF Leader > 960 tHEN ' above 4800us then it no sig
@ INT_RETURN
return
endif
Warning - the includes of DT interupt14.bas is very heavy load on small pics where ram is very limited and having all those varables and then your program code varaibles makes it hard to use in anything but a small program , this project will be loaded into the 16F1825 , when i get them , so should not be such a big issue on ram as it is on the 12f683
Comparing Overheads for the same code running on 16F1825 to the 12F683 , i found that the 16F1825 had an additional 320 words used to that in the 12F683, must be all those extra features in the chip when doing compile , even if you are not using them
Now onto DT interupt14.bas interrupt testing routines using timer 0-2
Cheers
Sheldon
Bookmarks