lpcware

configuring I2C pins(5.2&5.3) as GPIO but not working

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Iyyappan on Mon Jan 11 23:39:01 MST 2016
Hi,

I am new to LPC1788.I need to use the I2C pins(5.2 & 5.3) as a GPIO on LPC1788 controller as given below.

Pinsel_ConfigPin(5,2,0);
Pinsel_ConfigPin(5,3,0);
GPIO_SetDir(5,(1<<2),1);//configured as output
GPIO_SetDir(5,(1<<2),1);//configured as output

I'm using this pins for External ADC.
while checking the User manual it says,
"For non-I2C operation, these pins remain open-drain and can only drive low,
regardless of how HS and HIDRIVE are set. They would typically be used with an
external pull-up resistor if they are used as outputs unless they are used only to sink
current. Leave HS = 1 and HIDRIVE = 0 (if applicable) to maximize compatibility with
other GPIO pins."

after adding Pull-Up register it remains low.

Outcomes