I configure the GPIO 24 to an input GPIO.
When subscribing to the GPIO handler, the handler is called and the read value is 0 (that I was expecting) :
GPIO 24: 0
My application manages incoming SMS (by parsing incoming SMS to do some stuff).
But when my application receives an SMS, the GPIO handler is called twice and the read value is 1 and after 0 !
GPIO 24: 1
GPIO 24: 0
Why the GPIO 24 reacts when the application receive the SMS ?
is that gpio connected to anyting yet?
it’s not multiplexed with anything, so the OS doesn’t (or shouldn’t) touch it.
the reset stat of that gpio is Z, so it’s no pulled up or down, but left floating.
maybe the EMI from receiving the sms is enough to trigger it from 0 to 1 and back.
You completly right it seems to be a “disturbing” problem !!! Today the problem doesn’t occured !! And if it occure again I will measure the gpio24 ! Many thanks !!!
do you connect or intend to use the gpio in the future?
because connecting a pullup or pulldown resistor to the input will stop this ‘undefined’ behaviour from occuring.
wich by the way is always a good practice.
always make sure that inputs you subscribe to have a ‘defined’ state.
to think that I have been searching for a way of setting a weak pullup on
a GPIO input!. In the end, I botched it by putting 100K pullup.
I’m used to using PICS and other suchlike kit where one can actually
control what is going on!