(1 Introduction To Laboratory Hardware and Tools
(1 Introduction To Laboratory Hardware and Tools
1
Experiment 1
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.
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
Hardware Required
Hardware required for the experiments in this lab is listed below:
2. Expansion Board based on different electronic components required to perform lab assign-
ments.
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
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.
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
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.
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.
StellarisDevelopment
DevelopmentTools
Tools
To develop an application and run it on TivaC Launchpad, a software is required to write our
Eval Kit 30-day full 32KB code size 32KB code size Full function.
License function. limited. limited. Onboard
Upgradeable Upgradeable Upgradeable emulation limited
What is CCS?...
9
2. Click on Project tab and choose New µVision Project from the drop-down list as shown
in Figure 1.8
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
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
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.