Hi all,
I am using a ATmega324P, and I am trying to set pin PA7/ PCINT7 as an external interrupt. Reading the datasheet on page on page 79 it mentions this pin can be used as an external interrupt. My next task is to get it to work. I have tried the below examples but this does not work.
I would appreciate if somebody could point out what I am doing wrong and if the below actually sets up PA7/ PCINT7 as an external interrupt.
Thanks in advance.
#include <avr/io.h>
#include <util/delay.h>
#include <avr/portpins.h>
#include <avr/interrupt.h>#define F_CPU 4000000UL
void hw_setup(void)
{
DDRA = 0x00; // set portA as input
PORTA.INT0MASK = 0x40; // bit PC7}
ISR(PORTA_INT0_vect)
{
print("Hello World")
}
int main(void)
{hw_setup();
sei();while(1)
{
}
}
Also I have tried the below ISR and this does not work either.
ISR(PCINT7_Vect)
{
print("Hello World")
}