GPIO not working with lpc 2103

Status
Not open for further replies.

freemanantony

Member level 4
Joined
May 19, 2010
Messages
70
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Chennai, India
Visit site
Activity points
2,005
hai everybody,
i am using lpc 2103 controller i wrote a simple code for lpc 2103 but the io pin is not working , i am attaching my code here
Code:
include <LPC2103.H>
//#include  "lpc21xx.h"

#define	  LEDCON	0x00002000		/* P0.17*/
//sbit  IN=P0^3;
//sbit  OUT=P0^17;

/****************************************************************************
* DelayNS()
****************************************************************************/
void  DelayNS(unsigned int  dly)
{  unsigned int  i;

   for(; dly>0; dly--) 
      for(i=0; i<50000; i++);
}
                               


/****************************************************************************
*main()
****************************************************************************/
  int main(void)
{  PINSEL0 = 0x00000000;		// Enable GPIO
   PINSEL1 = 0x00000000;
   
   IODIR = LEDCON;				// Enable LED4 Direction
      while(1)	
   {  
        /*if(IOPIN&0x00000008)
      IOSET =0x00002000;
	  else
	  IOPIN =0x00000000;*/
		 IOPIN = LEDCON;
      DelayNS(30);
      //IO0CLR = LEDCON;
      //DelayNS(30);
		
   }
   return(0);
   
}

- - - Updated - - -

can anyone help me on this?
 
Last edited:

Hi dear,

This link might be helpful for you

**broken link removed**

Good wishes
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…