Lab Report No 1 Microprocessor Systems
Lab Report No 1 Microprocessor Systems
Subject:
Microprocessor Systems
Submitted To:
Engr. SIR ATIF
Submitted By:
Name: M Anjum Sarfraz . GCPKI00936
Ahsan Javaid GCPKI00938
Page 1 of 19
Experiment 1
Lab Objective
Page 3 of 19
5
Embedded System
Microcontroller Chemical
Electrical,
Processor Mechanical,
or Other
I/O Ports
devices
RAM
DAC
ROM ADC Analog
Signals
Bus
This lab is designed for the students having some experience in ‘C’
programming, but no prior experience with embedded systems. In this
lab, we assume that you have basic understanding of digital logic design
and analog electronics.
Hardware Required
The key component used in the tutorials is the Stellaris Launchpad board
produced by Texas In-struments (TI). The board, illustrated in Figure 1.2,
includes a user con gurable LM4F120H5QR micro-controller with 256 KB
ash and 32 KB RAM as well as integrated circuit debug interface (ICDI).
With appropriate software running on the host it is possible to connect to
the LM4F120 processor to download, execute and debug user code.
In Figure 1.2, there is a horizontal white line slightly above the the midpoint. Below the line are the
LM4120H5QR, crystal oscillators, user accessible RGB LED, user accessible push-buttons and a reset push
button. Above the line is the hardware debugger interface including a 3.3V
6 CHAPTER 1. LABORATORY HARDWARE AND TOOLS
Stellaris® LaunchPad
BoosterPack XL
Interface (J1, J2, J3,
Stellaris® LaunchPad and J4 Connectors)
BoosterPack XL
Interface (J1, J2, J3, Stellaris®
and J4 Connectors) LM4F120H5QR
Microcontroller
MSP430™ MSP430™
LaunchPad-Compatible LaunchPad-Compatible
BoosterPack Interface BoosterPack Interface
Expansion Board
(a) UET Launchpad expansion board (b) Launchpad mounted on expansion board
level shifter, real time clock (DS1307) for I2C interfacing. Figure 1.3
shows the expansion board with and without launchpad mounted on it
Micro Direct Memory Access (µDMA) ARM® PrimeCell® 32-channel configurable μDMA controller
General-Purpose Timer (GPTM) Six 16/32-bit GPTM blocks and six 32/64-bit Wide GPTM blocks
Watchdog Timer (WDT) Two watchdog timers
Hibernation Module (HIB) Low-power battery-backed Hibernation module
General-Purpose Input/Output (GPIO) Six physical GPIO blocks
Analog Support
Analog-to-Digital Converter (ADC) Two 12-bit ADC modules with a maximum sample rate of one million
samples/second
Analog Comparator Controller Two independent integrated analog comparators
Digital Comparator 16 digital comparators
JTAG and Serial Wire Debug (SWD) One JTAG module with integrated ARM SWD
Package 64-pin LQFP
Operating Range Industrial (-40°C to 85°C) temperature range
2. Click on Project tab and choose New Vision Project from the drop-
down list as shown in Figure 1.8
11
Figure 1.9: Type the name of the project in Keil and save it
8. Next step after writing the code is to build your code. As shown in
Figure 1.16 click on Project menu and select Build Target from the
drop down list. You can also build your project by clicking Build
button in Build bar. Build Output window at displays the errors,
warning and build messages during build process. Double-click a
message to open the corresponding source le. Build button
translates modi ed or new source les and generates the executable
le. The Rebuild command translates all source les regardless of
modi cations. Simulation highlighted at the bottom signi es that we
are not downloading our code on hardware.
9. After successsfully building the code, you can run the program
through the Debug menu. As shown in Figure select the Start/Stop
Debug Session option from the debug menu
or press the debug button. Click on \OK" for the pop up window
showing \EVALUATION MODE, Running with Code Size Limit:
32K".
10. Open your uVision to full screen to have a better and complete
view. In Figure the left hand side window shows you the registers
and the right side window shows the program code. There are some
other windows open. You may adjust the size of them to see better.
Run the program step by step as shown in, you can observe the
change of the values in the registers. Click on the Start/Stop Debug
Session again to stop executing the program.