EE 109 Unit 18 - Noise Margins, Interfacing, and Tri-States
EE 109 Unit 18 - Noise Margins, Interfacing, and Tri-States
EE 109 Unit 18 - Noise Margins, Interfacing, and Tri-States
Signal Types
• Recall even digital signals are just voltages…
• Analog signal
– Continuous time signal where each voltage level has a unique meaning
• Digital signal
– Continuous signal where voltage levels are mapped into 2 ranges
meaning 0 or 1
volts
volts
1
Threshold 1
0 0 0
time
time
Analog Digital
3
Logic 1
2.0 V
Illegal
Threshold Range
0.8 V
Logic 0
0.0 V 0.0 V
A Motivating Example
Example 1 Example 2
• You connect an output port to an LED • You have correctly built a circuit
(light emitting diode) and connect using chips provided by your
everything correctly. The light should instructor and verified its outputs
turn on when you set your output bit to
a high voltage (logic '1'). • You then attempt to interface it
• When you turn the system on the LED
to a specific microprocessor
does not glow. You measure the • When you connect them the
voltage at the gate output with a microprocessor indicates that it
voltmeter and find it is not 5V but never senses your circuit
2.3V? Why isn't it a logic 1? producing logic '1'. Why?
• The maximum current output ability • Different circuit implementation
from the output port is not high
techniques use different voltage
enough to adequately supply the LED
which then drags the voltage down.
levels to indicate '1' or '0' and
may be incompatible
Lesson To Be Learned: Not all 1's or 0's are created equal!
6
NMH =
Logic 1
Logic 1
VOH VOH-VIH As long as
VOH > VIH and
VOL < VIL we are in
good shape…
VIH
Electromagnetic
interference & power
Illegal
Illegal
spikes can cause
VIL this to break down
Logic 0
Logic 0
VOL
NML =
0.0 V VIL-VOL 0.0 V
8
Class Activity
• Do an internet search for "74LS00 datasheet"
(this is a chip w/ some 2-input NAND gates)
and try to find any PDF and open it
• Skim the PDF and try to find:
– VOH, VIH, VOL, VIL
9
Analogy
• Consider a sprinkler system…what will happen if you add 100
new sprinklers to your backyard?
• Pressure (voltage) will go way down and reduced water
(current) flow coming out of each
10
Current Limitations
• When a circuit outputs a 'HIGH' ('1') it can only supply (source) so much
current (think of your garden hose spigot) = IOH
• When a circuit outputs a 'LOW' ('0') it can only suck up (sink) so much
current = IOL
• When a circuit receives a 'HIGH' signal on the input side it may need a
certain amount of current to recognize the input as 'HIGH' = IIH
• When a circuit receives a 'LOW' signal on the input side it may need a
certain amount of current to recognize the input as 'LOW' = IIL
IIH IIL
1 0
IOH IOL
11
Consideration
• If we attach too many gates to one output it
may not be enough to drive those gates
• Need to make sure the current
requirements and capabilities match
• Let's say we connect one of the NAND gates
on the 74LS00 chip to an input of N other If IOH or IOL is too low we can
NAND gates… split the loads by place
intermediate buffers
• Can it produce/suck up the required
current…
• …if N = 6?
• …if N = 12?
12
A VOH=2.2V VIH=3.5V
B
13
Arduino Limits
• Arduino outputs can sink (suck up) and source (produce)
around a maximum of 20 mA on a pin
– http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-
Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-
328P_datasheet.pdf
• Do an internet search for "Standard Servo Motor Datasheet"
and find the maximum current it may need
• It doesn't seem like the Arduino would be
able to drive the servo motor.
How is it working?
– Remember the 3-pin interface: R = Power,
B = Ground, W = Signal
– The signal is separate from the power
– The power source is used to amplify the signal
14
Another Example
• Now consider a speaker system where the power and signal
are provide together
– Given our Arduino use 5V = Vcc and its current limitations per pin, how
much power can we supply to the speaker?
– 5V * 20 mA = 0.1W
– You need an amplifier…
TRI-STATE GATES
16
Tri-State Gates
Some
Logic
Tri-State Gates
In a Tri-State gate, we have a third option of not
having the output connected to anything.
Some
Logic
0
Tri-State Control
Tri-State Gates
When in the disconnected state, the output is said
to be in the “High impedance” or “High-Z” state.
Tri-State Gates
Tri-State gates give us the option of connecting
together the outputs of many devices without
requiring a circuit to multiplex many signals into one.
MUX
Input
Select Output
Enables
20
Tri-State Gates
When used in place of MUXs, the benefits of using
the Tri-State method becomes greater as size of data
increases from one to 8 to 32 bits, etc.
Tri-State Gates
Problem: How can you use the serial I/O lines of the
Arduino, which are also used for programming it?
Atmel RX
µC MAX232
TX
Tri-State Gates
Solution: Use a Tri-State gate to isolate the MAX232
received data from the µC until programming is over.
Pxx 74LS125
Atmel RX
µC MAX232
TX