Pin Change Interrupts on 1284P not working

I am trying to get the Pin Change Interrupts from the EnableInterrupt library to work on a 1284P. I am using Mighty1284 and Bobuino pinout. Its running at 8Mhz, 3.3V.

I can see the program is responding to the Interrupt when the pin (A7/40) in this case as the serial printout to the console is interrupted and the 1284P displays the ‘Reset’ message.

So the 1284P is resetting rather than calling the interrupt service rountine, any ideas why ?

The code is the Simple example from the library.

// EnableInterrupt Simple example sketch. Demonstrates operation on a single pin of your choice.
// See https://github.com/GreyGnome/EnableInterrupt and the README.md for more information.

#include <EnableInterrupt.h>
#define  MIGHTY1284

#define ARDUINOPIN A7  //1284P pin 40

/*// Modify this at your leisure. Refer to https://github.com/GreyGnome/EnableInterrupt/wiki/Usage#Summary
#if defined __AVR_ATmega640__ || defined __AVR_ATmega2560__ || defined __AVR_ATmega1280__ || \
      defined __AVR_ATmega1281__ || defined __AVR_ATmega2561__
#define ARDUINOPIN 6
#else
// Pin 7 is useful on Arduino Uno, Leonardo, Mighty1284, ATtiny84...
#define ARDUINOPIN 7
#endif
*/
volatile uint16_t interruptCount=0; // The count will go back to 0 after hitting 65535.

void interruptFunction()
{
 interruptCount++;
}

void setup() {
  Serial.begin(38400);
  Serial.print("Reset");                         // so that reset is obvious on serial console
#ifdef MIGHTY1284
  DDRA=0x0;    DDRB=0x0;   DDRC=0x0;   DDRD=0x0; // set all pins as inputs
  PORTA=0xFF; PORTB=0xFF; PORTC=0xFF; PORTD=0xFF; // turn on all pullup resistors.
#else
  pinMode(ARDUINOPIN, INPUT_PULLUP);  // See http://arduino.cc/en/Tutorial/DigitalPins
#endif
  enableInterrupt(ARDUINOPIN, interruptFunction, CHANGE);
}

// In the loop we just display interruptCount. The value is updated by the interrupt routine.
void loop() {
  Serial.println("---------------------------------------");
  delay(1000);
  Serial.print("Pin was interrupted: ");
  Serial.print(interruptCount);
  Serial.println(" times so far.");
}
void setup() {
  Serial.begin(38400);
  Serial.print("Reset");                         // so that reset is obvious on serial console
#ifdef MIGHTY1284
  DDRA=0x0;    DDRB=0x0;   DDRC=0x0;   DDRD=0x0; // set all pins as inputs

If you're going to use the Serial line, then you probably don't want to set EVERY pin to input. You probably want to leave the Serial pins however the Serial library sets them. The Tx pin will need to be an output.

I do not know about that library, it is not an arduino built-in library and I could not find it in the user supplied libraries in the playground.

noweare:
I do not know about that library, it is not an arduino built-in library and I could not find it in the user supplied libraries in the playground.

Its this one;

GitHub - GreyGnome/EnableInterrupt: New Arduino interrupt library, designed for Arduino Uno/Mega 2560/Leonardo/Due.

The built in attachInterrupt function would not work on the 1284P.

However any library that will support all the 1284P pin change interrupts would be good.

I tried one other add on library and it would not work on any of the port D pins.

If you're going to use the Serial line, then you probably don't want to set EVERY pin to input. You probably want to leave the Serial pins however the Serial library sets them. The Tx pin will need to be an output.

I realise that, I was just using the published example with as few changes as possible for testing purposes.

The USART overrides the normal operation on RX and TX pins when enabled, so using pinMode() does not affect Serial in any way.