Hello again,
I'm using the ATMEGA32 for a project of mine but I have a simple question...
If you use a button, you are going to have debounce problems cause it's the real world and it's not perfect...
Now... if the button is connected to an interrupt and you don't do anything to debounce it, it's
more than probable that the interrupt code will execute twice or more, something that I don't want at all...
So while on the interrupt routine I want to clear GIFR to prevent multi-interrupts... (and some debounce wait time)
My problem is that (I read the manual), I don't understand how to clear the GIFR...
It says,
that the flag is cleared by the end of the execution of the interrupt code (unless another interrupt occurs, of course)
And that you can manually clear the flag by writing logic 1 to the flag...
But if no interrupt occurs and as said the initial Value of the flag is logic 0...
So... what I do here... I write 0 to the INTFX or 1 to clear it manually....
What I think is that I write 1 but it's not.... logical....
Thanks in advance, Lefteris
Greece