lpcware

LPC1227 digital glitch filter

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by fjrg76 on Thu Nov 22 17:42:52 MST 2012
Hi

I enabled PIO1_3 and PIO1_4 as inputs for two push buttons. Since the beginning I chose to enable the digital glitch filters, but the GPIO1's state never changed when pressing any of the two buttons.

This is the code for configuring the pins:

LPC_GPIO1->DIR&=~(0x3<<3);
LPC_IOCON->PIO1_3=BIT(4)|BIT(7)|(3<<11);              // (1)
LPC_IOCON->PIO1_4=BIT(4)|BIT(7);//|(3<<11)|(2<<13);   // (2)


After some experiments I noticed that when the digital filters were enabled then the pins' state doesn't change as in (1); however, when the filter is disabled then the pin's state effectively changes whenever I press the button on that pin (as in (2)).

Is there anything else to enable in the core before using the glitch filters?

Thank you!!

Outcomes