This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC214X port 1 GPIO

I cant get the right input form port 1.
My program waits until a button is pushed and then executes some code.

the program itself works fine when i use port 0 but i I'm working on a dev board and i need the port 0 to communicate with the onboard devices.
So i want to use port 1 for my push buttons and leds.

PINSEL0 = 0;            //set port0 to IO
PINSEL1 = 0;
PINSEL2 &= ~0x0000000C;     //set port 1 to IO
PINSEL2 |= 0x00000030;

DelayProc(0.2 * CCLOCK); //delay

IO1DIR = 0x00FF0000; //16->23 output; 24->31 input;

//wait until push
while((IO1PIN & 0x01000000)!=0x01000000);

//leds 1.16 to 1.23 on;
IO1SET = 0x00FF0000;


//end of demo.

the leds work but the button doesn't.
it is like the button is always pressed.

could anyone give me some advise on how i could use port 1 as input?