GolamMostafa:
2. When IRQ-signal arrives, the MCU enters into ISR, finishes the ISR, and then resumes the MLP from the label where it was interrupted. Let us assume that the loop() function contains the following instructions:ML1: digitalWrite(13, HIGH);
ML2: delay(1000);
ML3: digitalwrite(13, LOW);
ML4: delay(1000);
Let us assume that the IRQ-signal arrived when the MCU was just executing instruction at label ML3. After finishing the ISR, the MCU will resume MLP execution from label ML4. This is the picture from high level point of view; the actual low level picture is a little bit different.
This is false, right? First, these are no single cycle instruction. And second, if it was inside digitalWrite, after the ISR it would continu inside digitalWrite and not go to ML4.
At least this is what I thought was happening. If the interrupt happens, the programs stops, goes to the interrupt handler, executes and goes back to the program counter