Using P0[7], P0[8] and P0[9] as digital inputs

cancel
Showing results for 
Search instead for 
Did you mean: 

Using P0[7], P0[8] and P0[9] as digital inputs

48 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by jonas2 on Thu Jun 06 08:18:42 MST 2013
I use an LPC1778 LQFP144</pre>
<pre>I set up the following pins as digital inputs:

P0[7]
P0[8]
P0[9]

I have 3.3 V on the pins but I only read '0's from the PIN register. I've tried to activate the internal pull-up with but the result was the same. 
These pins are of type W does this have an impact? I've used type D pins as digital inputs without encountering any problem.
Labels (1)
0 Kudos
3 Replies

6 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by jonas2 on Fri Jun 07 00:27:57 MST 2013

You're right, bit 7 if the respective IOCON registers were set to '0'. I set this bit to '1' and now these pins works as expected. Thanks!

0 Kudos

6 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Thu Jun 06 17:30:21 MST 2013

You can try this:


LPC_GPIO0-&gt;DIR = 0x0;<span class="Apple-tab-span" style="white-space: pre;"> </span>//set PORT0 as input
LPC_IOCON-&gt;P0_7 = 0xA0;
LPC_IOCON-&gt;P0_8 = 0xA0;
LPC_IOCON-&gt;P0_9 = 0xA0;


Just force the whole port to input and set the pins to the default state (and making sure bit 7 is set).  This worked for me.  The PIN register was changing value when I force the pins HIGH and LOW.

0 Kudos

6 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Thu Jun 06 13:24:47 MST 2013

This is indeed a specialty of the W type pins.


Have a closer look at the respective IOCON register, with particular attention to bit 7  :-)

0 Kudos