Experiment No. 3
Experiment No. 3
Experiment No. 3
Experiment no. 3
Aim: To write a program for Interfacing LEDs with LPC2148.
Interfacing Diagram:
Theory:
1
S.C.O.E. Department of E&TC Engineering (2021-22)
Embedded Processors
All ARM instructions are 32-bit long and have 3 operand encoding. All operands are
32 bits. It also supports multiply- accumulate instruction that gives 32- or 64-bit
results form 32-bit inputs. ARM has a load-store ISA. Most of the processors use a
3-stage pipeline consisting of fetch, decode and execution stages. The pipeline
executes one instruction per cycle. Newer versions of the ARM use 5- to 8-stage
pipelines which can operate at higher clock rate. Most of the ARM processors have
separate instruction and data caches.
Based on RISC design principles, ARM processors are simple designs taking less
silicon area with performance comparable to the powerful CISC machines. ARM’s
goal is to optimize the price/performance ratio rather than building the most powerful
processor in market. Another design goal for ARM processors is to have minimum
design time. This is achieved by the modular nature of ARM processors. Because of
the small chip area and use of static CMOS technology makes this processor energy
efficient. These processor have the capability to shut down the clock which is
important for Hence, it finds applications in many embedded applications.
Description: The pin connect block allows selected pins of the microcontroller to
have more than one function. Configuration registers control the multiplexers to
allow connection between the pin and the on chip peripherals.
2
S.C.O.E. Department of E&TC Engineering (2021-22)
Embedded Processors
Peripherals should be connected to the appropriate pins prior to being activated, and
prior to any related interrupt(s) being enabled. Activity of any enabled peripheral
function that is not mapped to a related pin should be considered undefined.
Selection of a single function on a port pin completely excludes all other functions
otherwise available on the same pin.
• Every physical GPIO port is accessible via either the group of registers providing
enhanced features and accelerated port access or the legacy group of registers
– GPIO registers are relocated to the ARM local bus so that the fastest possible I/O
timing can be achieved
– Mask registers allow treating sets of port bits as a group, leaving other bits
unchanged
• Bit-level set and clear registers allow a single instruction set or clear of any number
of bits in one port
3
S.C.O.E. Department of E&TC Engineering (2021-22)
Embedded Processors
Generic
Name Description Access Reset value
GPIO Port Pin value register. The current
IOPIN state of the GPIO configured port pins can R/W NA
always be read from this register, regardless of pin
direction.
On the board, 8 LED’s are provided in common cathode configuration. They are
interfaced to Port Pins P0.12 to P0.19. To make LED on, logic 1 is to be provided.
3. Call delay.
5. Call delay.
6. Go to step 2.
Procedure:
1. Click for Keil Icon which appearing after Installing Keil µVision 4.
4. Select Target Device Vendor (NXP) and then select specific chip LPC2148.
8. Now you add FileName.c file by adding source Group 1 Add files to Group
‘Source Group 1’.
10. Go to Options for Target ‘Target 1’. Click on Check Box Create HEX File.
11. Then go to Linker. Click on Use Memory Layout for Target Dialog.
13. Now you see 0 Error(s), 0 Warning (s). Then Hex File will create in Specific
Folder. Now to download it for you target hardware using Flash Magic Utility.
5
S.C.O.E. Department of E&TC Engineering (2021-22)
Embedded Processors
14. Connect USB cable to the board & detect which COM port is detected of your
PC.
15. Connect the power supply to the board and switch ON power Switch.
16. Start flash magic utility and select the appropriate device LPC2148 and serial
port settings.
17. Change the position of RUN/ISP switch to ISP mode. Ensure that you push the
Reset switch on the board before you click download button on the flash magic
utility.
18. Change the position of RUN/ISP switch to RUN mode & see the result.
Conclusion:
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
........................................................................................................................................
6
S.C.O.E. Department of E&TC Engineering (2021-22)