General area when it fits no where else

Moderator: Mmiscool

User avatar
By Oldbod
#50864 Just wondering how these are handled? If they're true interrupts, or if they're done by software polling pin states, or if a true interrupt sets a flag picked up by a software routine.

I'm asking because I'm wondering if any transitions might be missed if they occur when another interrupt is being processed....
User avatar
By Mmiscool
#50867 Pins set as an interupt are polled each time the esp exicutes a line. It will trigger the actual interupt when the esp is in a wait state. It is posible that the pins state could change between when it detected the interup and when the branch is run. A true interupt will not work so well with an interperted language.
User avatar
By raintime
#50870 Hmmm, I would hope that an interrupt pin would not be polled, but when an interrupt occurs, would instantly set a flag. Then, when esp executes the next line, the flag would be checked to see if the interrupt occurred. And the flag would then be reset. I think that's what you are already doing. No missed interrupts.

Also, to make things better, if when an interrupt occurs, if that flag was already set, this would be a double interrupt, which could raise an error, or a counter could be incremented that the user could check to see how many of those specific interrupts occurred. (But this is not so easy to do.)

It might also be great if at least one interrupt could read a (microsecond) timer that the user could set to zero when desired, and then could see exactly when the interrupt occurred..
User avatar
By Oldbod
#50893 Thanks for the replies. I now feel guilty because I'm sure I've already read this or much of it in the documentation.

I guess much of if this is ever likey to be an issue depends on how fast changes occur and how code is written plus how fast the hardware is. Im going to think a bit more about this, thank you again for now. :-)