Labsheet6
Labsheet6
Prelab Exercise:
1. What is a Microcontroller?
1
19EAC285: Microcontroller Lab
4. What is an IDE? What are the commonly used IDEs for embedded systems development?
Keil IDE: Keil Electronics, provides an Integrated Development Environment called Keil µVision
(pronounced Micro-Vision) that integrates a project manager, editor, compiler, debugger, and simulator in a
single powerful environment; it provides a high efficiency and clear graphic user interface for embedded
software development.
Step 4: In the Database tree as shown below, choose the vendor and then the chip you want to use and click OK.
If want to use LPC2148, click on the NXP then on the LPC2148, and press OK. (Or in the search box, type
LPC2148 directly and click OK)
2
19EAC285 Micro-Controller Lab
Note that in the text editor window, keywords appear in a different colour; it is to differentiate
keywords from variables, constants, and others,
3
19EAC285: Microcontroller Lab
4
19EAC285 Micro-Controller Lab
Register Window: The left most panel (in the following figure, it is walled in blue) is called the register window It
shows 16 general-purpose registers along with the Current Program Status Register (CPSR) and SPSR; this window
allows you to modify the contents. A register can hold a 32-bit signed, unsigned integer or a memory pointer. All C
variables map
5
19EAC285: Microcontroller Lab
Watch Window: Go through View-> Watch Windows-> Watch-1; this window allows you to view or monitor the
values of the variables or registers that are used in the program during run time (while the program is running); also
you may modify these values without disturbing or terminating the execution. To view the value of any variable the
variable should be added through the <Enter expression> field of the watch window.
Exercise1: Execute the following C-code in KEIL IDE to find the biggest among two numbers. View the change in the
registers in the register window and also the variables in the watch window.
6
19EAC285 Micro-Controller Lab
Exercise 2: Execute the following ARM Assembly code using Keil IDE; while typing the code proper indentation must
be provided as shown in the figure.
(Note: Start a new project, do not add Startup.s file, Save the file with.asm extension)
7
19EAC285: Microcontroller Lab