OK Got a problem, took and went back to basics and just want a timer to flash a LED and a button on RB0 (int)
heres my code, the INTCON and OPTION are remarked out because I copied them in from other notes on web, not sure if they were correct and they threw sytax errors
Code:
INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler INT_INT, _ToggleLED1, PBP, yes
INT_Handler TMR1_INT, _ToggleLED2, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE INT_INT ; enable external (INT) interrupts
@ INT_ENABLE TMR0_INT ; enable Timer 0 interrupts
'INTCON = %10011000 <--not sure if this was needed or incorrect (it was not in the blinky or the hello word program)
'OPTION_REG = %01000000 <-- same as above, shows up as syntax error (Both lines copied from other peoples code)
'without these 2 lines I get INTCON, INTF not found
T1CON = $11 ; 01=.5s, 11=1s
Main:
PAUSE 500
GOTO Main
'---[INT - interrupt handler]---------------------------------------------------
ToggleLED1:
Toggle PORTB.1
@ INT_RETURN
'---[TMR0 - interrupt handler]-------------------------------(Animation)------
ToggleLED2:
Toggle PORTB.2
@ INT_RETURN
Bookmarks