e-626-a real-time embedded systems (rtes) …bu.edu.eg/portal/uploads/engineering,...
TRANSCRIPT
Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad El-Banna
SPR
IN
G 2
015
E-626-A Real-Time Embedded Systems (RTES)
Integrated Technical Education Cluster At AlAmeeria
© A
hmad
El-B
anna
Agenda
Digital, Analog signals & Acquisition
ADC
DAC 2
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
Analog and digital quantities
• Most transducers produce output signals that are an analog of the quantity they represent.
• For example: Temperature sensors & microphones.
• Analog signals are fine things, but they suffer from a number of big disadvantages.
• Digital signals, on the other hand, perform better on most counts and with today’s technology are easier to work with.
3
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
Some properties of analog and digital quantities
4
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
The data acquisition system
5
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
• Elements of a (four-channel) data acquisition system
ADC ch/s
6
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
• The ideal analog-to-digital converter input/output characteristic
• Sample & Hold Circuit
Typical timing requirement of one analog-to-digital conversion
7
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
The PIC 16F87XA ADC module
8
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
Controlling the ADC
9
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
• The ADC is controlled by two SFRs, ADCON0 and ADCON1). • The result of the conversion is placed in two further SFRs,
ADRESH and ADRESL.
The ADCON0 register (address 1F H )
The ADCON1 register (address 9F H )
10
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
Formatting the analog-to-digital converter conversion result
11
RTES
, Lec
#8 , S
prin
g 201
5 ©
Ahm
ad E
l-Ban
na
• Calculating acquisition time
DAC
• The reverse function of ADC.
• Needs external interface circuit.
• Convert digital values into continuous analogue signal
• Decoding digital value to an analogue value at discrete moments in time based on value within register
Where E0 is output voltage; Eref is reference voltage; Bn is status of successive bits in the binary register
12
© A
hmad
El-B
anna
n
n
ref BBBEE1
210 225.05.0
RTES
, Lec
#8 , S
prin
g 201
5
Examples of DAC Circuits
13
© A
hmad
El-B
anna
• Scaling Adder as a four-digit DAC
• An R/2R ladder DAC
I0=+V/8R I1=+V/4R I2=+V/2R I3=+V/R
Vout(D0)=-Rf I0
Vout(D1)=-Rf I1
Vout(D2)=-Rf I2
Vout(D3)=-Rf I3
RTES
, Lec
#8 , S
prin
g 201
5
Sample Project
• Design and implement a digital voltmeter.
14
© A
hmad
El-B
anna
RT
ES, L
ec#8
, Spr
ing 2
015
• For more details, refer to:
• Chapter 11, T. Wilmishurst, Designing Embedded Systems with PIC Microcontrollers, 2010.
• The lecture is available online at:
• http://bu.edu.eg/staff/ahmad.elbanna-courses/12134
• For inquires, send to:
15
© A
hmad
El-B
anna
RT
ES, L
ec#7
, Spr
ing 2
015