Content originally posted in LPCWare by Thucydides on Mon May 28 03:14:32 MST 2012
Hello,
At least now I came to have a conclusion that P1.0, P1.1, P0.11, P1.2 of the LPC1343 doesn't work as GPIO.
Firstly I thought if I stop A/D clock feed they would work since these all 4 ports share A/D function.
But the result was different.
Though other all ports that share A/D worked properly but these 4 ports.
I write my code for reference.
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<16);
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<0);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<12);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<13);
LPC_SYSCON->SYSAHBCLKCTRL &= ~(1<<14);
GPIOSetDir( PORT1, 0, 1 );
LPC_IOCON->R_PIO1_0 &= ~0x7;
GPIOSetDir( PORT1, 1, 1 );
LPC_IOCON->R_PIO1_1 &= ~0x7;
GPIOSetDir( PORT0, 11, 1 );
LPC_IOCON->R_PIO0_11 &= ~0x7;
GPIOSetDir( PORT1, 2, 1 );
LPC_IOCON->R_PIO1_2 &= ~0x7;
while(1)
{
GPIOSetValue(PORT1, 0, 0);
GPIOSetValue(PORT1, 1, 0);
GPIOSetValue(PORT0, 11, 0);
GPIOSetValue(PORT1, 2, 0);
delay32Ms(0, 100);
GPIOSetValue(PORT1, 0, 1);
GPIOSetValue(PORT1, 1, 1);
GPIOSetValue(PORT0, 11, 1);
GPIOSetValue(PORT1, 2, 1);
delay32Ms(0, 100);
}
If there are someone who experienced that these 4 ports don't work write it.
Thanks,