View previous topic :: View next topic |
Author |
Message |
lollo Guest
|
Interrupt disabled |
Posted: Wed Jul 01, 2009 9:57 am |
|
|
In my code I have an ISR that is rarely disabled automatically, with no control.
My ISR has not reentrancy, delay or much line.
Why? Thank you. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 01, 2009 12:22 pm |
|
|
1. Post a small test program that shows the problem. Make the program
be less than 50 lines of code. The program must be compilable without
errors.
2. Post any error messages or warning messages that you get from the
compiler.
3. Post your compiler version. |
|
|
lollo Guest
|
|
Posted: Thu Jul 09, 2009 9:27 am |
|
|
I've not a short version to test because the problem occurs rarely under unpredictable conditions.
There aren't error or warning message from compiler.
Compiler version is 4.032 with 18f2410.
I viewed the asm code and global interrupt are disabled only within printf routine.
Probably may occur a conflict with isr and printf functions?
I've disabled all printf to see what happens... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jul 09, 2009 11:50 am |
|
|
I think you're talking about the disabling of interrupts while a TBLRD is
executed. This thread explains why the interrupts are disabled:
http://www.ccsinfo.com/forum/viewtopic.php?t=25535
Here is the ASM code from the .LST file that disables interrupts during
a table read of characters in ROM for a printf() statement:
Quote: | 009E: MOVFF INTCON,0E
00A2: BCF INTCON.GIE // Disable global interrupts
00A4: CLRF TBLPTRH
00A6: ADDLW B8
00A8: MOVWF TBLPTRL
00AA: MOVLW 00
00AC: ADDWFC TBLPTRH,F
00AE: TBLRD*+
00B0: MOVF TABLAT,W
00B2: BTFSC 0E.7
00B4: BSF INTCON.GIE // Re-enable them
00B6: RETURN 0 |
This is the test program that generated that code (with vs. 4.093):
Code: | #include <18F452.h>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#int_ext
void int_ext_isr(void)
{
int8 c;
c = 0x55;
}
//================================
void main()
{
printf("Hello World");
while(1);
} |
|
|
|
|