Unable to get to ISR during debugging

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi There, 

 

I have a simple code that runs that triggers an INT0 Interrupt when the PD2 bit gets cleared (upon button press). The code works perfectly when I burn it into the AVR. However when I try to step though it using debWire, I am not able to step into the interrupt, even though the button is pressed and the PIND2 is clear.

 

Is there any reason why its not possible to step through the ISR in DW mode or am I missing some thing. 

Best Wishes  & Many thanks for your kind feedback. 

Code Below: 

 

 

 

/*
Flashes LED0 at a fixed rate, interrupting whenever button is pressed.
 */

// ------- Preamble -------- //
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "pinDefines.h"

ISR(INT0_vect) {         /* Run every time there is a change on button */
  if (bit_is_clear(BUTTON_PIN, BUTTON)) {
    LED_PORT |= (1 << LED1);
  }
  else {
    LED_PORT &= ~(1 << LED1);
  }
}

void initInterrupt0(void) {
  EIMSK |= (1 << INT0);                                 /* enable INT0 */
  EICRA |= (1 << ISC00);                /* trigger when button changes */
  sei();                          /* set (global) interrupt enable bit */
}

int main(void) {
  // -------- Inits --------- //
  LED_DDR = 0xff;                                   /* all LEDs active */
  BUTTON_PORT |= (1 << BUTTON);                              /* pullup */
  initInterrupt0();

  // ------ Event loop ------ //
  while (1) {

     _delay_ms(2000);
    LED_PORT ^= (1 << LED0);   

  }                                                  /* End event loop */
  return 0;                            /* This line is never reached */
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tools->Options->Tools->Mask interrupts while stepping

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its already checked ! 

It didnt help. 

Last Edited: Sat. Aug 13, 2016 - 09:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, didnt you want to not mask interrupts on step (ie set it to false)?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Worked. Many Thanks ! 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I usually just set a breakpoint in the ISR.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead.