Good morning guys,
I have got a problem with LPC2148. I am using PORT0 as GPIO pins. The program runs fine in the simulator but there is nothing when i port the hex on the board.
Here is the code:
#include<lpc214x.h> #include "delay.h"
void main() { PINSEL0=0x00000000; IODIR0=0xffffffff;
while(1) { IOPIN0=0xffffffff; delay(500); IOPIN0=0x00000000; delay(500); } }
delay is nothing but come commands running during that time. Simulator shows good behaviour of delay functions.
I have checked on "Use Memory layout from the target dialog". But still no output. Am i doing something wrong in the code. or should i take care of something else too? Please help.
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!