LED (Light Emitting Diodes) : LPC2148 LPC2148 Development Board
LED (Light Emitting Diodes) : LPC2148 LPC2148 Development Board
Light Emitting Diodes (LED) is the most commonly used components, usually for displaying pins
digital states.
Interfacing LED
Fig. 1 shows how to interface the LED to microcontroller. As you can see the Anode is connected
through a resistor to GND & the Cathode is connected to the Microcontroller pin. So when the Port
Pin is HIGH the LED is OFF & when the Port Pin is LOW the LED is turned ON.
Flash a LED using the LPC2148 Development Board. It works by turning ON a LED & then turning
it OFF & then looping back to START. However, the operating speed of the microcontroller is very
high so the flashing frequency will also be very fast to be detected by human eye.
The ARM7 LPC2148 Development Board has eight numbers of point LEDs, connected with I/O
Port lines (P1.16 – P1.23) to make port pins high.
Source Code
The Interfacing LED with LPC2148 program is very simple and straight forward, that uses a delay
procedure loop based software delay. In C programs you cannot be sure of delay, because it depends
on compiler how it optimizes the loops as soon as you make changes in the options the delay changes.
**********************************************************************************
*****
**********************************************************************************
****
To compile the above C code you need the KEIL software. They must be properly set up and a project
with correct settings must be created in order to compile the code. To compile the above code, the C
file must be added to the project.
In KEIL, you want to develop or debug the project without any hardware setup. You must compile the
code for generating HEX file. In debugging Mode, you want to check the port output
without LPC2148 Development Board.
The Flash Magic software is used to download the hex file into your microcontroller IC LPC2148
through UART0.