PORTA interrupt on ATXMEGA64A3U

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

I would like to see the function interrupt moving INT routine break by PORTA's pin low active by JTAGICE3 debug mode. 

But,I can't.

 

#include <avr/io.h>
#include <util/delay.h>
#include <avr/portpins.h>
#include <avr/interrupt.h>


#define F_CPU 8000000UL


volatile int test_state=0;

void hw_setup(void)
{
	PORTB.DIRSET=0xFF;
	PORTD.DIRSET=0x3F;
	PORTA.DIRSET=0x00;
	PORTC.DIRSET=0x01;
	PORTE.DIRSET=0x00;	

	PORTA.INT0MASK=0x40;

}


ISR(PORTA_INT0_vect)
{
	test_state++;
	
}



int main(void)
{

	hw_setup();
	
	sei();

    while(1)
    {
		

	}
}

 

INT0IF of PORTA.INTFLAGS is set when I make PA6 LOW after starting.

 

But,the break at ISR(PORTA_INT0_vect, does  not work.

 

Whould you tell me about I should add or repair anything code?

 

Thanks.

 

 

 

 

This topic has a solution.

kenji maehara

Last Edited: Thu. Nov 13, 2014 - 02:11 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You have to set the interrupt priority (which Atmel calls interrupt level).

 

 

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

It probably doesn't make any difference what priority (level) you choose.  At least it doesn't in my code so far.

Last Edited: Thu. Nov 13, 2014 - 10:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi steve17

Thank you so much.

kenji maehara