Strange bug with FRDM-KL25Z

04 Mar 2015


I have an mbed FRDM-KL25Z that has been operating for the last year or so in an automatic garage door opener at my house. But a few days ago it stopped working - I got it going again with a software hack but the problem appears to be hardware (?maybe?). I haven't changed anything in the hardware or software since it was installed a year ago (until tonight when I started trying to fix it). I have a digital input, set to PullUp, which is normally grounded - it is connected to a microswitch on the lid of external control panel, with the idea that if you unscrew the control panel, the switch breaks and the signal goes high and goes into a failsafe mode.

I have tested that the microswitch is fine, the signal is definitely grounded. But reading the DigitalIn on that pin always gives 1. Moreover, if I disconnect the switch and measure the voltage across the pin (which is PullUp), it is only about 1.5V. On other pins that are pulled up, the voltage is about 2.3 or higher.

I'm wondering what couild cause this - is it possible I have damaged that I/O pin somehow?

17 Mar 2015

If the pin reads 1 even with 0V on the pin, then its damaged. Possibly a board fault - you could try using a 20k pull up or down externally and see how that affects the voltage on the pin.

My guess is that you have a long length of wire with minimal resistive losses - EMI or lightning has taken its toll on the input circuit. I'd suggest you burn a little more power in the input, and add both a pull-down and a series input resistor which will help to dissipate any surplus energy picked up by the wire - as well as a zenner clamp. With luck, you have a spare input pin which can replace the broken one.