On Wed, May 9, 2012 at 8:24 PM, Joe Wronski wr= ote: > Without actually digging into the doc for the 18F part in the example > (18C452 ?), I can give some answers: > o Unconditional goto is due to limited program space in the interrupt > vector area. > o Retfie is generated by the compiler, probably due to the #pragma > interrupt directive. =A0Look at View->Disassembly Listing after building. > o Can't speak to the GIE issue without further digging, but if it is > disabled by the interrupt mechanism, your cods should re-enable it, > unless it is implicitly done by the retfie. > > There should be no differences in the chip operation whether using C or > assembler. =A0Always look to the assembler produced by the compiler. > > Here is the interrupt exit code produced by C18 including the "missing" > retfie: > > =A0 00F2 =A0 =A052E5 =A0 =A0 MOVF 0xfe5, F, ACCESS > =A0 00F4 =A0 =A0CFE5 =A0 =A0 MOVFF 0xfe5, 0xfda > =A0 00F6 =A0 =A0FFDA =A0 =A0 NOP > =A0 00F8 =A0 =A00011 =A0 =A0 RETFIE 0x1 > > Joe W > > Missed the #pragma interrupt line here .. >> void low_isr(void) >> { >> =A0 =A0 =A0if ((PIE1bits.TMR2IE =3D=3D 1)&& =A0(PIR1bits.TMR2IF =3D=3D 1= )) { >> =A0 =A0 =A0 =A0 =A0PIR1bits.TMR2IF =3D 0; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 DisplayDigit(segment, display[segment]); >> =A0 =A0 =A0} >> =A0 =A0 =A0_asm >> =A0 =A0 =A0 =A0 =A0retfie 0 >> =A0 =A0 =A0_endasm >> } >> >> #pragma code low_vector =3D 0x18 >> void low_vector (void) >> { >> =A0 =A0 =A0_asm goto low_isr _endasm >> } >> missed the #pragma here This caused the retfie not to appear in the disassembly. Things are sane no= w. Thanks, Manu --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .