24/07/2016
Embedded Systems Design ELEN90066
Lecture 2 Revision
David Jahshan
Assumed Knowledge
Mostengineeringmistakeshappenbecauseweassumethings, lets not do that with this subject!
Quickreviewof Voltages
BJTTransistorsandMOSFETs
Microcontrollersbasics
Thisisaquickreview,Iwillrunthroughthematerial.Ifyoudo not know something, look it up from your earlier subject notes. This is “assumed knowledge” from your previous years of study.
Important Items from last lecture
• Think for yourself
• Don’t copy
• If you are asked for help, discuss but don’t compare
• Remember the due date for the project 8am Sunday September the 11th
Voltage
Voltage is defined across 2 points eg: voltage A to B is 6v. Often a reference is useful 0v.
Floating Voltages
Voltages are floating unless they are connected to each other.
Ground/Earth is not necessarily 0v
Ground/Earthisnotnecessarily0v.OftenGroundisusedto name a reference that is not connected to the ground at all. (Often we refer to real Ground as Earth)
Examplebelowisoutputofdualpowersuppliesinlab
Earth Earth
1
24/07/2016
V=IR P=IV P=I2R
Basic Equations
Remember to use them!
If we have a 10v source, a resistor that is 5 ohms what is the current through it. 2 Amp. How much power is that device dissipating?
22×5=20Watts! What is the size of the resistors we are going to use? (0805 = 1/8 of a watt) Smoke
Bipolar Junction Transistor (BJT)
3 junction device made of doped semiconductor
Comes in two flavours NPN and PNP
Permits the control of current using another current source.
Can be used as an amplifier or switch.
NPN 4 Basic Rules of NPN BJTs
1) Collector must be more positive than emitter.
2) Base to emitter and base to collector circuits behave like diodes.
3) You should not exceed the
transistors I , I , V , and C B CE
other maximums (ie temp)
FE B is the current gain
4) When rules 1 to 3 true transistor is in active region and I is approximately h I
C where h
FE (AKA beta ß)
NPN as a Switch LetVCC=10vR1=100Ohm,R2=
1k,h =200,V =0.6v FE BE
IfVin=0vthenI is0thereforeno B
I . V = 10v, transistor is in cut off C OUT
IfVin=10v,V =0.6v,so9.4v BE
across R2.
I =9.4/1000=9.4mA(V=IR) B
I =9.4mAx200=1880mA C
(I =I h ) C B FE
ButR1=100,VCC=10vsoImust be less than 100mA (V=IR)
Rule1nolongerholds,transistor
saturates and V
and 0.4v depending on transistor and current
1.880 x 100 = 188v (V=IR) Therefore collector would need to be at -178v if VCC is at 10v -> saturation
OUT
is between 0.05v
PNP
SameasNPNbutreverseall polarities.
Usefulwhenswitchinghighside where C is not necessarily at GND.
RememberwhenusingaTransistor not as a switch, the voltage drop through the transistor is converted to heat. P=IV applies. If there is a 5v drop at 1Amp you are dissipating 5 Watts.
MOSFET s
Metal Oxide Semiconductor Field Effect Transistor.
Comes in two flavours N channel and P channel
Permits the control of current using a voltage.
Can be used as an amplifier or switch.
Have a thin Oxide layer on it’s inputs so it can be easily damaged by static discharge
2
24/07/2016
N Channel
Has4pins,Gate,Drain, Source and Body. The body is usually internally connected to Source.
When V
threshold voltage V device is in cutoff.
WhenV >V andV < GS th DS
WhenV >V andV > GS th DS
(V – V ) saturation region GS th
(V region
GS
GS
is less than a
– V ) triode/ linear th
th
then the
N channel MOSFET
Image from Wikipedia MOSFETs
P Channel
SameasNchannelbut reverse all polarities.
Usefulwhenswitchinghigh side where D is not necessarily at GND.
Rememberforany MOSFET that G is essentially a capacitor, you should have a resistor between G and a micro so you do not have a current surge.
Digital Systems
• Are analogue at heart
• High=3.3vto5vor1.2vto3.3v
• Low=2vto0vor1.2vto0v
• Tristate = not connected = floating
AND
OR
NOT
AND, OR, NOT
A
B
Out
0
0
0
0
1
0
1
0
0
1
1
1
A
B
Out
0
0
0
0
1
1
1
0
1
1
1
1
A
Out
0
1
1
0
Tristate Buffer
When output enabled is high: output = input When output enabled is low output = tristate
IN OUT
OE
3
24/07/2016
D Flip Flop
When rising edge of a clock (clk), the state of the input (D) is stored and made available on the output (Q) the inverse is also available (Q’)
DQ
Clk
Q’
Register
An 8 bit register is 8 D Flip Flops in parallel with their clocks wired together.
8
Input Output 8
Clk
Multiplexer, Demultiplexer
Multiplexer takes data and a channel and output a signal. Demultiplexer does the opposite
DRAM
Collection of Registers connected by multiplexers
and de-multiplexers
CS
Row Select Column Select
Data
Counter D Flip Flops in series
AB
DQ
Clk
Q’
DQ
Clk
Q’
Microprocessor
Instructions are stored in RAM, counter counts through the program (program counter), combination of AND, OR and NOT gates processes the instruction.
COUNTER
RAM
PROCESS
4
24/07/2016
Microcontrollers
Microcontrollers are microprocessors with integrated RAM, storage (ROM), and peripherals such as Pulse Width Modulation, Analog to Digital Converters, Bus Interfaces (SPI, UART), counters and timers, and I/O pins.
What you should remember from today
Voltage depends on it’s reference
V=IR, P=IV, P=I2R use them when working out power dissipation
BJTs and MOSFETs and how to use them as switches. Remember at the end of the day all digital systems are analogue
Basics of CPU architecture. If you can’t remember look at your notes from earlier subjects.
The Art Of Electronics Horowitz and Hill
5