Hello,
It's the first time I try to use ON INTERRUPT.
If I compile my program (PBP2.45a), I get an error.
Error test.mac 46: [235] Opcode Expected Instead of '1'
If I disable ON INTERRUPT with a " ' " , compiling is ok.
What's wrong?
@ DEVICE PIC16F819, INTRC_OSC_NOCLKOUT, MCLR_OFF
OPTION_REG = %10000000 ' Turn off pull-up resistors
DEFINE ONINT_USED 1
OSCCON=$60 ' osc. controller, 70=8MHz, 60=4MHz
adcon1=7 ' comperator off
TRISA=%00011111
TRISB=%11110000
led VAR PORTB.0
ON INTERRUPT GoTo myint ' Define interrupt handler
INTCON = %10001000 ' Enable RBIE interrupt
loop:
led=1 ' Turn LED on
GoTo loop ' Do it forever
myint:
Disable ' No interrupts past this point
led=0 ' If we get here, turn LED off
Pause 500 ' Wait .5 seconds
INTCON.0 = 0 ' Clear interrupt flag
Resume
Enable
Stop
Thanks for the help,
Peter
Bookmarks