#include <iolpc2378.h>
#include "irq.h"
#include "config.h"
void delay()
{
unsigned int i,j;
for(i=0;i<0x3fff;i++)
for(j=0;j<0xff;j++);
}
11
Exp.No:
EXPT:2
Date
FLASHING OF LEDS
Aim
To perform the flashing of LEDs with ARM 7 controller
Components Required:
1. LPC 2378 ARM Development board
2. IAR Embedded Workbench 6.5
3. Flash Magic ISP Utility
Theory
LED (Light Emitting Diodes) Light Emitting Diodes (LED) is the most commonly used
components, usually for displaying pins digital states. Typical uses of LEDs include alarm
devices, timers and confirmation of user input such as a mouse click or keystroke. Light
Emitting diodes are most commonly used components, usually for displaying Pins Digital
state. The 8 nos of LED are connected to pin Q0-Q7.The 330 ohm resistor limit the current to
about 4 mA. A low output pin drives current through the LEDs and they will light. Each Led
can be individually enabled or disabled. The digital data sent by the microcontroller is latched
using 74LS273. This latch is selected via 74LS154 decoder.
12
OUTPUT:
13
PROCEDURE:
1. Run the Application IAR Embedded Workbench 6.5
2. Create new project in the current work space. Create a new project by selecting the tool
chain as ARM and create empty project and click ok. Give Project Name and click
SAVE Button.
3. Select LPC2378 >Options menu
4. Select General options category. Enable target option file and select the device as NXP
LPC2378 and click ok.
5. Select C/C++ Compiler >Select Preprocessor and include (C:\Program Files\IAR
Systems\Embedded
Workbench
6.5\arm\inc\c,
C:\Program
Files\IAR
Systems\Embedded Workbench 6.5\arm\inc\NXP)
6. Enable Output Converter Menu and select output format as Intel extended and Enable
Override default option
7. Select Linker Category. Enable Override default option, click SAVE Button.
8. New>File Menu, for creating a new C file. File>Save As, for saving a file. Give your
File name ( Eg: LED.C) and click Save Button.
9. Right Click the project name option for select a C file in
workspace window. Select Add >Add (LED.C) Menu.
10. Select LPC2378>Rebuild all menu, for checking any error in your C file. If your
Cfile has no error.
11. Select LPC2378>Rebuild all menu, for checking any error in your C file.
12. If your project has no error, Building completed and Hex file generated.
13. This Hex file will be downloaded to the VIARM-2378 controller by Flash Magic
Software
14
15
RESULT:
16