Arduino OPTA Pin A7 cannot use for interrupt

Hi,

I experienced have a problem when using Pin I8/A7 as interrupt pin in Arduino OPTA PLC wifi. The Arduino Led keep blinking amber and green, and the COM port cannot be detected. We should do reset button to reconnect the arduino to PC. and as well as the arduino OPTA was not run properly (the arduino stuck cannot response the input).

const int IN_COGNEX01 = 7;  //Pin A7 Connected to Cognex 
int TimeOUT;
//Interupt Routine Service Variable
volatile bool UserBTNISR_state = false;
volatile bool Input_ISR_State = false;


void setup() {
  //Setup Serial for testing
  Serial.begin(115000);

  //Initialize LED_BUILTIN
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, HIGH);

  //Setup the pin number and Led Number for Arduino OPTA
  for (int i = 0; i < numRelays; i++) {
    // Sets the mode of the relays and user LEDs as outputs
    pinMode(relayOutputs[i], OUTPUT);
    pinMode(userLeds[i], OUTPUT);
  }

  //Setup input for Digital Input OPTA
  for (int i = 0; i < NUM_PINS; i++) {
    pinMode(TERMINALS[i], INPUT);
  }
  pinMode(BTN_USER, INPUT);
  //Setup the time out milliseconds
  TimeOUT = 100;

  //Interrupt Configuration & Initialization
  attachInterrupt(digitalPinToInterrupt(BTN_USER), UserBTNISR, RISING);
  attachInterrupt(digitalPinToInterrupt(TERMINALS[IN_COGNEX01]), INPUT_ISR_Procedure, RISING);
}

void loop() {

  Reject_Action();
  Press_RSTBTN();

}

Anyone has the same problem of using Interrupt in Pin A7 ? or any solution of this issue ?

Hi @aulinux29,

Try using A7 instead of 7 on the following line:

const int IN_COGNEX01 = 7;

Let me know if it helps.

Yes, it had tried to use A7 but the sameā€¦ and I have another Arduino OPTA PLC wifi and the result is the same. A7 cannot be used for interrupt.

I think this one is bug of the Arduino it self.

Hi aulinux29,

I have also Opta Wifi and only pin combination that is not working with interrupts is A0 (I1) and A3 (I4) simultaneously. I'm using A7 with no problem at all and all steps i've made are from this simple tutorial.

I hope it'll help