LPC1769 Read in GPIO pins

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1769 Read in GPIO pins

1,277 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Blogs on Mon Jun 11 18:39:32 MST 2012
Hi there,
I would like to know how to read in pin when they are set as GPIO inputs.

I have set the internal resistor as pull down.

I would like to input a voltage at a certain pin (eg. P0.11) and when trying to read the pin, it should say high at pin P0.11.

I understand that you use FIOPIN to read in values? Is that correct, and how do you use it?

So this is all I've done so far:
while(1){
LPC_GPIO0->FIODIR = (0 << 11);
LPC_GPIO0->FIOPIN = (0 << 11);
}


Thanks.
0 Kudos
3 Replies

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by irven on Fri Jul 06 00:34:16 MST 2012
hi blogs,

have you solved the problem?
i have exactly the same problem i´m not sure how to read a port.
0 Kudos

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Tue Jun 12 00:01:49 MST 2012
Hi Blogs,

you can hav a look to my code here:
http://knowledgebase.nxp.com/showthread.php?t=3060

Fred
0 Kudos

532 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Mon Jun 11 21:16:16 MST 2012
Let's see if you can answer this yourself.

Would reading the pin involve writing or reading from the FIOPIN register ?
and why would you keep setting the pin as an input pin in the while loop ?

Check the LPC1769 user manual, there is a GPIO section describing the registers.
0 Kudos