2023-24 Lab Manual EE2314 Embedded Systems PTK
2023-24 Lab Manual EE2314 Embedded Systems PTK
Course Code:EE2314
Prepared by
Dr. P. T. Karule
Features
16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip
flash memory.
128-bit wide interface/accelerator enables high-speed 60 MHz operation.
In-System Programming/In-Application Programming (ISP/IAP) via on-
chip boot loader software. Single flash sector or full chip erase in 400 ms
and programming of 256 bytes in 1 ms.
Embedded ICE RT and Embedded Trace interfaces offer real-time
debugging with the on-chip Real Monitor software and high-speed
tracing of instruction execution. USB 2.0 Full-speed compliant device
controller with 2 kB of end point RAM. In addition, the LPC2146/48
provides 8 kB of on-chip RAM accessible to USB by DMA.
One or two (LPC2141/42 vs. LPC2144/46/48) 10-bit ADCs provide a
total of 6/14 analog inputs, with conversion times as low as 2.44 μs per
channel.
Single 10-bit DAC provides variable analog output (LPC2142/44/46/48
only).
Two 32-bit timers/external event counters (with four captures and four
compare channels each), PWM unit (six outputs) and watchdog.
Low power Real-Time Clock (RTC) with independent power and 32 kHz
clock input.
Multiple serial interfaces including two UARTs (16C550), two Fast
I2C-bus (400 kbit/s), SPI and SSP with buffering and variable data length
capabilities.
Vectored Interrupt Controller (VIC) with configurable priorities and vector
addresses.
Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny
LQFP64 package.
Up to 21 external interrupt pins available.
60 MHz maximum CPU clock available from programmable on-chip PLL
with settling time of 100 μs.
On-chip integrated oscillator operates with an external crystal from 1
MHz to 25 MHz.
Power saving modes include Idle and Power-down.
Individual enable/disable of peripheral functions as well as peripheral
clock scaling for additional power optimization.
Processor wake-up from Power-down mode via external interrupt or BOD.
Single power supply chip with POR and BOD circuits:
CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V
tolerant I/O pads.
2. Go to the Project tab. Select New µVision Project ...from that menu.
3. Create New Project window will pop up. Select the folder where you want to create
project and give a suitable name to the project. Then click on Save. (Exp3add)
4. Select Device for Target: ‘Target1’...window will pop up next. Select NXP then
LPC2148 and click on OK
5. A window will pop up asking whether to copy Startup.s to project folder and add file to
project. Click on No (for Assembly language programs).
6. The project name and its folders can be seen on the left side in the project window after
the previous step is completed as shown below.
7. Now go to File tab and add New file from the menu.
8. Write program in text window and save with extension .asm (e.g. exp3add.a)
13. File is added to source group (exp3add.a) Now compile >> Translate >> Build
14. To execute program: goto >> Debug >> start debug session >> Click OK (evaluation mode)
15. To view memory data : goto View >> memory window
15. To view memory data : Enter address 0x40000000 and data also
Using µVision IDE for
C Language Program
For Experiment no. 7 to 12
We will create a simple project to blink led. Following are steps which show how to create
and built project using the Keil uVision IDE:
1. Open Keil µVision from the icon created on your desktop.
2. Go to the Project tab. Select New µVision Project ...from that menu.
3. Create New Project window will pop up. Select the folder where you want to create
project and give a suitable name to the project. Then click on Save. (blinkled)
4. Select Device for Target: ‘Target1’...window will pop up next. Select NXP then
LPC2148 and click on OK
5. A window will pop up asking whether to copy Startup.s to project folder and add file to
project. Click on Yes (for C language programs).
6. The project name and its folders can be seen on the left side in the project window after
the previous step is completed.
7. Now go to File tab and add New file from the menu.
8. Write program in text window and save with extension .c (e.g. ledblink.c)
9. Right click on source group1 to add file ledblink.c
10. File is added to source group (ledblink.c) Now to build target hex file (compile)
Goto >> Project >>
Software used:-KeilμVision4IDE
Registers Data
R1 0x0000
R2 0x0000
R5 0x0000
Registers Data
R1 0x3000
R2 0x1000
R5 0x4000
Software used:-KeilμVision4IDE
Registers Data
R1 0x0000
R2 0x0000
R5 0x0000
Registers Data
R1 0x3000
R2 0x1000
R5 0x2000
Software used:-KeilμVision4IDE
Registers Data
R0 0x0000
R1 0x0000
R2 0x0000
R3 0x0000
Registers Data
R0 0x40000008
R1 0x03
R2 0x04
R3 0x07
Software used:-KeilμVision4IDE
Interfacing Circuit: -
/* P. T. KARULE */
/* Roll No. */
#include <lpc214x.h> //include header files for LPC-214x series
int j;
unsigned int
main ()
{
IO0DIR = (1<<7); //Configure the pin P0.10 as OUTPUT;
while(1) // While loop to execute program continueously
{
IO0SET = (1<<7) ; // Make the pin P0.10 HIGH (LED ON)
for(j=0;j<=100000;j++); // delay in sec
IO0CLR = (1<<7); // Make the pin P0.10 LOW (LED OFF)
for(j=0;j<=100000;j++); // delay in sec
}
}
Screen shot of Simulation Window: