Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

GPIO not working with lpc 2103

Status
Not open for further replies.

freemanantony

Member level 4
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top