Ok, so I've been trying to make this interrupt work on a ATmega128RFA1 without success.
I'm using PORT B4 and B5, which are PCINT4 and PCINT5 respectively.
I have enabled the PC interrupt in its config register, enabled the PCINT0 Mask and enabled the global interrupt, but still, the PC Interrupt Flag never changes and, obviously, the interrupt is never executed.
My code:
/* Includes */ #include#include #include #include "../../serial.c" ISR(PCINT0_vect) { printf("Interrupt Working\n"); } int main(void) { serial_init(); // Initialize serial PORT E0&E1 DDRB &=~(1<<PORTB4 & 1<<PORTB5); PCICR |= (1<<PCIE0); PCMSK0 |= (1<<PCINT0); // On // PCMSK0 &=~(1<<PCINT0); // Off sei(); while(1) { // PCIFR = 0x02; // As a test, PCIFR never changes printf("PCIFR:%02X\r",PCIFR); } }
So, that's my code.
Am I missing something?