Content originally posted in LPCWare by hanygirgis on Fri Feb 14 01:31:07 MST 2014
I'm a newbie and trying to enable the pull-down resistor on LPCXpresso-LPC1347, but it looks like I'm not doing it right.
I want it enabled on port 0 pin 6, so I did the following :
// Set MODE bits to 0x1
LPC_IOCON->PIO0_6 |= (1 << 3);
LPC_IOCON->PIO0_6 &= ~(1 << 4);
// Enable clock for IOCON block - Not sure if this is needed
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);
I'm still reading value 1 from this pin when disconnected, and my voltmeter reads ~ 2.4 volts.
I expected that I would get value 0 by default, and that I would read ~ 0 volts on this pin after the pull-down is activated.
What am I doing wrong?