We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
I don't know your device - can it be that you have a bit somewhere to distinguish between fast and slow GPIO for port 0...? that is implemented on the LPC2478.
its the lpc2148 processor i use on the easy arm development board.