Professional Documents
Culture Documents
What is ADC ?
Types of ADCs
HC11 & ADC
Denis BISSIERES
Ian CAMPBELL
Yohan LESPERAT
Mechatronics - Fall 04
Contents
What is ADC ?
Types of ADCs
HC11 & ADC
What is ADC ?
Types of ADCs
HC11 & ADC
What is ADC ?
What is ADC ?
Types of ADCs
HC11 & ADC
Definition
Examples of use
Conversion process
Accuracy
Definition
What is ADC ?
Types of ADCs
x(t)
Definition
What is ADC ?
Types of ADCs
Analog
Digital
Digital System
Examples of use
Voltmeter
What is ADC ?
Types of ADCs
7.77 V
Voice
Conversion process
What is ADC ?
Types of ADCs
HC11 & ADC
3 steps:
Sampling
Quantification
Coding
These operations are all performed in a same
element: the A to D Converter
What is ADC ?
Types of ADCs
HC11 & ADC
xs(t)
xs(t=k*Ts)
Ts
What is ADC ?
Types of ADCs
HC11 & ADC
Vr
Ts
What is ADC ?
Types of ADCs
HC11 & ADC
xq(t)
N-1
N-2
Q
2
1
0
Ts
Vr
Accuracy
What is ADC ?
Types of ADCs
HC11 & ADC
Accuracy
xq(t)
Q
What is ADC ?
Types of ADCs
Ts
Higher Resolution
xq(t)
xq(t)
Q
Ts
Sampling rate
What is ADC ?
Types of ADCs
HC11 & ADC
Sampling rate
Analog signals are composed of an infinity of
harmonics
What is ADC ?
Types of ADCs
HC11 & ADC
Analog
Filter
Analog
In practice: fs (35)*ffilter
ADC
Digital
Example
8 bits converter: n=8
Range of conversion: Vr=5V
What is ADC ?
Types of ADCs
HC11 & ADC
255
0
Analog
0
Digital
Gain
Types of ADCs
What is ADC ?
Types of ADCs
HC11 & ADC
Flash ADC
Sigma-delta ADC
Dual slope converter
Successive approximation converter
Flash ADC
What is ADC ?
Types of ADCs
HC11 & ADC
parallel A/D
Uses a series of
comparators
Each comparator
compares Vin to a
different reference
voltage, starting
w/ Vref = 1/2 lsb
Flash ADC
Comparator is one use
of an Op-Amp
What is ADC ?
Types of ADCs
HC11 & ADC
VIN
VREF
+
-
VOUT
If
Output
Flash ADC
What is ADC ?
Types of ADCs
Advantages
Very fast
Disadvantages
Needs many parts
(255 comparators
for 8-bit ADC)
Lower resolution
Expensive
Large power
consumption
Sigma-Delta ADC
Integrator
Vin +
-
What is ADC ?
Types of ADCs
1-bit
+
-
Digital
Oversampler
low-pass
filter
Sample
decimator
Serial output
DAC
Sigma-Delta ADC
Advantages
Disadvantages
What is ADC ?
Types of ADCs
HC11 & ADC
High resolution
No precision
external
components
needed
Slow due to
oversampling
tFIX
tmeas
What is ADC ?
Types of ADCs
HC11 & ADC
Disadvantages
Input signal is
averaged
Greater noise
immunity than other
ADC types
High accuracy
Slow
High precision
external components
required to achieve
accuracy
What is ADC ?
Types of ADCs
HC11 & ADC
Successive Approximation
Is Vin > ADC range?
What is ADC ?
Types of ADCs
HC11 & ADC
VIN
SAR
1000 0000
0100
DAC
Out
Sets MSB
Converts MSB to
analog using DAC
Compares guess to
input
Set bit
Test next bit
Successive Approximation
Advantages
Disadvantages
What is ADC ?
Types of ADCs
HC11 & ADC
Capable of high
speed
Medium accuracy
compared to other
ADC types
Good tradeoff
between speed and
cost
Higher resolution
successive
approximation ADCs
will be slower
Speed limited
~5Msps
Flash
Types of ADCs
Successive Approx
Sigma-Delta
0
10
15
Resolution (Bits)
20
25
Type
Dual Slope
Slow
Med
Flash
Very Fast
High
Successive Appox
Medium Fast
Low
Sigma-Delta
Slow
Low
Option Register
Data conversion
Acquistion
AN0
PE1
What is ADC ?
AN1
PE2
Types of ADCs
VRH
SUCCESSIVE APPROXIMATION
REGISTER AND CONTROL
AN2
VRL
PE3
AN3
PE4
ANALOG
MUX
AN4
PE5
AN5
CCF
AN6
PE7
CA
CB
CC
CD
MULT
SCAN
PE6
INTERNAL
DATA BUS
AN7
ADR1
ADR2
ADR3
ADR4
P 64 M68HC11 Family Data Sheet
What is ADC ?
Types of ADCs
HC11 & ADC
8 channel/bit input
VRL = 0 volts
VRH = 5 volts
Digital input on P
Analog Multiplexer
A/D Converter
Result
Register
Interface
ADR2 - result 2
ADR3 - result 3
ADR4 - result 4
ADCTL Register
ADCTL ($1030)
Reset to:
CCF
SCAN MULT CD
u
CC CB
u
CA
u
ADCTL Register
ADR# Behavior
Single Channel
(MULT = 0)
Multiple
Channel
(MULT = 1)
Single
Conversion
(SCAN = 0)
One channel
converted 4 times
consecutively. The
results are stored in
ADR1-ADR4
4 channels
converted once.
The results are
stored in ADR1ADR4
Continuous
Conversion
(SCAN = 1)
One channel is
continuously
converted. ADR1ADR4 overwritten
4 channels are
continuously
converted. ADR1ADR4 overwritten
What is ADC ?
Types of ADCs
HC11 & ADC
Single Channel
7
What is ADC ?
Types of ADCs
PORT E
ADR1 Result1
A/D Converter
Result
Register
Interface
ADR2 Result2
ADR3 Result3
ADR4 Result4
Multiple Channels
7
What is ADC ?
Types of ADCs
PORT E
ADR1 Result1
A/D Converter
Result
Register
Interface
ADR2 Result2
ADR3 Result3
ADR4 Result4
ADCTL Register
Conversion Sequence
E Clock cycles:
What is ADC ?
Types of ADCs
HC11 & ADC
Sample (12)
ADCTL
write (1)
Successive approximation
1st, ADR1
0
2nd, ADR2
32
3rd, ADR3
64
4th, ADR4
96
CCF
128 total
ADCTL Register
A/D Result Registers (ADR1 ADR4):
What is ADC ?
Types of ADCs
HC11 & ADC
ADR1 = $1031
ADR2 = $1032
ADR3 = $1033
ADR4 = $1034
ADCTL Register
A/D Channel Assignment
What is ADC ?
Types of ADCs
HC11 & ADC
CD
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
CC
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
CB
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
CA
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
Channel Signal
If Mult =1, ADR
PE0
ADR1
PE1
ADR2
PE2
ADR3
PE3
ADR4
PE4
ADR1
PE5
ADR2
PE6
ADR3
PE7
ADR4
Reserved
ADR1
Reserved
ADR2
Reserved
ADR3
Reserved
ADR4
VH
ADR1
VL
ADR2
1/2 VH
ADR3
Reserved
ADR4
P447 Reference Manual
ADCTL Register
ADR# Behavior
What is ADC ?
Types of ADCs
Single Channel
(MULT = 0)
CC
Multiple Channel
(MULT = A)
Option Register
Options Register ($1039)
ADPU
What is ADC ?
Types of ADCs
Bit:
CSEL
IRQE
DLY
CME
CR1
CR0
Option Register
ADPU - A/D Charge Pump
What is ADC ?
Types of ADCs
HC11 & ADC
DLY Delay
0 = No delay is used and MCU resumes within approx. 4 cycles.
1 = 4000 E clock cycle delay imposed to allow crystal stabilization
Data conversion
What is ADC ?
Bit 7
Bit 0
% (1)
50%
25%
12.5%
6.25%
3.12%
1.56%
0.78%
0.39%
Volts
(2)
2.500
1.250
0.625
0.3125
0.1562
0.0781
0.0391
0.0195
Volts
(3)
1.65
0.825*
0.4125
0.2063
0.1031
0.0516
0.0258
0.0129
2 1
2 2
2 3
2 4
Types of ADCs
HC11 & ADC
2 5
2 6 2 7
2 8
Data conversion
What is ADC ?
Types of ADCs
HC11 & ADC
MAX :
.1111 1111 = .FF16 = 0.9960937510 = 99.6093 %
Resolution :
.0000 0001 = .0116 = 0.0039062510 = 0.3906 %
MIN :
.0000 0000 = 016 = 010=0 %
Data conversion
What is ADC ?
Types of ADCs
HC11 & ADC
Acquisition
OPTION ($1039) ADPU CSEL IREQ DLY CME
ADCTL ($1030)
What is ADC ?
OPTION
ADCTL
ADR1
ORG
Types of ADCs
HC11 & ADC
LOOP
WAIT
CCF
SCAN MULT CD
CR1 CR2
CC CB
CA
EQU $1039
EQU $1030
EQU $1031
$1040
ADPU=1,CSEL=0
LDAA #$80
STAA OPTION
LDY #$411A
NOP
Delay for charge pump to stabilize 100s
NOP
NOP
DEY
BNE
LOOP
LDAA #$00
SCAN=0,MULT=0,CHAN GRP=00
STAA ADCTL
Wait until CCF or bit 7=1
LDX #ADCTL
BRCLR 0,X #$80 WAIT
LDAA ADR1
Read and store result
PSHA
JSR
$4000
SWI
END
Acquisition
Subroutine output to the screen the decimal equivalence of the stack :
What is ADC ?
Types of ADCs
HC11 & ADC
ORG
PULY
PULB
CLRA
LDX
IDIV
STAB
XGDX
LDX
IDIV
STAB
XGDX
TBA
$4000
#$000A
$0000
#$000A
$0001
First Integer
Division
Store remainder of
the first division
Second Integer
Division
JSR
LDAA
JSR
LDAA
JSR
PSHY
RTS
$FFB5
$0001
$FFB5
$0000
$FFB5
Subroutines
Outrhlf, convert to
ASCII Number and
output to screen
first the hundreds
number, the tens
and then units
number
(NOTE: Remember that ACCA is the high byte of ACCD and ACCB is the low byte of
ACCD. Return address used for JSR and RTS is stored in INDEX Y in the subroutine)
A number between 000 and 255 will be print on the screen. If it is 255 -> 100 %
000 -> 0 %
What is ADC ?
Types of ADCs
HC11 & ADC
Questions ?