Hi,
I played with HIGH and LOW INTERRUPTs, switching them OFF/ON and once I set QEI to LOW and GPS to HIGH, it started working.
I'm sure my CODE would not be approved, though.
C
Well you're hampering yourself by using an obscure compiler, that almost no one here uses, or has ever used, so most people (including myself) have no idea how interrupts are handled.
However, in assembler, C, and other BASIC's I have used, there HAS to be an ISR (
Interurrupt
Service
Routine), and in XC8 (depending on processor) it starts something like this:
C:
void interrupt isr(void)
//void interrupt INTERRUPT_InterruptManager (void)
{
// interrupt handler
if(INTCONbits.PEIE == 1)
{
// code here
}
}
Once you've set the Interrupt Enable bit for QEI it will just to the ISR once triggered, which then must disable the Interrupt Flag, in order to allow it to work again, plus whatever processing is done.
Oshonsoft must have instructions, helpfiles, and it's own forum? - you need to read how it's supposed to work, rather than just randomly altering things in the vague hope it might work.
It's absolutely critical that interrupts are dealt with properly and accurately, otherwise you're likely to get all kinds of weird problems and crashes.
For a crude 'example' of what I mean, if I wanted you to go and fetch me some beer, I would ask you to "Go down the road to xxxx supermarket, and fetch me two bottles of YYYY beer, and bring it back to me". Your method would just be to say "go".