AnsweredAssumed Answered

LPC1225 LED BLINKING PROGRAM NOT WORKING

Question asked by Dhinesh E on Oct 4, 2017
Latest reply on Oct 9, 2017 by Kerry Zhou

Hi frnds,

 

i am trying to program led blinking in P0_30 using LPC1225/301 microcontroller . there is no error in this program. But led is not blinking. can anyone suggest me what is the problem in this program.

 

#include<lpc122x.h>
void delay(unsigned short int ms) ;
int main(void)
{

LPC_SYSCON->SYSAHBCLKCTRL |=(1UL<<31)|(1<<30)|(1<<29);
LPC_IOCON->PIO0_30 &=~0xFF;
LPC_IOCON->PIO0_30 |= (1<<4)|(1<<7);

LPC_GPIO0->DIR |= (1<<30);

LPC_GPIO0->CLR |= (1<<30);
while(1)
{


LPC_GPIO0->SET |= (1<<30);
delay(1000);

LPC_GPIO0->CLR |= (1<<30);
delay(1000);

}

}
void delay(unsigned short int ms)
{
unsigned short int j;
unsigned long i;

for(j=0;j<ms;j++)
for(i=0;i<1700;i++);
}

Outcomes