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

Prob with Port pin

Dear all I encountered a problem while monitoring port pins using LPC2368 with KEIL ULINK2 debugger & Keil microvision3. I have initialized Port pins P2.0 & P2.1 as I/P pins. I am monitoring these pins through polling

Here is the code which i have written for this purpose.

       FIO2DIR = 0XFFFFFFFC;  //Port 2.0 & 2.1 --Input ///

        FIO2MASK = 0xFFFFFFFC; //Only P2.0 & P2.1 enabled


                while(1)
        {

                while( (FIO2PIN & 0x00000001) )                                // Polling P2.0
                {
                        ............
                        ............

                 }


                while( FIO2PIN & 0x00000010 )                                  // Polling P2.0
                {
                        ..............
                        ..............
                        ..............


                }



        }

In this program pin P2.0 is working correctly ie when connected to Vcc
entering the loop & when connected to ground its coming out of the loop
But with P2.1 its not the same thing. The status of the pin is not getting
detected. What may be the reason for this or can you please tell me where
i am going wrong ...Please help me to solve this problem

Thanks & Regards
Giridhar

0