Sei sulla pagina 1di 2

Microprocessor Based Systems II/Embedded Systems Design II

2nd Year 2nd Semester

Lab 04 Programing LPC1768 using Assembly Language


Department of Electrical and Computer Engineering
Faculty of Engineering
Sri Lanka Institute of Information Technology
Version 1.0 - June 2014

Objectives
1. Describe the steps of creating an assembly language project in KEIL microvision.
2. Explain the basics of I/O ports of LPC1768.
3. Implement simple LED patterns on LPC1768 using assembly language.

Requirements
1.
2.
3.
4.
5.
6.
7.

KEIL MCB1768 board


JTAG programmer
Schematics of KEIL MCB1768 board
User manual of LPC1768
Definitive Guide to ARM Cortex M3 textbook
USB cable
Computer running KEIL microvision IDE

Description
KEIL microvision IDE allows programmers to use assembly code in their projects and run
that code on real hardware. In this lab students will use a given example project of Assembly
language based software application to blink an LED on MCB1768.
Students are then expected to modify that project such that all 8 LEDs of MCB1768
repeatedly blink one after the other. When all 8 LEDs have blinked once, the pattern should
repeat itself. Thus it will be a continuous LED pattern till the system is reset.

Activities
1. Open microvision IDE from start menu or a short cut on desktop.
2. Close any existing project by Project-> Close Project.
3. Now create a new project in KEIL using LPC1768 of NXP and click yes to copy the
startup assembly file.
4. Copy the system_LPC17xx.c file also to your project folder and add it to your
source file group.
Page 1 of 2

5. Copy the given main.s file to your project folder and add it to your source file group.

Important: file extension of the assembly source files is .s


6. Build the project and download it to MCB1768 development board.
7. Run the program on LPC1768 and observe the output.
8. Study the main.s file and identify how it uses actual memory addresses of LPC1768
PORT registers.
a. Carefully note the operation of following registers
i. FIO1DIR
ii. FIO1CLR
iii. FIO1SET
b. Also note how memory accesses are performed using base registers and
offsets method.
c. There is a loop that repeats itself forever. Identify how it has been written
using branching instructions.
9. Refer the appendix A of textbook if you have any doubts on any assembly instruction
used in the test program.
10. Study the schematics of MCB1768 and identify how LEDs have been connected to
I/O ports of LPC1768.
11. Study the user manual of LPC1768 and identify all registers you can use to deal with
I/O ports.

Exercise
Extend this program or create a new project and obtain the LED pattern mentioned in the
description part of the lab sheet. Demonstrate your program and get it marked by the lab
supervisor.
*** End of lab sheet ***

Page 2 of 2

Potrebbero piacerti anche