Lecture2 - Introduction To Microcontrollers
Lecture2 - Introduction To Microcontrollers
Introduction to Microcontrollers
C) An Arduino
B) A Small Computer
D) A Raspberry Pie
https://www.compadre.org/osp/pwa/soundanalyzer/
3
Digital Signals
➢ By contrast, a digital signal assumes only a finite number of values at
certain points at time.
➢ A “binary” waveform, remains at only one of two levels at each period.
➢ So long as the two voltages corresponding to ONEs and ZEROs differ
sufficiently, digital circuits sensing such a signal process it correctly
even if noise and distortion create some corruption.
➢ We therefore consider digital signals more robust than their analog
counterparts.
➢ The storage of binary signals (digital memory) is also much simpler.
5
Example: Light-Meter System
Op-amp Difference
Amplifier Wheatstone Bridge
Passive
Low-pass
Filter
Light-Dependent
Resistor (LDR)
6
Binary Numbers
➢ We are most familiar with the decimal (base
10) number system. For example, Volts
(1001)2 = 1 23 + 0 22 + 0 21 + 1 20 = ( 9 )10
7
Bit, Byte and Word
➢ Any digital line can only assume two
values: “0” and “1”.
➢ The exact voltages which represent the
two logic states can be 0V and 5V.
➢ Several digital lines (bits) are used to
represent a range of numbers.
➢ In the same way that base-10 numbers
can encode 𝟏𝟎𝑵 different values with N
discrete numbers in the range of 0-9,
𝟐𝑵 different values can be encoded by
N binary bits.
➢ Eight such bits make up a byte (e.g.,
the value 01101111 is a byte).
➢ Two or more bytes (16 or more bits)
are a word.
➢ Letters and other typographics can be
represented using the 7-bit ASCII
codes.
Tables from “Circuits”, F. Ulaby, M. Maharbiz, and C. Furse, National Technology & Science Press, 2015. 8
Analog-to-Digital Conversion
➢ The analog voltage can be
converted to digital using an
ADC to sample it, find the
closest step that matches the
signal, and convert the value of
that step to a digital value.
9
A Microprocessor is:
➢ A Circuit (chip) used in computers,
tablets, phones, etc.
➢ A digital system
▪ Perform bitwise calculations using
“Binary Logic”
➢ Highly flexible
➢ Part of smaller-circuit
➢ Less flexibility
11
The March of Arduino
➢ Have you used an Arduino before?
➢ Have you heard of one?
12
Alternatives to Arduino
➢ Texas Instruments Launchpads:
▪ Arduino might be quite simple to program and prototype because of
all the available APIs, but when it comes to better control of hardware,
MSP432 has the advantage.
▪ We can not only access the address space of MSP432 but also, we can
change a values of different registers which will appropriately affect
different settings.
▪ For the beginning stages Arduino can be used, but when performance
becomes critical, TI MSP432 works much better because of the control
over hardware.
13
Raspberry Pie vs Microcontroller
➢ The Raspberry Pi is a Single Board
Computer (SBC). This means that
the board is a fully functional
computer with its own dedicated
processor, memory, and can run
an operating system (runs on
Linux).
14
LaunchPad works with Energia
15
Pin Map
16
LEDs and Switches
17
Digital to Analog Conversion
18
Digital to Analog Conversion
➢ Launchpad Does not have any Direct DAC
Capabilities
20
PWM – Writing Analog in Energia
21
Color-Coded System
➢ Resistors are generally
marked with a banded color
code to denote the resistor’s
specifications.
22
Building with the Breadboard
➢ Each horizontal clip on the breadboard creates a node, so each ROW of the
board is one node, and any wires plugged in on that row are connected to
the same node.
➢ The vertical clips on the sides of the board create nodes that extend the full
length of each side of the board. They are marked with red and blue lines
and are often called rails.
➢ These rails are commonly used for power and ground by plugging a voltage
on the red rail and ground on the blue rail.
23
24
A node is a point where two components of a circuit can be connected.
25
26
27