CSE466 Syllabus
Download
Report
Transcript CSE466 Syllabus
Electronics and Physical Interfaces
Speaker Interface
Electronics Review
8051 I/O
CSE 370 - Fall 1999 - Introduction - 1
Speaker Interface
Add waveforms to get multiple tones (think current through speaker, not
voltage)
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
Note that lower frequency is smoother for a given sample rate
CSE 370 - Fall 1999 - Introduction - 2
Ideal Solution
Digital to Analog Converter
We can probably find
a chip for this
8
DAC
AMP
(V to I)
8051
Voltage signal
Speaker cares about current, not voltage
What is algorithm to superimpose 1KHz tone with 500Hz tone
With a sampling rate of 10KHz
CSE 370 - Fall 1999 - Introduction - 3
Synthesizer Algorithm
Let sin[] be a look up table with 256 entries (1 complete cycle)
Every .1ms (10KHz)
P2 = sin[t1] + sin[t2] + sin[t3] …
For 1KHz, t1 += 256/10 is this hard? how do we implement this?
For 500Hz, t2 += 256/20
At 8-bit resolution we can vary output from 0 to 255. Hi frequencies are smoother
255
128
0
Computer each sample through
Can Compute arbitrary waveforms (not just tone summations)
This is probably quite doable with our 8051, but we will take a simpler approach
(maybe some of you may take the last week to improve the acoustics)
CSE 370 - Fall 1999 - Introduction - 4
Using single bit tones
2.5
2
1.5
tone1
tone2
sum
1
0.5
31
28
25
22
19
16
13
10
7
4
1
0
• Two tones generated by single bit outputs.
• Use current summation externally.
• Note: high frequencies look more sinusoidal
CSE 370 - Fall 1999 - Introduction - 5
Our Version
Objective convert number of bits to current
5V
tone1
tone2 AMP
tone3 (B to I)
8051
CSE 370 - Fall 1999 - Introduction - 6
One Idea
5V
tone1
tone2
tone3
R=?
8ohms
Vs
8051
Constraints
5/(8+R)<10mA
5/(8+R/3) < 26mA
Does this sum? (I = Bx)
What must R be to protect the processor?
No quite. Vs decreases
What is the worst case (1, 2, or 3 bits)?
with increasing B. So
each Ir decreases with
How much power are we putting
increasing B
through the speaker in the worst case?
3 bits is worse (Higher R constraint)
(26mA)^2 * 8
= 5.4mA
CSE 370 - Fall 1999 - Introduction - 7
Another Idea
Use a current amplifier (PNP Transistor)
Ice = Ib (assume =10)
Assume Vbe = 0 (can be up to .7V)
Assume tone1 = 0V
Determine: Ib, Ice
Determine Power dissipated by speaker
Ib
5V
8ohms
e
Ib = 11*Is
b
tone1
c
Is = 5/8
Is = 625mA
Ib = 57mA
8051
Ic = 568mA
Violates speaker, 8051, Transistor constraints
Ps = (.625^2) * 8 = ~3W (overpowers .2W speaker)
CSE 370 - Fall 1999 - Introduction - 8
Ib
How do we fix this problem
How much current can we safely put through a .2W speaker?
Imax = (.2/8)^.5
= ~158mA
From data sheet for transistor, notice that Ice = 50mA if Ib = 5mA, and it
gives us values for Vce and Vbe for that case. Is this a good “on” operating
point for us? (Other operating points can be found on graphs,
experimentation)
Its perfect if we use one for each tone for a total of about 50mA
If we limit Ib then we limit Ice too. What size resistor should we put
between 8051 port and the BASE to “bias” the transistor properly. Heavy use
of KCL and Ohm’s law. See next page
CSE 370 - Fall 1999 - Introduction - 9
Final Circuit Design
Size R to match your speaker and to
5V
Stay within the current limitations of the
Ib = 5mA
Processor.
Ic = 50mA
From DataSheet Vbe = .65V (min)
(On Sat.)
Vr = (5 – (50mA*8) - .65)
R = Vr/5mA ~ 790ohms
tone1
tone2
tone3
R=?
8051
CSE 370 - Fall 1999 - Introduction - 10
8ohms
Resistor
Review of basic Electronics
Capacitors
Inductors
Bipolar Transistors
MOS transistors
Review of 8051 I/O configuration
CSE 370 - Fall 1999 - Introduction - 11