Top Banner
Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad El-Banna SPRING 2015 E-626-A Real-Time Embedded Systems (RTES) Integrated Technical Education Cluster At AlAmeeria © Ahmad El-Banna
15

E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

Aug 10, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 2: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

Agenda

Digital, Analog signals & Acquisition

ADC

DAC 2

RTES

, Lec

#8 , S

prin

g 201

5 ©

Ahm

ad E

l-Ban

na

Page 3: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 4: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

Some properties of analog and digital quantities

4

RTES

, Lec

#8 , S

prin

g 201

5 ©

Ahm

ad E

l-Ban

na

Page 5: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 6: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 7: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

Typical timing requirement of one analog-to-digital conversion

7

RTES

, Lec

#8 , S

prin

g 201

5 ©

Ahm

ad E

l-Ban

na

Page 8: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

The PIC 16F87XA ADC module

8

RTES

, Lec

#8 , S

prin

g 201

5 ©

Ahm

ad E

l-Ban

na

Page 9: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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 )

Page 10: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

The ADCON1 register (address 9F H )

10

RTES

, Lec

#8 , S

prin

g 201

5 ©

Ahm

ad E

l-Ban

na

Page 11: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 12: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 13: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

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

Page 14: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

Sample Project

• Design and implement a digital voltmeter.

14

© A

hmad

El-B

anna

RT

ES, L

ec#8

, Spr

ing 2

015

Page 15: E-626-A Real-Time Embedded Systems (RTES) …bu.edu.eg/portal/uploads/Engineering, Shoubra/Electrical...Lecture #8 Data acquisition and manipulation ADC & DAC Instructor: Dr. Ahmad

• 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:

[email protected]

15

© A

hmad

El-B

anna

RT

ES, L

ec#7

, Spr

ing 2

015