Content originally posted in LPCWare by NXP_Europe on Wed Jul 20 16:02:00 MST 2011
Hello swisstronics,
It should work!
Like Zero suggested, put all the files in a working directory.
Using Keils uVision: make a new project. In the project the following files should be added: startup_LPC11xx.s , system_LPC11xx.c and main.c
If you are not sure the software is running, enter the following few lines. The leds will blink 5 times after power startup.
Put these lines under:
[FONT=Courier New][SIZE=2] SysTick_Config(SystemCoreClock/100); // interrupt each 10 ms[/SIZE][/FONT]
[FONT=Courier New][SIZE=2] [/SIZE][/FONT]
[FONT=Courier New][SIZE=2]// 5 times led blinking[/SIZE][/FONT]
[FONT=Courier New][SIZE=2] for (i=0; i<=5; i++)
{[/SIZE][/FONT]
[FONT=Courier New][SIZE=2] counter = 20;
while(counter); // wait 20 * 10 mSec = 200 mSec
LPC_GPIO3->DATA &= ~(1<<3); // P3.3 low = LED ON
counter = 20; [/SIZE][/FONT]
[FONT=Courier New][SIZE=2] while(counter); // wait 20 * 10 mSec = 200 mSec
LPC_GPIO3->DATA |= (1<<3); // P3.3 high = LED OFF
}
[/SIZE][/FONT]The variable 'counter' should be defined at the beginning of the program.
Add in the Systick_Handler() the following line in the main loop:
[FONT=Courier New][SIZE=2] if (counter > 0) counter--;
[/SIZE][/FONT][FONT=Courier New][SIZE=2][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][/SIZE][/FONT]
[FONT=Courier New][SIZE=2]
[/SIZE][/FONT]