> OK, this is just getting weird... >=20 > I had external interrupts working in the JAL prototype of my=20 > remote-control receiver code, but I'm rewriting it in C18 (mainly=20 > because I can do floating-point calculations for timer preload and=20 > threshold values; JAL AIUI only handles integer math). >=20 > The thing is, I'm not seeing any interrupts -- none at all. I put a=20 > breakpoint on the "goto ISR" line, and the PIC didn't break. I also=20 > didn't see anything on the logic analyser.... >=20 > I must be doing something stupid, but I can't for the life of me figure=20 > out what: >=20 > #include > #pragma config OSC =3D HS // High Speed Crystal oscillator > #pragma config WDT =3D OFF // Watchdog timer off > #pragma config LVP =3D OFF // Low-voltage programming off > #pragma config MCLRE =3D ON // MCLR (reset) on > #pragma config FSCM =3D OFF // Failsafe clock monitor off >=20 > // timer0 prescaler settings > #define TIMER0_USE_PRESCALER > #define TIMER0_PRESCALER_SETTING 5 >=20 > // Infra-red receiver > #define PIN_IR PORTBbits.RB0 > #define PIN_IR_DIR TRISBbits.TRISB0 >=20 > void isr(void); >=20 > // ISR stub code > #pragma code HIGH_INTERRUPT_VECTOR =3D 0x8 > void high_ISR (void) > { > _asm > goto isr > _endasm > } > #pragma code >=20 > // Interrupt Service Routine > #pragma interrupt isr > void isr(void) > { > unsigned char tval; > char overflow; >=20 > // Store timer value and overflow flag and rearm the timer > tval =3D TMR0L; > TMR0L =3D 0; > overflow =3D INTCONbits.TMR0IF; > INTCONbits.TMR0IF =3D 0; >=20 > // detect RB0 int flag > if (INTCONbits.INT0IF) { > char pol; >=20 > // clear interrupt flag > INTCONbits.INT0IF =3D 0; >=20 > // store bit polarity, then flip to other polarity > pol =3D INTCON2bits.INTEDG0; > INTCON2bits.INTEDG0 =3D !INTCON2bits.INTEDG0; > } > } >=20 The TMR0 part in the interrupt routine is always executed even if the inter= rupt=20 source is RB0. But maby that is the intention? /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .