Analog-to-Digital Converter and Multivibrators

Download Report

Transcript Analog-to-Digital Converter and Multivibrators

Analog-to-Digital Converter
and Multi-vibrators
PHY 202 (Blum)
1
Simple Digital to Analog Converter
V1
5V
.111
corresponds to
7/8
J1
Key = A
J2
Key = B
7/8 of 5 is 4.375
J3
Key = C
R1
1.0k
R2
2.0k
R4
4.02k
R3
4.02k
+
-
PHY 202 (Blum)
4.377
V
U1
DC 10M
2
Simple Digital to Analog Converter
V1
5V
.100
corresponds to
1/2
J1
Key = A
J2
Key = B
1/2 of 5 is 2.5
J3
Key = C
R1
1.0k
R2
2.0k
R4
4.02k
R3
4.02k
+
-
PHY 202 (Blum)
2.503
V
U1
DC 10M
3
Analog-to-Digital
• We have seen a simple digital-to-analog converter,
now we consider the reverse process
• For this purpose we introduce a new circuit
element — the comparator
• We have seen last semester a digital comparator, a
logic circuit that determined whether the input
word A is larger than the input word B
• Now we look at an analog comparator, it
determines whether voltage A is larger than
voltage B
PHY 202 (Blum)
4
PHY 202 (Blum)
5
Comparator (analog)
U1
V1
3.1 V
COMPARATOR_VIRTUAL
V2
3V
R1
1.0k
+
-
4.651
V
U2
DC 10M
+ Input higher than – input, output is high
PHY 202 (Blum)
6
Comparator (analog)
U1
V1
2.9 V
COMPARATOR_VIRTUAL
V2
3V
R1
1.0k
+
-
0.000
V
U2
DC 10M
+ Input lower than – input, output is low
PHY 202 (Blum)
7
1-bit analog-digital converter
R1
1.0k
V2
2.4 V
V1
5V
U1
COMPARATOR_VIRTUAL
R2
1.0k
Reference Voltage
PHY 202 (Blum)
Input voltage
X1
2.5 V
Input voltage is
less than half of
reference
voltage, result is
low.
8
1-bit analog-digital converter
R1
1.0k
V2
2.6 V
V1
5V
U1
COMPARATOR_VIRTUAL
R2
1.0k
Reference Voltage
PHY 202 (Blum)
Input voltage
X1
2.5 V
Input voltage is
more than half
of reference
voltage, result is
high.
9
Toward a 2-bit analog-digital converter
R1
1.0k
V2
4V
V1
5V
R2
1.0k
U1
X1
2.5 V
Greater than 3/4
COMPARATOR_VIRTUAL
U2
X2
2.5 V
Greater than 1/2
R4
1.0k
COMPARATOR_VIRTUAL
U3
X3
2.5 V
Greater than 1/4
R5
1.0k
PHY 202 (Blum)
COMPARATOR_VIRTUAL
10
Toward a 2-bit analog-digital converter
R1
1.0k
V2
2.6 V
V1
5V
R2
1.0k
U1
X1
2.5 V
Greater than 3/4
COMPARATOR_VIRTUAL
U2
X2
2.5 V
Greater than 1/2
R4
1.0k
COMPARATOR_VIRTUAL
U3
X3
2.5 V
Greater than 1/4
R5
1.0k
PHY 202 (Blum)
COMPARATOR_VIRTUAL
11
Toward a 2-bit analog-digital converter
R1
1.0k
V2
2.2 V
V1
5V
R2
1.0k
U1
X1
2.5 V
Greater than 3/4
COMPARATOR_VIRTUAL
U2
X2
2.5 V
Greater than 1/2
R4
1.0k
COMPARATOR_VIRTUAL
U3
X3
2.5 V
Greater than 1/4
R5
1.0k
PHY 202 (Blum)
COMPARATOR_VIRTUAL
12
Toward a 2-bit analog-digital converter
R1
1.0k
V2
1.1 V
V1
5V
R2
1.0k
U1
X1
2.5 V
Greater than 3/4
COMPARATOR_VIRTUAL
U2
X2
2.5 V
Greater than 1/2
R4
1.0k
COMPARATOR_VIRTUAL
U3
X3
2.5 V
Greater than 1/4
R5
1.0k
PHY 202 (Blum)
COMPARATOR_VIRTUAL
13
Finish this truth table
>3/4
Comparator
>1/2
Comparator
>1/4
Comparator
0
0
0
0
0
1
0
1
0
0
1
1
1
0
0
1
0
1
1
1
0
1
1
1
½’s place
¼’s place
Doesn’t occur
PHY 202 (Blum)
14
Integrated circuit version
PHY 202 (Blum)
Warning: may need to
flip switch back and
forth.
15
3.7 / 5 (in Scientific Mode)
PHY 202 (Blum)
16
*
PHY 202 (Blum)
2
x^y
8
=
17
Binary Mode
PHY 202 (Blum)
18
Compare
PHY 202 (Blum)
19
Scientific Mode
PHY 202 (Blum)
20
Multi-vibrators
http://www.ee.ed.ac.uk/~kap/Hard/555/node1.html
PHY 202 (Blum)
21
Multi-vibrator
• A multi-vibrator is an electronic circuit that
can exist in a number of “states” (voltage
and/or current outputs).
• A flip-flop is a bi-stable multi-vibrator,
bi-stable means it has two stable states.
• A state is stable if it is robust against the
fluctuations (noise) that are always
occurring.
PHY 202 (Blum)
22
Mono-stable multi-vibrator
• A mono-stable multi-vibrator has one stable
output (usually zero).
• It also has an unstable state. Certain input will
put the circuit into its unstable state, which lasts
for a set length of time before returning to the
stable state.
– Unstable states are still robust to noise but do not last
indefinitely long.
• In wave terminology, this provides one with a
single pulse.
PHY 202 (Blum)
23
Pulse
STABLE
PHY 202 (Blum)
UNSTABLE
STABLE
24
One shots
• One purpose of a mono-stable multi-vibrator is to
output a signal of a specified duration.
• The input (trigger) may be short (or unknown) in
duration, but the output pulse has a predictable
duration (can be controlled by the time constant
of an RC circuit).
–  = RC
– The time constant and duration are not equal but
are proportional.
• Such a circuit is called a “one shot.”
PHY 202 (Blum)
25
Shapers
• Another purpose of mono-stable multivibrators is to “shape” input signals.
• Recall in digital circuits we want signals to
be clearly high or low; a mono-stable multivibrator can take signals which are not of
this form and create signals which are.
PHY 202 (Blum)
26
Schmitt trigger
PHY 202 (Blum)
27
Schmitt trigger
• If the voltage is above a certain value (the
upper trip point) and rising, the output is
high.
• If the voltage is below another value (the
lower trip point) and falling, the output is
low.
• Otherwise, it remains whatever it was.
PHY 202 (Blum)
28
Schmitt trigger
The upper trip point
Above the upper
trip and going up
The lower trip point
PHY 202 (Blum)
Below the lower trip
and going down
29
A-stable multi-vibrator
• In an a-stable multi-vibrator, there are
typically two states, neither of which is
stable.
• The circuit repeatedly flips back and forth
between the states.
PHY 202 (Blum)
30
A-stable multi-vibrator
J1
Key = Space
R3
1.0k
R2
10.0k
XSC1
R1
1.0k
R4
10.0k
G
T
C1
A
B
C2
V1
5V
2.0uF
Q2
BJT_NPN_VIRTUAL
PHY 202 (Blum)
2.0uF
Q1
BJT_NPN_VIRTUAL
31
A-stable Multi-vibrator
• Assume a state where the transistor on left
is ON and transistor on right is OFF and
the capacitor on the left has no charge.
• Since the left transistor is on (hard) it is not
dropping much voltage, therefore “all” the
voltage is being dropped by the resistors
• The capacitor on the left begins to charge
through the 10K resistor on the right
PHY 202 (Blum)
32
A-stable Multi-vibrator
PHY 202 (Blum)
33
A-stable Multi-vibrator
Oscilloscope
PHY 202 (Blum)
34
A-stable
high
low
ON
OFF
Charge building up
PHY 202 (Blum)
35
A-stable
• Charge builds up on the left capacitor, “pullingup” the voltage presented to the base of the
transistor on the right.
• When the base reaches about 0.7v the transistor
on the right turns on.
• Current now starts to flow through the 1K resistor
on the far right, thus dropping the voltage level at
the collector.
• That low voltage makes its way to the base of the
transistor on the left turning it off.
• The cycle repeats itself.
PHY 202 (Blum)
36
A-stable
low
Turns
off
PHY 202 (Blum)
ON
37
Duty cycle
• In a square wave (e.g. a computer’s clock),
the wave is characterized by its frequency,
its amplitude and its duty cycle.
• The duty cycle is the percent of time that
the signal is high.
• Duty cycle = thigh/(thigh+tlow)*100%
PHY 202 (Blum)
38
Duty cycle example: thigh = 1.407 ms
PHY 202 (Blum)
39
Duty cycle example: thigh + tlow = 2.111 ms
Duty cycle = (1.407/2.111) = 66.65%
PHY 202 (Blum)
40
555 Timer
• A similar circuit uses the 555 chip
(Integrated circuit)
• The resistors and capacitors are external to
the chip so that the period and duty cycle of
the circuit can be controlled.
PHY 202 (Blum)
41
555
PHY 202 (Blum)
42
555 as Monostable multivibrator
PHY 202 (Blum)
43
555 as Astable Multivibrator
PHY 202 (Blum)
44
555 Timer (WorkBench version)
XSC1
R1
1.0k
G
T
A
8
U1
VCC
V1
5V
C2
10nF
PHY 202 (Blum)
4
RST
7
DIS
6
THR
2
TRI
5
CON
OUT
3
B
R2
1.0k
C1
1.0uF
GND
1
LM555CM
45
Crystals
• The very high frequency square wave used
for the CPU clocks are not generated in the
manner described on the previous slides.
• The high frequency signal is supplied by
crystals subjected to an electric field.
PHY 202 (Blum)
46
References
• http://www.ee.ed.ac.uk/~kap/Hard/555/node
2.html#modes
• http://en.wikipedia.org/wiki/555_timer_IC
• http://www.kpsec.freeuk.com/555timer.htm
PHY 202 (Blum)
47