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 support@ccsinfo.com

warning interrupt disabled - revisited

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



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

warning interrupt disabled - revisited
PostPosted: Thu Feb 25, 2010 9:26 am     Reply with quote

Greetings,

I have read the posts in the forum as this seems to be a common theme. I have an ISR which has a division and multiplication which does not seem to be avoidable.

Is there a way to tell the compiler to only disable the offending interrupt routine and not all interrupts (global)?

Cheers,
JMA
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 9:54 am     Reply with quote

Yes
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 10:01 am     Reply with quote

Wayne_,

Any more information on how to accomplish this? Thank you for your time.

Cheers,
JMA
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 10:59 am     Reply with quote

Well that all depends on the interrupt you are trying to disable.

You havn't really given any information what so ever.

No pic type, fuses, curent code for setting up your interrupts or interrupt code.

So I doubt you will get very much help at all.

At least state which interrupt it is!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 11:06 am     Reply with quote

Quote:

I have an ISR which has a division and multiplication which does not
seem to be avoidable.

See this post. It explains how to create an 2nd instance of the CCS
math library routines, to avoid getting that compiler warning:
http://www.ccsinfo.com/forum/viewtopic.php?t=25464&start=4
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 11:09 am     Reply with quote

Greetings Wayne_,

Thanks for the advice. I understand the need for specifics when trying to come up with potential solutions. Below are a few details. I thought there might be a simple answer like SEE XXX of the CCS manual or XXX posting.

Details:
PIC18F4585
INT_TIMER2
H4, WDT16, NOPROTECT, NOLVP

JMA
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Thu Feb 25, 2010 11:14 am     Reply with quote

PCM Programmer,

Thank you for the suggestion. I'm in the process of looking of looking at this posting. I was thinking there might be another work around with only disabling specific interrupts.

Just for clarification, when the assembly code lists an 'RCALL', is this a clue the compiler is making a relative call to a library routine which is not in the lst file?

Cheers,
JMA
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Fri Feb 26, 2010 2:41 am     Reply with quote

I have to appologise. I did not fully understand your problem until PCM posted.
I thought you just wanted to know how to disable interrupts. Embarassed

You could also write your own division/multiplication routines either in C or inline asm. I would prob choose this option depending on the complexity and accuracy required.
Ttelmah
Guest







PostPosted: Fri Feb 26, 2010 3:31 am     Reply with quote

As a 'comment', there is a way to sort of do what the original question asked.
Obviously, provided code space is not a problem, it is more efficient, to just duplicate the arithmatic.

What you do, is 'encapsulate' the routine giving the problem, in your own wrapper.
So (crude demo for a 18F452, assuming the 'problem' routine, is the 8bit*8bit multiply).
Code:

#include <18F452.h>
#FUSES XT
#use delay(clock=4000000)

int8 tval1;
int8 tval2;
int1 in_int = false;

int8 MUL8x8(int8 x,int8 y) {
   int8 temp;
   disable_interrupts(INT_EXT);
   if (!in_int) enable_interrupts(global); //If we are _not_ in the interrupt
   //re-enable the global interrupts
   temp=x*y;
   enable_interrupts(INT_EXT);
   return temp;
}

#INT_EXT
void dummy_int(void) {
   int8 testval=2;
   in_int=true; //Flag to say we are in the interrupt
   testval=mul8x8(testval,tval1);
   in_int=false;
}

void main(void) {

   enable_interrupts(INT_EXT);
   enable_interrupts(GLOBAL);
   
   while (TRUE) {
      tval1=mul8x8(tval1,tval2);
   }
}

You will still get the warning, and the global interrupts will be disabled before the routine is called, but as soon as you are inside the routine, if you are not in the interrupt, you disable the single 'problem' interrupt, and re-enable the global interrupts.

Best Wishes
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