Skip to content

Arduino Giga R1 crashes with attach interrupt #789

@Heinrich222

Description

@Heinrich222

This Testsketch will cause a "crash" with the Giga Board just after upload ( Red LED blinking ).
According to the Documentation it should work.

but:
As soon as I remove the two lines marked with xyz the Sketch works fine.

crash occurs also:

  • when using pin 52,53 instead of 40 / 42
  • when using pin 40 or 42 exclusive
  • seems independant from number of attached Interrupts/Pins

???

Thanks for any Hint.

volatile int i;

void setup() {

  attachInterrupt(digitalPinToInterrupt(34), ISR_34, FALLING);
  attachInterrupt(digitalPinToInterrupt(36), ISR_36, FALLING);
  attachInterrupt(digitalPinToInterrupt(38), ISR_38, FALLING);
  attachInterrupt(digitalPinToInterrupt(40), ISR_40, FALLING); // xyz
  attachInterrupt(digitalPinToInterrupt(42), ISR_42, FALLING); // xyz
  attachInterrupt(digitalPinToInterrupt(44), ISR_44, FALLING);
  attachInterrupt(digitalPinToInterrupt(46), ISR_46, FALLING);
  attachInterrupt(digitalPinToInterrupt(48), ISR_48, FALLING);
  attachInterrupt(digitalPinToInterrupt(50), ISR_50, FALLING);
  attachInterrupt(digitalPinToInterrupt(22), ISR_22, FALLING);

  pinMode(34, INPUT_PULLUP);
  pinMode(36, INPUT_PULLUP);
  pinMode(38, INPUT_PULLUP);
  pinMode(40, INPUT_PULLUP);
  pinMode(42, INPUT_PULLUP);
  pinMode(44, INPUT_PULLUP);
  pinMode(46, INPUT_PULLUP);
  pinMode(48, INPUT_PULLUP);
  pinMode(50, INPUT_PULLUP);
  pinMode(22, INPUT_PULLUP);
  
  Serial.begin(9600);
}

void loop() {
  if (MM != 0) {
    i++;
    Serial.print(i);
    Serial.print(" -- >");
    Serial.println(MM);
    delay(100);
    MM = 0;
  }
}


void ISR_42() {
  MM = 42;
}
void ISR_40() {
  MM = 40;
}
void ISR_38() {
  MM = 38;
}
void ISR_36() {
  MM = 36;
}
void ISR_34() {
  MM = 34;
}
void ISR_44() {
  MM = 44;
}
void ISR_46() {
  MM = 46;
}
void ISR_48() {
  MM = 48;
}
void ISR_50() {
  MM = 50;
}
void ISR_22() {
  MM = 22;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions