Transcript Lecture5
Review and Lab Prep
hotmail account on mailing list doesn’t work
CSE466 Autumn ‘00- 1
Memory Architecture Review
Show the
indirect direct
memory after
execution from
reset
27H
MOV A,@R1;
(sfr)
xFF
A5H xFE
Acc
MOV R1,A;
MOV A,#FEH;
MOV 64H,A;
20H
0
MOV A, FEH;
JMP 20H;
CSE466 Autumn ‘00- 2
x80
Basic RC review
Vo = Vi(1-e (-t/RC) ) so Vo/Vi = 4/5=.8 = (1-e (-t/RC) )
t = -RCln(1 - .8) = 49mSec
+
-
3.2u
RST
8051
10K
what is the voltage across the
cap after button release?
Tr
CSE466 Autumn ‘00- 3
~4V
Careful w/ Coils (motors, valves, etc)
Steady state on current: Vcc/R
5V
Vds ~ 0 (Rds ~ 4mOhm)
But, when we try to turn off the
Current limiter
Mosfet quickly, what happens?
R = 50Ohms
•Rds goes up quickly, but Ids drops slowly)
I =0 .1A
•If Rds becomes 1K, then Vds becomes 100V
•And instantaneous power becomes 10W
Coil (L)
8051
Vds
CSE466 Autumn ‘00- 4
MOSFET
Switch
could be
any power
device
Saturation Mode Amp
Use a current amplifier (PNP Transistor)
Ice <= Ib (assume =100)
Assume Vbe = 0.7V when “on”
Assume Vce = 1V when “on”
Assume tone1 = 0V
Pick Rc to protect the speaker
Pick Rb to protect the processor
while turning on the transistor
5V
8ohms
Ib
tone1
Rb
Is = ((.2/8)^.5)/3 = ~50mA
8051
Rc: 5 – (50mA*8) – Vce – (50mA * Rc) = 0
so: Rc = (5 – 1 – 0.4)/.05 = 72ohms
Rb: Vb/1mA = [5 – (8*.05) - .7]/1mA = 3.9K!
CSE466 Autumn ‘00- 5
e
b
c
<Ib
Rc
Last Year’s Model
5V
8ohms
tone1
tone2
tone3
Rb
8051
Rc
CSE466 Autumn ‘00- 6
This Year’s Model
Digital to Analog Converter
Computer
Speaker
SW?
8
DAC
AMP
(V to I)
8051
Voltage signal
Speaker cares about current, not voltage
How can we generate two simultaneous tones of 500Hz and 1KHz
using only 1 timer interrupt?
CSE466 Autumn ‘00- 7
Sine Wave Program (in psuedo-C)
const unsigned byte sine[256] = {
rom
};
interrupt routine (25.6KHz):
P0 = sine[i];
i++;
return
How do I get two tones with one interrupt (constant sample rate) ?
CSE466 Autumn ‘00- 8
Digital to Analog Converter
each bit pumps more
current into Rfb
in different amounts
depending on position
5V
20K
out1
Effective network is
DB[7:0] = 10000000
out =
DB[7:0] = 10000001
out =
10K
MSB
CSE466 Autumn ‘00- 9
Digital-to-Analog Converter
Vref
out1
\write
8051
port0 data
CS
Rfb
input
AMP
DAC
gnd
CSE466 Autumn ‘00- 10
Sampling
Add sampled sine waves to get multiple tones
4
3.5
3
2.5
tone1
2
tone2
1.5
tone3
1
0.5
31
28
25
22
19
16
13
10
7
4
1
0
two frequencies with same rate. How fast can you go?
CSE466 Autumn ‘00- 11