CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Interrupt disabled

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
lollo
Guest







Interrupt disabled
PostPosted: Wed Jul 01, 2009 9:57 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jul 01, 2009 12:22 pm     Reply with quote

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







PostPosted: Thu Jul 09, 2009 9:27 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 09, 2009 11:50 am     Reply with quote

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);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group