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 bought an ARM LPC2148 Development board and started uploading code in it. I wrote the code to blink the on-board 4 LEDs. It gets uploaded successfully in the board but the LEDs never blink (leave alone the blinking according to the code). I have rechecked the code again and again. I am getting 0 V on the pins(P1.16, P1.17, P1.18, P1.19) to which the LEDs are connected. I cannot figure out why this is happening. Help!!
The code is:-
#define LED2_ON() IO1SET=(1<<17)
#define LED3_ON() IO1SET=(1<<18)
#define LED4_ON() IO1SET=(1<<19)
#define LED2_OFF() IO1CLR=(1<<17)
#define LED3_OFF() IO1CLR=(1<<18)
#define LED4_OFF() IO1CLR=(1<<19)
{
unsigned int i;
for(;j>0;j--)
for(i=0; i<60000; i++);
}
int main(void)
PINSEL1 = 0x00000000;
PINSEL2 = 0x00000000;
LED1_ON();
Delay(25);
LED1_OFF();
LED2_ON();
LED2_OFF();
LED3_ON();
LED3_OFF();
LED4_ON();
LED4_OFF();
return(0);
hey, I have a fix for you. I was stuck at same place for about a week. its not a problem with delay element or your IC. its about your compiler settings. Steps to fix it: 1: open keil. 2: open flash from top menu. 3: click on configure flash tools. 4: go on to linker. 5: check the first three boxes. Now your code should work just fine. hope this helps!