On Wed, May 9, 2012 at 8:24 PM, Joe Wronski <.....jwronskiKILLspam
@spam@stillwatereng.net> wrote:
{Quote hidden}> 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. Look 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. Always look to the assembler produced by the compiler.
>
> Here is the interrupt exit code produced by C18 including the "missing"
> retfie:
>
> 00F2 52E5 MOVF 0xfe5, F, ACCESS
> 00F4 CFE5 MOVFF 0xfe5, 0xfda
> 00F6 FFDA NOP
> 00F8 0011 RETFIE 0x1
>
> Joe W
>
>
Missed the #pragma interrupt line here ..
{Quote hidden}>> void low_isr(void)
>> {
>> if ((PIE1bits.TMR2IE == 1)&& (PIR1bits.TMR2IF == 1)) {
>> PIR1bits.TMR2IF = 0;
>> DisplayDigit(segment, display[segment]);
>> }
>> _asm
>> retfie 0
>> _endasm
>> }
>>
>> #pragma code low_vector = 0x18
>> void low_vector (void)
>> {
>> _asm goto low_isr _endasm
>> }
>>
missed the #pragma here
This caused the retfie not to appear in the disassembly. Things are sane now.
Thanks,
Manu