View previous topic :: View next topic |
Author |
Message |
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
New message "Interrupt level changed" - why? |
Posted: Mon Apr 27, 2009 9:46 am |
|
|
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
|
|
Posted: Mon Apr 27, 2009 9:57 am |
|
|
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
|
|
Posted: Mon Apr 27, 2009 10:05 am |
|
|
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
|
|
Posted: Mon Apr 27, 2009 10:26 am |
|
|
It is at times surprisingly 'annoying', but part of the design I'm afraid.....
Best Wishes |
|
|
|