I have attached an interrupt to pin 19 on Arduino Mega.
One of the main issues is that there's a false interrupt trigger
In order to resolve this, I placed a pull down resistor
Despite placing a pull down resistor, the interrupt on pin 19 was triggered so I tried to prevent it with the following code
if(interrupt)
{
interrupt = 0;
delay(100);
x = digitalRead (19);
if(x ==1)
{
x = 0;
interrupt_function();
}
}
So what the above code does is it checks after 100ms if the digital pin 19 is still high, if so only then interrupt_function() would get executed. On implementing the above code i successfully prevented entering the interrupt function on a false interrupt trigger but the main problem arises on how to resume to the my original function
- All i know is the instruction pointer holds the address of the next instruction to be executed. So how do I access it in order to resume from where the controller left off?
Or is there any other in order to resume to place where the controller left off - How do I prevent the false interrupt trigger at a hardware level in the first place?