I have an STM32 with a SIM card reader. For some reason the DETECT
pin interrupt is triggered when the SIM card is removed, as opposed to when the SIM card is inserted.
What could be going wrong here?
I have an STM32 with a SIM card reader. For some reason the DETECT
pin interrupt is triggered when the SIM card is removed, as opposed to when the SIM card is inserted.
What could be going wrong here?
Possible reasons I can think of:
the card detection switch switches from Vcc instead of ground, so that the logic is inverted and a falling edge becomes a rising edge and vice versa.
there's contact bounce, generating both types of edges. Solved with an RC filter.
Sounds like a classic logic inversion problem.
Could be that
Off-topic for the question, but is it required that you respond to that signal particularly quickly? I'm not sure I see a need for an interrupt on that event, I would've thought just polling in the background loop would be sufficient.