0% found this document useful (0 votes)
56 views

(1 Introduction To Laboratory Hardware and Tools

Uploaded by

Malix ism
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

(1 Introduction To Laboratory Hardware and Tools

Uploaded by

Malix ism
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Copyright © 2022 Department of Electrical Engineering, University of Engineering

and Technology Lahore, Pakistan.


Permission is granted to copy and distribute for educational purpose. However, any
commercial use of the material, in any form, is not allowed.

1
Experiment 1

Laboratory Hardware and Tools


Each day, our lives become more dependent on ‘embedded systems’, digital information tech-
nology that is embedded in our environment. Try making a list and counting how many devices
with embedded systems you use in a typical day. Here are some examples: if your clock radio
goes off, and you hit the snooze button a few times in the morning, the first thing you do in your
day is interact with an embedded system. Heating up some food in the microwave oven and
making a call on a cell phone also involve embedded systems. That is just the beginning. Here
are a few more examples: turning on the television with a hand held remote, playing a handheld
game, using a calculator, and checking your digital wristwatch. All those are embedded systems
devices that you interact with.

Exponentially increasing computing power, ubiquitous connectivity and the convergence of tech-
nology have resulted in hardware/software systems being embedded within everyday products
and places. The last few years has seen a renaissance of hobbyists and inventors building
custom electronic devices. These systems utilize off-the-shelf components and modules whose
development has been fueled by a technological explosion of integrated sensors and actuators
that incorporate much of the analog electronics which previously presented a barrier to system
development by non-engineers. Microcontrollers with custom firmware provide the glue to bind
sophisticated off-the-shelf modules into complex custom systems.

What are Embedded Systems?


Embedded systems are combination of hardware and software combined together to perform
a dedicated task. Usually, they are used to control a device, a process or a larger system.
Some examples of embedded systems include those controlling the structural units of a car,
the automatic pilot and avionics of aircraft, telematic systems for traffic control, the chipset
and software within a set-top box for digital TV, a pacemaker, chips within telecommunication
switching equipment, ambient devices, and control systems embedded in nuclear reactors. The
block diagram of embedded system is shown in Figure 1.1

Lab Objective
Development of an embedded system requires that combination of both hardware and software
components should perform their assigned tasks under the predefined circumstances. This
lab provides a series of experiments aimed at teaching hardware interfacing and embedded
programming skills. We follow the bottom up approach by starting with simpler tasks and

2
3

Embedded System
Microcontroller Chemical
Electrical,
Processor Mechanical,
or Other
I/O Ports
devices
RAM
DAC
ROM ADC Analog
Signals
Bus

Figure 1.1: Block diagram of an embedded system

gradually building on that to develop a complete embedded system.

Prerequisites for Lab


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
Hardware required for the experiments in this lab is listed below:

1. EK-TM4C123GXL - ARM Cortex-M4F Based microcontroller TM4C123G LaunchPad


(Previously known as Stellaris Launchpad Board based on LM4F120H5QR microcon-
troller)

2. Expansion Board based on different electronic components required to perform lab assign-
ments.

Tiva C Series TM4C123G LaunchPad


The key component used in the tutorials is the Tiva C Series TM4C123G (Stellaris) Launchpad
board produced by Texas Instruments (TI). The board, illustrated in Figure 1.2, includes a
user configurable TM4C123GH6PM micro-controller with 256 KB flash 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 TM4C123 (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 TM4C123GH6PM, crystal oscillators, user accessible RGB LED, user accessible push-
buttons and a reset push button. Above the line is the hardware debugger interface including
4 CHAPTER 1. LABORATORY HARDWARE AND TOOLS

Figure 1.2: Launchpad Board

a 3.3V voltage regulator and other components. The regulator converts the 5V supplied by the
USB connection to 3.3V for the processors and also available at the board edge connectors.

All the pins of Tiva C (Stellaris) Launchpad are brought out to well labeled headers – as we shall
see the pin labels directly correspond to the logical names used throughout the documentation
rather than the physical pins associated with the particular part/package used. This use of
logical names is consistent across the family and greatly simplifies the task of designing portable
software.

The TM4C123GH6PM (LM4F120H5QR) is a member of the TIVA C series (Stellaris) pro-


cessors and offers 80 MHz Cortex-M4 processor with FPU, a variety of integrated memories
and multiple programmable GPIO. This board provides far more computation and I/O horse-
power than is required for the tasks performed in the lab. Furthermore, the TM4C123GH6PM
(LM4F120H5QR) microcontroller is code-compatible to all members of the extensive Tiva C
(Stellaris) family, providing flexibility to fit precise needs.
5

Expansion Board
The headers on the Launchpad can be used to connect the external peripherals and electronic
devices to develop a custom application. Like other expansion boards, we designed our own
expansion board for the launchpad to explore different applications that our MCU can support.
This board helps students get familiar with different peripherals of MCU by interacting with
simple electronic components like seven segment display, 16x2 character LCD, temperature
sensor (LM35), analog potentiometer, MAX232 and DB9 connector for interfacing UART using
level shifter, real time clock (DS1307) for I2C interfacing. Figure 1.3 shows the expansion board
with and without launchpad mounted on it

(a) UET Launchpad expansion board (b) Launchpad mounted on expansion board

Figure 1.3: UET Launchpad Expansion board

Tiva C Series Overview


The TM4C123 (LM4F120) microcontrollers are based on the ARM Cortex-M4F core. The
Cortex-M4 differs from previous generations of ARM processors by defining a number of key
peripherals as part of the core architecture including interrupt controller, system timer and,
debug and trace hardware (including external interfaces). This additional level of integration
means that system software such as real-time operating systems and hardware development
tools such as debugger interfaces can be common across the family of processors.

The TM4C (LM4F) microcontroller provides a wide range of connectivity features such as
CAN, USB Device, SPI/SSI, I2C, UARTs. It supports high performance analog integration by
providing two 2MSPS (1MSPS) 12-bit ADCs and analog and digital comparators. It has best-
in-class power consumption with currents as low as 370µA/MHz, 500µs wakeup from low-power
6 CHAPTER 1. LABORATORY HARDWARE AND TOOLS

modes and RTC currents as low as 1.7µA. This Stellaris series offers a solid road map with
higher speeds, larger memory and ultra low currents.

TM4C123GH6PM Microcontroller Overview


The TivaC TM4C123GH6PM microcontroller combines complex integration and high perfor-
mance with the features shown in Figure 1.4.

Figure 1.4: TivaC TM4C123GH6PM Microcontroller Features

The Cortex-M4 core architecture consists of a 32-bit processor with a small set of key periph-
erals. The Cortex-M4 core has a Harvard architecture meaning that it uses separate interfaces
7

to fetch instructions and data. This helps ensure the processor is not memory starved as it
permits accessing data and instruction memories simultaneously. From the perspective of the
CM4, everything looks like memory – it only differentiates between instruction fetches and data
accesses. The interface between the Cortex-M4 and manufacturer specific hardware is through
three memory buses – ICode, DCode, and System – which are defined to access different regions
of memory.

The block diagram of TivaC Launchpad evaluation board in Figure 1.5 gives an overview of
how the Stellaris ICDI and other peripherals are interfaced with microcontroller.

Figure 1.5: Block Diagram of TivaC Launchpad Board


Stellaris Development Tools

8 CHAPTER 1. LABORATORY HARDWARE AND TOOLS

StellarisDevelopment
DevelopmentTools
Tools
To develop an application and run it on TivaC Launchpad, a software is required to write our

Development Tools for Stellaris MCUs


code, debug it and download it to the device. Fortunately, many IDEs are available for the
application development of TivaC Launchpad. Figure 1.6 shows different IDEs available for
development. In this lab, we will use Keil µVision4 as our development tool.

Eval Kit 30-day full 32KB code size 32KB code size Full function.
License function. limited. limited. Onboard
Upgradeable Upgradeable Upgradeable emulation limited

Compiler GNU C/C++ IAR C/C++ RealView C/C++ TI C/C++

Debugger / C-SPY / CCS/Eclipse-


IDE gdb / Eclipse Embedded µVision based suite
Workbench

Figure 1.6: Development Tools

What is CCS?...
9

Setup Keil µVision to Write Code


1. Run the software by clicking the icon on desktop, if available, or by clicking on Start →
All Programs →Keil µVision. An interface similar to one shown in Figure 1.7 will
open.

Figure 1.7: Keil interface on start

2. Click on Project tab and choose New µVision Project from the drop-down list as shown
in Figure 1.8

Figure 1.8: Create new µVision project


10 CHAPTER 1. LABORATORY HARDWARE AND TOOLS

3. Select and create a directory, then assign a name to your project (project name can
be different from folder name) then click on Save. Do not make a directory, file
or project name with a space in it. A space will prevent simulation from working
properly.

Figure 1.9: Type the name of the project in Keil and save it

4. To select a microcontroller double click on Texas Instruments and select TM4C123GH6PM.


Click OK.(See Figure 1.10 and 1.11)

Figure 1.10: Select the manufacturer of your microcontroller


11

Figure 1.11: Select the part number for your microcontroller

5. When prompted to copy ‘Startup TM4C123.s to project folder’ click on Yes or No


according to the requirement of your project.

Figure 1.12: Add or discard the startup file to the project

6. Right click on Source Group 1 under Target 1, click on Add New Item to Group
‘Source Group 1’... and elect the type of file you want to add (.s for assembly and .c
for C file), write its name in given space and click OK
12 CHAPTER 1. LABORATORY HARDWARE AND TOOLS

Figure 1.13: Add and save a new file to the project

7. Double click on the file name under Source Group 1 in Project window to open it in the
editor pane. Here, you can write and edit the code.

Figure 1.14: Edit the file in the text editor window

You might also like