interfacing peripheral ics and their chapter 7 adc04 one channel adc with voltage reference = 1/2 of...

37
Chapter 7 Peripheral ICs and their Interfacing

Upload: phungdang

Post on 08-Mar-2018

224 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Chapter 7

Peripheral ICs and their Interfacing

Page 2: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Lesson 5

ADC - Analog to Digital Converter

Page 3: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Outline

• Analog to Digital Converter• ADC0804• ADC0808• ADC 0816• ADC Circuit with 8051 and

Programming

Page 4: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Analog to Digital Conversion (ADC)�Analog input needs to be converted

into bits in many applications

�Digital output bits proportional to ADC analog input

�A reference input (Vref+) defines the maximum input (when output bits= all 1s) and Vref- the minimum input (when output bits= all 0s).

Page 5: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC output� n-bit ADC (output) =

Analog input ∗ {(2n)- 1}

(Vref+ - Vref-)

Page 6: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

8-bit ADC example� Therefore, 8-bit ADC functions as

follows. Let (Vref+) = 1.275 V and (Vref-) = 0 V.

�Output bits = all 0s = 00000000 (=0d) when input = 0V,

�Output bits = 10000000 (= 128d) when input = 0.64V and

�Output bits = 11111111 (= 255d) when input = 1.275V

Page 7: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC Built in at MCU Examples

• 80535 ADC with programmable voltage reference

• 80552 10-bit ADC with 8-ch AMUX (Analog multiplexer- same ADC with multiple analog input channels

Page 8: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC Chips for interfacing processors buses and MCUs ports

• ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input

• ADC0808 eight channels ADC with voltage reference + and -inputs

• ADC0816 sixteen channels

Page 9: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Considerations when using an ADC

• Number of bits, reference (single or dual programmable or non programmable), multi or single channel,conversion accuracy,separate analog ground

• Location nearest possible to a signal transducer

• Sampling rate and data throughput rate• CMOS or Bipolar based

Page 10: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Outline

• Analog to Digital Converter• ADC0804• ADC0808• ADC 0816• ADC Circuit with 8051 and

Programming

Page 11: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• 8 bit ADC• Interfaces with micro-controller

ports or processor data buses (D0-D7), RD and WR and INTR

• Vref/2 input for 1000 000 output when analog input = Vref/2

• WR input for start of conversion (SOC)

ADC0804

Page 12: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• SOC input can be a sharp - pulse using a NOT - NAND combination

• RD input for converted bits output enable on D0-D7

• EOC output for end of conversion to facilitate Interrupt (INTR) driven IOs

ADC0804

Page 13: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• Separate analog and digital grounds to isolate digital transitions noise by direct connection of AN-GND to supply GND

• Clock frequency adjustable by external RC pair timing constant

ADC0804

Page 14: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC 0804

VCCEOC

CS

Vin-

S/H

Digital GNDRD

B0-B7IOWR

Vref/2

AN-GND

CLKINCLKR

Vin+

INTRP3.7

SOC

Dec

oder

or

port

bit

RC pair

P3.6 or IORD

IC

AN+ input

Vin+

out enable

ADC One Channel

Page 15: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Outline

• Analog to Digital Converter• ADC0804• ADC0808• ADC 0816• ADC Circuit with 8051 and

Programming

Page 16: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• 8 bit ADC• Interfaces micro-controller ports

or processor data buses (D0-D7), RD, WR, ALE (built in latch) for channel select through AD2-AD1-AD0 inputs,

• WR input for start of conversion (SOC)

ADC0808

Page 17: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• SOC input can be a sharp - pulse using a NOT - NAND combination

• RD input (output enable) for converted bits on D0-D7

• EOC output for end of conversion to facilitate interrupt (INTR) driven IOs

ADC0808

Page 18: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• Separate analog and digital grounds to separate digital transitions noise by direct connection of AN-GND to supply GND

• Clock frequency input

ADC0808

Page 19: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC 0808

VCCEOC

CS

Vref-

Digital GNDRD

B0-B7IOWR

Vref+

AN-GND

CLKINCLKR

Vin+Ch0-7

INTRP3.7

SOC

Dec

oder

or

port

bit

RC pair

P3.6 or IORD

IC

ALE

out enable

ADC 8- ChannelsP3.7

Page 20: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

B0-B7 connects to data AD0-D7

out enable

IORD

CS

RD S/H

Ch0AN+ input

ch0 Vin+

Interfacing ADC0808

Page 21: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Outline

• Analog to Digital Converter• ADC0804• ADC0808• ADC 0816• ADC Circuit with 8051 and

Programming

Page 22: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• Separate output enable input for expanding the number of channels

• Analog multiplexer in-built gives the analog output for the filter and S/H inputs and then hold output is analog input for conversion (Separate S/H and filter not needed for a channel)

ADC0816

Page 23: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• 8 bit ADC• Interfaces micro-controller ports

or processor data buses (D0-D7), RD, WR, ALE for channel select through AD3-AD2-AD1-AD0 bus inputs (also separate A3-A0),

• WR input for start of conversion (SOC)

ADC0816

Page 24: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• SOC input can be a sharp - pulse using a NOT - NAND combination

• RD input for converted bits on D0-D7

• EOC output for end of conversion to facilitate interrupt (INTR) driven IOs

ADC0816

Page 25: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• Separate analog and digital grounds to separate digital transitions noise by direct connection of AN-GND to supply GND

• Clock frequency input

ADC0816

Page 26: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC 0808

VCCEOCA

MU

X o

utpu

t

Vref- Digital GND

RD

B0-B7IOWR

Vref+

AN-GND

CLKINCLKR

Vin+Ch0-15

INTRV

out

RC pair

P3.6 or IORDIC

ALE IN

out enable

ADC 16- Channels

ChA0-ChA3

P3.7

expa

nsio

n co

ntro

l

Page 27: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

B0-B7 connects to data D0-D7

ChA0-ChA3 connects to A0-A3/AD0-AD3

CS out enable

ALE IN

IOWR IORD

CS

RD S/H

AMUX output

VoutVref-

Page 28: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Table 7.20 - Each Pin signals

Table 7.19 - Functions ofsubunits in circuit

Page 29: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Table 7.21 - Sixteen Addresses in Exemplary circuit for ADC 08016,

when interfacing using An-A7 = 0, A6 =1 A5 = 0 A4 = 0

A3-A2-A2-A1 Channel select bits

CSAn-A4Decoder or port bit

Page 30: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Outline

• Analog to Digital Converter• ADC0804• ADC0808• ADC 0816• ADC Circuit with 8051 and

Programming

Page 31: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

ADC 0804

VCCEOC

CS

Vin-

S/H

Digital GNDRD

B0-B7IOWR

Vref/2

AN-GND

CLKINCLKR

Vin+

P2.7

P 2.2 or 3.2

P2.1

C =150 pF and R = 10kP2.6

IC

AN+ input

Vin+

ADC0804with 8051

R

Page 32: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

2.Select ADC write P2.1 = 03. Pulse Start ADC write P2.7 = 1, then P2.7 = 0

5. Reset P2.6 and Read P14.Wait till INT0 interrupt or till P2.2

1.Initial condition P2.6 = 1,P2.7 = 1, P3.2 = 1

Page 33: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Interface with 68HC11

68HC11

VCCIRQ

Vref+

GNDR/W

AD0-AD7

Vref-

PE0 Vin+PE1 Vin+PE2 Vin+PE3 Vin+

Page 34: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

Summary

Page 35: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

• Bits at output• Multi channel• ADC 0804,0808, 0816 • Interfacing to ports• Internal AMUX and channel

address latch

ADC Features

Page 36: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

End of Lesson 5

ADC - Analog to Digital Converter

Page 37: Interfacing Peripheral ICs and their Chapter 7 ADC04 one channel ADC with voltage reference = 1/2 of maximum permitted analog input • ADC0808 eight channels ADC with voltage reference

Ch07L5 -"Microcontrollers.........", Raj Kamal, Pearson Education, 2005

THANK YOU