15
Microprocessors Data Converters Analog to Digital Converters (ADC) Convert an analog quantity (voltage, current) into a digital code Digital to Analog Converters (DAC) Convert a digital code into an analog quantity (voltage, current) Dr. Konstantinos Tatas and Dr. Costas Kyriacou

Microprocessors

Embed Size (px)

DESCRIPTION

Microprocessors. Data Converters Analog to Digital Converters (ADC) Convert an analog quantity (voltage, current) into a digital code Digital to Analog Converters (DAC) Convert a digital code into an analog quantity (voltage, current) Dr. Konstantinos Tatas and Dr. Costas Kyriacou. - PowerPoint PPT Presentation

Citation preview

Page 1: Microprocessors

Microprocessors

Data Converters

• Analog to Digital Converters (ADC)– Convert an analog quantity (voltage, current) into

a digital code

• Digital to Analog Converters (DAC)– Convert a digital code into an analog quantity

(voltage, current)

Dr. Konstantinos Tatas and Dr. Costas Kyriacou

Page 2: Microprocessors

ACOE255 Microprocessors I - Frederick University 2

Video (Analog - Digital)

A/D

AmplifierFilters

Modulator

Image enhancement

and coding

Analog

Digital

Pre-amplifier

Page 3: Microprocessors

ACOE255 Microprocessors I - Frederick University 3

Temperature Recording by a Digital System

Sampling & quantization

Coding

Temperature(ºC)

Time

Temperature(ºC)

Time

Page 4: Microprocessors

ACOE255 Microprocessors I - Frederick University 4

Need for Data Converters

Digital processing and storage of physical quantities (sound, temperature, pressure

etc) exploits the advantages of digital electronics

– Better and cheaper technology compared to the analog

– More reliable in terms of storage, transfer and processing

• Not affected by noise

– Processing using programs (software)

• Easy to change or upgrade the system

– (e.g. Media Player 7 Media Player 8 ή Real Player)

• Integration of different functions

– (π.χ. Mobile = phone + watch + camera + games + email +

Page 5: Microprocessors

ACOE255 Microprocessors I - Frederick University 5

Signals (Analog - Digital)

2

4

6

8

10

12

14

16

u(V)

1 2 73 4 5 6 8 9 t (S)

D3

D2

D1

D0

0

0

0

1

0

0

1

1

0

0

1

1 0

0

1

1 0

1

1

1

0

0

1

1 1

1

1

1

0

0

1

1

0

1

0

0

Analog Signal • can take infinity values • can change at any time

0100

1001

0110

0101

1010

11101111

1100

1000

Digital Signal • can take one of 2

values (0 or 1)• can change only

at distinct times

ADC

2

4

6

8

10

12

14

16

u(V)

1 2 73 4 5 6 8 9 t (S)

DAC

Reconstruction of an analog signal from a digital one

(Can take only predefined values)

1001

01100101

1010

11111110

1000

1100

0100

Page 6: Microprocessors

ACOE255 Microprocessors I - Frederick University 6

QUANTIZATION ERROR• The difference between the true and quantized value of the analog signal• Inevitable occurrence due to the finite resolution of the ADC • The magnitude of the quantization error at each sampling instant is

between zero and half of one LSB.• Quantization error is modeled as noise (quantization noise)

2

4

6

8

10

12

14

16

u(V)

1 2 73 4 5 6 8 9 t (S)

2

4

6

8

10

12

14

16

u(V)

1 2 73 4 5 6 8 9 t (S)

Analog signal value at sampling time: 4.9 V

Quantized Analog signal value: 5.0 V

Quantization error: 5.0 - 4.9 = 0.1 V

Page 7: Microprocessors

ACOE255 Microprocessors I - Frederick University 7

SAMPLING FREQUENCY (RATE)• The frequency at which digital values are sampled from the analog input of an

ADC• A low sampling rate (undersampling) may be insufficient to represent the analog

signal in digital form• A high sampling rate (oversampling) requires high bitrate and therefore storage

space and processing time• A signal can be reproduced from digital samples if the sampling rate is higher

than twice the highest frequency component of the signal (Nyquist-Shannon theorem)

• Examples of sampling rates – Telephone: 4 KHz (only adequate for speech, ess sounds like eff)

– Audio CD: 44.1 KHz

– Recording studio: 88.2 KHz

Page 8: Microprocessors

ACOE255 Microprocessors I - Frederick University 8

Digital to Analog Converters

• The analog signal at the output of a D/A converter is linearly proportional to the binary code at the input of the converter.

– If the binary code at the input is 0001 and the output voltage is 5mV, then

– If the binary code at the input becomes 1001, the output voltage will become ......

• If a D/A converter has N digital inputs then the analog signal at the output can have one out of ……. values.

• If a D/A converter has 4 digital inputs then the analog signal at the output can have one out of …… values.

45mV

16

D3 D2 D1 D0Vout(mV)

0 0 0 0 0

0 0 0 1 5

0 0 1 0 10

0 0 1 1 15

0 1 0 0 20

0 1 0 1 25

0 1 1 0 30

0 1 1 1 35

1 0 0 0 40

1 0 0 1 45

1 0 1 0 50

1 0 1 1 55

1 1 0 0 60

1 1 0 1 65

1 1 1 0 70

1 1 1 1 75

Page 9: Microprocessors

ACOE255 Microprocessors I - Frederick University 9

Characteristics of Data Converters

1. Number of digital lines– The number bits at the input of a D/A (or output of an A/D) converter.

– Typical values: 8-bit, 10-bit, 12-bit and 16-bit

– Can be parallel or serial

2. Microprocessor Compatibility– Microprocessor compatible converters can be connected directly on the

microprocessor bus as standard I/O devices

– They must have signals like CS, RD, and WR

• Activating the WR signal on an A/D converter starts the conversion process.

3. Polarity– Polar: the analog signals can have only positive values

– Bipolar: the analog signals can have either a positive or a negative value

4. Full-scale output– The maximum analog signal (voltage or current)

– Corresponds to a binary code with all bits set to 1 (for polar converters)

– Set externally by adjusting a variable resistor that sets the Reference Voltage (or current)

Page 10: Microprocessors

ACOE255 Microprocessors I - Frederick University 10

Characteristics of Data Converters (Cont…)

5. Resolution– The analog voltage (or current) that corresponds to a change of 1LSB in the binary

code

– It is affected by the number of bits of the converter and the Full Scale voltage (VFS)

– For example if the full-scale voltage of an 8-bit D/A converter is 2.55V the the resolution is:

VFS/(2N-1) = 2.55 /(28-1) 2.55/255 = 0.01 V/LSB = 10mV/LSB

6. Conversion Time– The time from the moment that a “Start of Conversion” signal is applied to an A/D

converter until the corresponding digital value appears on the data lines of the converter.

– For some types of A/D converters this time is predefined, while for others this time can vary according to the value of the analog signal.

0.1Vo

Vo

7. Settling Time – The time needed by the analog signal at the

output of a D/A converter to be within 10% of the nominal value.

Page 11: Microprocessors

ACOE255 Microprocessors I - Frederick University 11

ADC RESPONSE TYPES• Linear

– Most common

• Non-linear– Used in telecommunications, since human voice carries more energy in the low

frequencies than the high.

Page 12: Microprocessors

ACOE255 Microprocessors I - Frederick University 12

ADC TYPES• Direct Conversion

– Fast

– Low resolution

• Successive approximation– Low-cost

– Slow

– Not constant conversion delay

• Sigma-delta– High resolution, low-cost, high accuracy

Page 13: Microprocessors

ACOE255 Microprocessors I - Frederick University 13

Interfacing with Data Converters • Microprocessor compatible data converters are attached on the microprocessor’s

bus as standard I/O devices.

DAC

CS

Vout

D7

WR

D6

D5

D4

D3

D2

D1

D0 Vref

V(+)

V(-)

8088

Sys

tem

D7

D6

D5

D4

D3

D2

D1

D0

A19

A0

WR

IO/M'

RD

A11

A10

A9

A8

A7

A6

A5

A4

Vout

10K

10K

+5V

Page 14: Microprocessors

ACOE255 Microprocessors I - Frederick University 14

Programming Example 1

Write a program to generate a positive ramp at the output of an 8-bit D/A converter with a 2V amplitude and a 1KHz frequency. Assume that the full scale voltage of the D/A converter is 2.55V. The D/A converter occupies the O/P address 0x6a0.

2V

0V

f = 1KHZ

main(){

do {

for (i=0;i<200;i++)

{

Out32(0x6a0,i);

delayu(5);

}} while (!_kbhit());}

200 stepsof 10 mV each==> 2V amplitude

200 steps of 5 us each==> 1ms period or 1KHz frequency

Page 15: Microprocessors

ACOE255 Microprocessors I - Frederick University 15

D/A Converters example

0

4

3

2

1

V (volts)

t (msec )1 5 6 7 8

Write a program to generate the waveform, shown below, at the output of an 8-bit digital to analog converter. The period of the waveform should be approximately 8 ms. Assume that a time delay function with a 1 μs resolution is available. The full scale output of the converter is 5.12 V and the address of the DAC is 63H.

Co

Co

Co

Assuming that an 8-bit A/D converter is used to interface a temperature sensor measuring temperature values in the temperature range 0 - 51.2

, specify: The resolution in of the system in The digital output word for a temperature of 32.5 The temperature corresponding to a digital output word of 01001110