Vous êtes sur la page 1sur 17

EE40, Spring 2015, Pre-Lab 2

Lab Equipment and Programming MSP430

The grading policy for the lab sessions is given in the following table.
Lab 1
Lab 2 Lab 8

Prelab Assignment
Being Present Lab Assignment
Table 1. Grading policy for lab sessions

You will also do a project at the end of the course. The 8 lab sessions all together will only contribute to
70% of your final lab grade and the other 30% will come from your project.
Overall Lab Grade
Lab 1- Lab 8
Table 2. Overall lab grade is equally divided between lab sessions and the final project
There is no prelab assignment for lab-1. The first prelab assignment is for lab-2. You should submit each
prelab assignment before beginning of that lab on Gradescope of your lab section. This will be different
than the Gradescope page of the course where you submit your homework and you should have already
received a notification for being registered to the Gradescope page of your lab in addition to the main
course. If not, you can email your lab GSI to do that for you.
You will complete the lab assignments during the lab sessions. You should ask your GSI to verify it and
check you off the list at the end of each lab session before you leave.
Even though it is not recommended, you are allowed to complete your lab assignments outside the lab
before beginning of the session. In that case you will still need to show up to the lab session and make
sure your GSI verifies that you have completed all the required tasks correctly and checks you off the list.

Objectives of Lab 2
One of the important tools that you will be using throughout the EE40 lab is the Multisim circuit simulator.
In the prelab assignment you are asked to simulate a few circuits to get used to its environment.
Remember that you are NOT asked to build all the circuits that you simulate. It will be explicitly mentioned
whenever you need to build a circuit. In this lab you will only explore the basic lab equipment and program
the MSP430 controller to blink an LED. Below are the tasks that you should complete for lab 2.

Prelab assignment (to be completed before your lab session)

o Simulations: S.1 to S.4
o Questions: Q.1 to Q.4 and the bonus (extra credit) question
Lab assignment (to be completed during your lab session)
o Explore the basic lab equipment
o Program your MSP430 microcontroller to blink the LED on the launchpad


Basic lab equipment

MSP430 controller
Introduction to Multisim
Basic circuit theories
Prelab assignments
Lab guideline

1. Basic Lab Equipment

Figure 1 shows a typical lab bench in EE40 lab. You can see the computer unit in the right side of
the picture and the instruments in the left side. You are already familiar with the soldering iron
from your first lab session and we wont go through it again in this document. But you can find an
introduction to all other instruments and references to their datasheets here.

Figure 1. A typical lab bench in EE40 lab


A breadboard (or protoboard) is a construction base for prototyping of electronics.
Because the solderless breadboard does not require soldering, it is reusable. This makes
it easy to use for creating temporary prototypes and experimenting with circuit design.

Figure 2. Plastic solderless breadboard

1.1.1. Internal Layout of a Breadboard

Solderless breadboards are available from several different manufacturers, but most
share a similar layout. The layout of a typical solderless breadboard is made up from
two types of areas called strips. Strips consist of interconnected electrical terminals.

Figure 3. Layout of a commonly-used breadboard

1.1.2. Terminal Strips

The main areas, to hold most of the electronic components. In the middle of a
terminal strip of a breadboard, one typically finds a notch running in parallel to the
long side. The notch is to mark the centerline of the terminal strip and provides
limited airflow (cooling) to DIP ICs straddling the centerline. The clips on the right and
left of the notch are each connected in a radial way; typically five clips (i.e., beneath
five holes) in a row on each side of the notch are electrically connected. The five clip
columns on the left of the notch are often marked as A, B, C, D, and E, while the ones
on the right are marked F, G, H, I and J. When a "skinny" dual in-line pin package (DIP)
integrated circuit (such as a typical DIP-14 or DIP-16, which have a 0.3-inch (7.6 mm)
separation between the pin rows) is plugged into a breadboard, the pins of one side
of the chip are supposed to go into column E while the pins of the other side go into
column F on the other side of the notch.
1.1.3. Bus Strips
To provide power to the electronic components. A bus strip usually contains two
columns: one for ground and one for a supply voltage. However, some breadboards
only provide a single-column power distribution bus strip on each long side. Typically
the column intended for a supply voltage is marked in red, while the column for
ground is marked in blue or black. Some manufacturers connect all terminals in a
column. Others just connect groups of, for example, 25 consecutive terminals in a
column. The latter design provides a circuit designer with some more control
over crosstalk (inductively coupled noise) on the power supply bus. Often the groups
in a bus strip are indicated by gaps in the color marking. (1)

(1) The information and drawings given about the breadboards are from the Wikipedia page for
breadboards. Please refer to this page for more details.

Bus strips typically run down one or both sides of a terminal strip or between terminal
strips. On large breadboards additional bus strips can often be found on the top and
bottom of terminal strips.(1)

Note: Please refer to Module 0.4 on Edge to watch videos about breadboards. You
can also use the solderless breadboard video on YouTube.

Programmable Power Supply

In many applications, electronic equipment is powered by batteries. However,
prototyping circuits that are battery powered is problematic because discharged batteries
are always a hazard. The power supply eliminates this problem.

Figure 4. Agilent E3631A Programmable Power Supply (1)

The programmable power supply also helps us avoid inconsistencies in powering our
circuits by delivering a constant voltage, which you can set by changing the output
Most laboratory supplies also have a current limit feature that you can use to set the
maximum current the supply will deliver regardless of what voltage you specify.
But why should we set the current limit? Suppose you are testing a new circuit with your
brand new $1 million chip. You expect your new chip to nominally draw 100. But
unfortunately for you, you wired something wrong and instead of drawing 100, your
chip draws 1 (104 times more than what you expected it to draw!).
Your basic physics class in high school taught you that power is proportional to voltage
times current ( = ). Even if voltage is set at 1V, your brand new $1 million chip has
dissipated a lot of power in the form of wasted heat. Now, your brand new $1 million chip
is fried or your programmable power supply needs a new fuse.
The current limit is designed to prevent exactly this. The current limit will prevent the
output current from exceeding a certain value so that excessive current flow will not
destroy your setup. We usually set the current limit at a small margin above nominal
draw. (Usually 100mA to 200mA is usually a good start).
Note: If you need more information on the Agilent E3631A programmable power supply
please refer to its user guide by clicking here or watch the YouTube video about E3631A

(1) Photo from www.keysight.com.


Digital Multimeter (DMM)

The digital multimeter measures a number of different quantities, from capacitance and
resistance, to frequency. In this lab, we are most interested in voltages and currents. We
will use the DMM not only to check the output of the circuits we design, but also to verify
our setup.
Some of the questions you should consider when using the DMM are:

Does the voltage supplied to the circuit have the correct value?
Is the supply current in the expected range (i.e. not something like 10kAmps)?

Performing sanity checks like these will make your life much easier in the lab.

Figure 5. Agilent DMM 34401A (1)

Note: You will use Agilent DMM, 34405A, in EE40 lab. For more information please refer
to its user guide by clicking here or to its introductory video here.


Function Generator
Function generators are another category of electronic test equipment that are used to
generate various waveform shapes over a wide range of frequencies. Most of the function
generators can generate the popular waveforms like sine, square, triangular, and sawtooth. In addition to these waveforms, the Agilent 33522A that you will use in the EE40
lab is also capable of generating arbitrary waveforms that can be defined via computer
interface by the user. The maximum frequency for this function generator is 30MHz.
It should be noted that function generators are a subcategory of larger group of
instruments that are called signal generators. For more specialized applications and wider
frequency range other types of signal generator may be more suited.

Figure 6. Agilent 33522A function/arbitrary waveform generator (1)

Note: For more information about Agilent 33522A please refer to its user guide by clicking
here. For more general information about function generators please watch the YouTube
video here.

(1) Photos from www.keysight.com.


An oscilloscope (sometimes called scope) is an electronic measurement instrument
primarily intended to provide visual description of the electrical signals as a function of
time, on a 2D screen. Nowadays, with advancement of technology, there are variety of
other complicated functions integrated in an oscilloscope unit. Most of these new
functions are a result of post-processing (computation) on the initially measured timedomain traces.

Figure 7. Agilent MSO-X 2014A Oscilloscope (1)

1.5.1. Channels
The oscilloscope used in EE40 lab is Agilent MSO-X 2014A. This oscilloscope has 4
different analog channels. This means it is capable of measuring 4 different test points
in your circuit simultaneously. There are also 8 digital channels that can be used to
have a clean view of the digital signals with only possible value (e.g. 0V and 5V). In
this case the input to the oscilloscope will be interpreted as a logical 1 if its value is
higher than a predefined threshold (e.g. 2.5V for the case of a 0V/5V signal) and it will
be interpreted as 0 otherwise.
1.5.2. Trigger
Most of the times the analog signals generated by electronic circuits have some sort
of periodicity. In order to continuously maintain the alignment of different periods of
such signals that overlay on top of each other on the scope screen, a vertical level (i.e.
voltage level) is defined in an oscilloscope that is called the trigger level. Whenever
the input waveform crosses this trigger level a trigger event happens. For instance,
for an analog square wave that goes from 1V to 2V, if you set the trigger level to 1.5V,
then whenever a rising (and/or falling) edge of the signal crosses this level, a trigger
event happens. The oscilloscope aligns all the trigger events on its screen to maintain
alignment between different periods of the signal and show a bright cluster of traces
that are finely overlaid on top of each other. The trigger level can be set automatically
or by the user.
1.5.3. Scaling the Screen
The signals coming from different circuits can be at very different time scales and
amplitudes. In order to efficiently use the screen to view a signal the oscilloscopes
have the option to scale both the horizontal and vertical axes on its screen or move
the zero-voltage point. The horizontal axes will always have the same scale for all of

(1) Photos from www.keysight.com.

the four input channels, but the vertical axes can have different scale or zero-voltage
level for different input channels. These parameters can be set automatically using
the Auto Scale button on the top-right corner of the front panel or manually using
the knobs provided for voltage level and scale of each channel and the time axes.
Note: For more information about Agilent MSO-X 2014A please refer to its user
guide by clicking here. For more general information about oscilloscope please
watch the YouTube video here.

2. MSP430 Controller
A Controller is a small computer unit that can offer control, flexibility and programmability to
an electronic system like a robot. Among many different controllers that could power your robot
we chose MSP430 assembled on a launchpad. MSP430 meets requirements of your project.
Having the controller assembled on a launchpad with some peripherals makes using it more
convenient. It provides a mini-USB port that can be used to connect the controller to a computer
and program it. Furthermore, all the pins of the controller are fanned out on the launchpad that
makes using it a lot easier.

Figure 8. MSP-EXP430G2 Launchapd (1)

You also need a software interface to program the controller on your launchpad. Either Energia
or Code Composer can be used for this purpose. Code Composer is already installed on the
computers available in the lab. Energia is an open source software that you can download from
Note1: Watch module 0.3 on Edge to learn more.
Note2: For more information about MSP430 controller please refer to its datasheet here.
Note3: For more information about Code Composer please click here.
Note4: For more information about Energia please refer to enrgia.nu.

(1) Photos from www.ti.com.

3. Introduction to Multisim
Multisim is a user friendly simulation environment from National Instruments Corporation that
can help you understand and debug your circuits before building them in the lab. The very flexible
test and analysis tools provided by the simulators can make it much faster and easier to keep track
of different parameters in your design and modify your circuit until it meets all of your intended
requirements. In addition, making mistakes in a simulation environment is a lot less costly than
practical flaws which, under certain circumstances, can cost tens of thousands of dollars or more.
Although the simulation tools are getting more and more powerful and are providing very
accurate predictions of a circuits behavior, it should be noted that there is always a small
difference between the simulation and experimental results caused by numerical approximations
in the simulators or practical imperfections in the actual circuit. Sometimes such differences are
simply negligible, but a good designer should always be aware of causes and effects of these
(subtle) deviations to take them into account if necessary.
There are many different simulators available for circuit designers. Some of them like Multisim
are more suited for education purposes and simple circuit simulations with discrete components.
Other simulators with more sophisticated tools are also available for specialized design areas like
integrated and/or high frequency circuits.
Multisim provides you with a very simple graphic interface where you have access to a library of
electrical components to virtually build up your circuit. Then you can run different types of
analysis on your circuit to predict its behavior if you were to build it.
For this lab session you are supposed to start using Multisim but you wont be asked to physically
build the circuits that you simulate. In the next lab sessions your simulations will be closely related
to the circuits that you will build during that lab session. In order to get started with Multisim
please refer to its user guide from National Instruments by clicking here.

4. Basic Circuit Theories

Here you can find summary of a few basic circuit theories that can help you in understanding and
completing your prelab assignment.

As it is understood from its name, a resistor is an electrical element that can cause
resistance on the path of the electrical current. There are many analogies to understand
how a resistor works. One common analogy is to think of the electric current as a water
flow. If you decrease the diameter of a pipe and stuff it with a porous material then for
the same amount of applied pressure difference at its to ends (like voltage difference
across a resistor) you will get less water flow (like current in a circuit); or, equivalently, if
you want to push same amount of water per unit time through a narrow stuffed pipe you
will need to apply a larger pressure compared to that needed for a wide open pipe.
Also if you increase the length of the narrow stuffed pipe then you will need more effort
to push water through it. And, finally, as you increase the density of the porous material
in the pipe you will have a harder time to create the same flow.

Based on this explanation, for a cylindrical piece of a conductive material the resistance
is proportional to its length and inversely proportional to its area. The proportionality
factor is unique for that specific material and is called resistivity of that material just like
density of the porous material in the pipe.

Figure 9. A cylindrical resistor made of material with resistivity equal to

Looking at this figure may raise a question in your mind. What about the resistance of the
wires? This is in fact a fair question, the wires can also have resistance, but their resistivity
is so low that generally makes their resistance negligible, even though their cross sectional
area may be much narrower than a typical resistor that you use in the lab. This is like
saying a resistor is similar to a piece of pipe filled with a very dense porous material that
prevents water from easily flowing through it but a piece of wire is like an open pipe.
In the lab we will commonly use cylindrical shaped carbon film or carbon composition
resistors. The value and tolerance of the resistor is generally coded by the colored rings
drawn around the resistor as shown in the figure below.

Figure 10. 4-, 5-, and 6-band color code system (1)

Note: To learn more about resistors please refer to modules 1.2 and 2.1 on Edge.

(2) Some material reproduced with permission from Ulaby, F. T., & Maharbiz, M. M. (2012). Circuits. 2nd Edition,
NTS Press.


Ohms law
According to Ohms law, if you apply a voltage across a resistor, the current passing
through it will be proportional to the applied voltage; and vice versa, if you let a current
pass through a resistor it will build up a potential across it that is proportional to the
applied current. The constant proportionality factor between voltage and the current
across a resistor is called the resistance of that resistor:
Ohms Law: =

Figure 11. Ohms law indicates proportionality between voltage and current across a resistor

Note: Please watch module 2.2 on Edge to learn more on Ohms law.

Kirchhoffs Voltage and Current Laws (KVL & KCL)

Kirchhoffs voltage law states that the directed summation of potential (voltage)
differences across electrical elements that are connected in a loop is zero.
Kirchhoffs current law states that the directed summation of the current flowing through
electrical elements connected to a single node is zero.



Figure 12. Kirchhoffs circuit laws (a) KVL and (b) KCL

Note: Please watch module 1.2 on Edge to learn more on Kirchhoffs laws.


Parallel and Series Connection of Resistors

Resistors can be put together in many different configurations. Among all of these
topologies, parallel and series connections are of more importance and are frequently
used to simplify large resistive networks.
The figure given below shows series and parallel connection of resistors. If a parallel or
series connection of resistors is a part of a larger circuit network, we can replace them
with their equivalent resistor without affecting operation of the other elements in the



Figure 13. Equivalent resistance for (a) series and (b) parallel connection of resistors

If we refer back to our passage analogy for resistors, this is like replacing n parallel
passages with a single wider passage or n series passages with a single longer one.

Equivalent Resistance
We saw that a series or parallel connection of resistors can be replaced with a single
resistor with the value of their equivalent resistance. More generally, it can be shown that
any connection of resistors between two terminals can be replaced with a single resistor
of a unique value, which is called the equivalent resistance of that resistive network seen
from those two terminals. In order to make this clear lets consider the example in the
following figure.

Figure 14. The three resistors R1, R2, and R3 can be replaced by their equivalent resistance Req

The brute force way of finding equivalent resistance is to solve KVL and KCL equations for
the given branch and find its I-V relation. But generally (not always) a resistive network
can be simplified considering the relations we know for parallel and series resistors. For
instance, in the circuit shown above we can see that R2 and R3 are in parallel and, hence,
they can be replaced by their equivalent parallel resistance. Then the result is in series
with R1 so we can simply add them to find Req as shown in Fig. 15.

Figure 15. Finding equivalent resistance using relations for parallel and series resistors

These types of simplifications are a very important and powerful tool when dealing with
large network of elements. You will learn a few more tricks when doing your prelab

5. Prelab Assignment
You should complete your prelab assignment and submit it to the Gradescope account of
your lab section before beginning of your lab session. Prelab 2 should be submitted
before lab 2 and so on.
Prelab assignment consists of two parts. In the first part you will do a few simulations
using Multisim and in the second part you should answer a few intuitive questions about
those simulations. In this lab you wont build the circuits that you simulate, but we will
still keep things interesting! To do so, we have picked certain circuit topologies that
simulating and understanding them will help you learn a powerful circuit analysis trick
that can be useful later on in this course or in your future career.

Consider the graph on the left side of the following figure. Assume that each blue line or
arc is a piece of conductor with a resistance proportional to the number written beside it.
The equivalent circuit schematic of this graph is shown on the right side of the figure.



Figure 16. a) Graphic representation of a resistive network b) Equivalent circuit schematic of the graph in (a)

Start Multisim and make the schematic shown in Figure 16.b for R=3. Refer to the user
guide of Multisim or ask your GSI in case you have questions.

S.1: Make a DC operating Point analysis and view the value of the voltage at the node
shown on Fig. 16. Take a snapshot from your schematic and the result of DC operating
point showing the value for the voltage. The result should look like the following figure.

Figure 17. DC Operating Point (OP) Analysis

S.2: Now replace the resistor R3 with two equal 6 resistors in parallel. From the theory
about equivalent resistance we know that this shouldnt change the voltage at node
X. Confirm this with another simulation and take its snapshot. The result should look
like the following figure.

Figure 18. OP analysis after replacing R3 with its equivalent parallel resistors

S.3: Add two 100 resistors between the two ends of R3-1 and R3-2 resistors as shown in
the following figure. Measure the current flowing through these two resistors with
another DC operating point simulation. Take a snapshot from your circuit and the result
as shown below.

Figure 19. OP analysis showing the voltage at node X and current passing through two 100 resistors

S.4: Now remove the two RX1 and RX2 resistors and leave their place open as shown in the
following figure. Redo the operating point simulation for voltage at node X and take a
snapshot from the result.

Figure 20. OP analysis showing the voltage at node X after removing RX1 and RX2 resistors


In this part you will answer a few questions about the simulation that you did in the
previous part, hence, it is important for you to finish all four simulations before starting
with the questions.
Q.1: One way of measuring equivalent resistance of a resistive network by using a
simulator is to apply a current between the two nodes of interest and measure the voltage
drop between them. The ratio between the measured voltage and applied current is equal
to the equivalent resistance. In first simulation (S.1) you applied a unity (i.e. 1A) current
to node X of the circuit in Fig. 17 and measured the voltage at that node. The ratio
between the measured voltage and applied current corresponds to the equivalent
resistance between two nodes in that circuit. Which two nodes are they? You can name
them or mark them on a snapshot.
Q.2: In the third simulation (S.3) you measured the current in resistors RX1 and RX2.
Imagine we dont know the result yet. In what direction would you predict the current
should flow in these two resistors, right to left or left to right? Use this to intuitively
explain why the result from the simulation was in fact predictable. (Hint: Think about the
symmetry in the circuit)
Q.3: In the fourth simulation we removed resistors RX1 and RX2 and left their connections
open. If the whole circuit was in a black box and we only had access to node X and
GND for actuation and measurement, could we sense this change? Use this to explain
the relation between equivalent resistance measured in the first and fourth simulations.
Q.4: Employ the series and parallel simplifications to find the equivalent resistance
between nodes X and GND in the circuit used for the fourth simulation. Compare your
result to the one from simulation.
Notice that finding equivalent resistance for the circuit used in the first simulation
wouldnt be as easy and you would need to write down and solve the KVL and KCL
equations to do so. However, by considering the symmetry of the network we could
significantly simplify it and find the equivalent resistance in a much faster way only by
hand analysis. Symmetry and anti-symmetry appear in numerous famous circuit
topologies and can be used to simplify complicated networks to get a better intuition and
have a faster hand analysis on them.
Note: Bonus question is right after the lab guide. It is optional for extra credit, but you
should submit it with your prelab assignment if you would like to get that extra credit.

6. Lab Guideline
This part will be done during your lab session (this is not part of your prelab assignment). In this
lab you need to program your controller to make the LED1 on your launchpad blink. Please
refer to MSP430 Launchpad Blinking LED on YouTube and ask your GSI if you need help.

Bonus Question

Note: This question is for extra credit. You are not required to answer it to get a full mark in your
prelab assignment, but if you would like to get the extra credit you should submit it with your
prelab assignment.
You already learned about simplifying the network for the graph in the following figure to find the
equivalent resistance between nodes X and GND.

Figure 21. The graphic representation of the circuit that we used in the simulation assignments

In this graph all the arcs and lines are on a planar circular strip. This time lets play with a Mobius
strip instead; to do so you take the initial strip, cut it in the bottom, twist one side and connect
back the two ends. This process is shown below:

Figure 22. Making a Mobius strip from a planar strip

Assign the following resistor values to all the arcs and lines in the Mobius strip that you built
(similar to what we did for the planar strip) and find the equivalent resistance between nodes X
and GND. You are only allowed to use symmetry and series and parallel resistors
simplification. You wont get any point for writing KVL and KCL for this question!
You will get 20% of the points for drawing the schematic correctly. Another 60% of it for explaining
how the symmetry can be used to simplify the circuit and have only parallel and series resistance.
And the final 20% for having the correct answer. If you just give the answer without any
explanation you wont get any points for it.
Hint: The schematic should be very similar to that of the planar strip only with a small
modification. You can take that schematic and see how it should change to correspond to this
case. Then update the resistor values according to the values given in the following figure.

Figure 23. Graphic representation of the circuit on a Mobius strip