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

New message "Interrupt level changed" - why?

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



Joined: 08 Sep 2003
Posts: 197
Location: Omaha NE USA

View user's profile Send private message Send e-mail Visit poster's website

New message "Interrupt level changed" - why?
PostPosted: Mon Apr 27, 2009 9:46 am     Reply with quote

Hi all,

Chip: PIC18F4620 Compiler: PCWH 4.092

I was using #INT_RTCC HIGH and INT_TIMER3, and everything was compiling like I expected. I was using the TIMER3 interrupt to read the status of several switches on PORTB.

Now I an trying to use the external interrupts to read individual buttons; I'll also use INT_RB to read the upper four bits, and INT_CCP2 to catch button presses on RB3. It's like getting interrupts on all eight RB pins... kind of. Anyway, I an now getting a warning I didn't see before:

WARNING 225 Interrupt level changed EXT:NORMAL=>HIGH

I tried stripping it down to just INT_RTCC and INT_EXT... same thing. So this gives me the warning:

Code:

#device HIGH_INTS=TRUE
...

// This function steps the PWM duty cycle value when Timer0 overflows.
#int_rtcc HIGH
void pwm_tone(void) {
    set_timer0(t0preload);
    set_pwm1_duty(s_table[s_table_idx++ % 8]);
}

#int_ext
void save_button6(void) {
    char x;
   
    if(!input(PIN_B0)) {
        button_state |= 1;
        flags.button_hit = TRUE;
    }
}



and this does not:
Code:
// This function steps the PWM duty cycle value when Timer0 overflows.
#int_rtcc HIGH
void pwm_tone(void) {
    set_timer0(t0preload);
    set_pwm1_duty(s_table[s_table_idx++ % 8]);
}

// Save the state of the six function buttons.
#int_timer3
void save_buttons(void) {
    char x;
   
    x = ~input_b();                     
    if(x) {
        button_state |= x;
        flags.button_hit = TRUE;
    }
}


What am I not seeing?
Ttelmah
Guest







PostPosted: Mon Apr 27, 2009 9:57 am     Reply with quote

Read the data sheet.
Key is that INT_EXT, does not have a priority bit.
If _any_ interrupt is set to high_prority, and INT_EXT is used, INT_EXT, will also become a high priority interrupt.

Best Wishes
dbotkin



Joined: 08 Sep 2003
Posts: 197
Location: Omaha NE USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Apr 27, 2009 10:05 am     Reply with quote

Ah, there we are... "There is no priority bit associated with INT0. It is always a high-priority interrupt source."

Thanks. I can live with that. I guess I overlooked that, as I was seeing priority bits for INT1 and INT2 - must have assumed there was one for INT as well.
Ttelmah
Guest







PostPosted: Mon Apr 27, 2009 10:26 am     Reply with quote

It is at times surprisingly 'annoying', but part of the design I'm afraid.....

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