I have a SF module working well using the ISRRX module for serial comms. in an 18F87J50.
I need to add an ISR that blinks a LED on a pin when Vcc falls past half (ie. 1.7V).
The comparator and ISR (called GSMoff) work nicely on their own, but when I add it to the code with ISRRX installed I get a compiler at my line "enable(GSMoff)" saying "interrupt vector in use".
This is to be expected I assume, because ISRRX is already using the interrupt system.
But how to I add another .... I've read everywhere and tried a lot of ways but no good. Anyone with advice - most welcome !!!
This is the ISR, really simple
Code: Select all
Interrupt GPSoff()
PIR2.6 = 0
Save(0)
High(PORTE.1)
DelayMS(100)
Low(PORTE.1)
DelayMS(100)
Restore
End Interrupt
Code: Select all
CVRCON = %10101100 ' Setup internal Vref: turn on, no ext o/p, use vdd as ref, set v to 1.23
CM2CON = %10001100 ' Setup comparator 2: turn on, no ext o/p, interrupt on H, use internal Vref, take input signal from pin 18 AN7
INTCON = %11000000 ' enable global interrupts
PIR2.6 = 0 ' clear comparator 2 interrupt flag
PIE2.6 = 1 ' enable comparator 2 interrupt
Code: Select all
enable(GSMoff)