SlideShare a Scribd company logo
1 of 22
Download to read offline
Lecture 11
Digital-to-Analog Converters
and Analog Comparators
2
DACs and Comparators
 What is a DAC?
 Types of DACs
 12-bit DACs (DAC0 and DAC1)
 Output scheduling
 Output scaling
 Programming the DACs
 Analog comparators
 Functional block diagram
 Hysteresis plot
 Comparator output
3
C8051F020 Analog Peripherals
 C8051F020 contains the following to analog peripherals:
 One 8-bit and one 12-bit analog-to-digital converter (ADC)
 Two 12-bit digital-to-analog converters (DAC)
 Programmable gain amplifiers (PGAs)
 Analog multiplexer (8-channel and 9-channel)
 Two analog comparators
 Precision voltage reference
 Temperature sensor
4
What is a DAC?
 DAC is the acronym for digital-to-analog converter
 A DAC takes a digital value as an input, and produces an analog signal
(voltage or current) at its output
Digital Input (codes)
AnalogOutput(VorI)
0
Full-
Scale
0
(2N
)-1
DAC Transfer
Function
5
Different Types of DACs
 There are a few different types of common DACs:
 Voltage DACs:
 Produce a voltage level proportional to the digital input
 Use a voltage reference
 Voltage is held steady at the output, current may vary
 Current DACs:
 Produce a current proportional to the digital input
 Use a current reference
 Current is held steady at the output, voltage may vary
 Two types: current sourcing and current sinking
6
C8051F020 12-Bit DACs (DAC0 and DAC1)
 The DAC subsystem consists of two 12-bit voltage DACs
 DAC0 and DAC1
 The two DACs are functionally identical and each is
configured via the respective control registers, DAC0CN and
DAC1CN
 The DACs have an output swing of 0 V to VREF for a
corresponding input code range of 000H to FFFH
7
12-bit DACs (DAC0 and DAC1)
Output Buffers
8
Output Scheduling
 The DACs have four modes of output scheduling:
 Output on demand (writing to high byte of DACx data word register,
DACxH)
 Timer 2 overflow
 Timer 3 overflow
 Timer 4 overflow
 The output on demand mode is the default mode
 In this mode, the DAC output is updated when DACxH is written to
 Writes to DACxL are held and have no effect on the output
until DACxH is written to
 To write a 12-bit data word at full resolution to DACx, the write
sequence should be DACxL followed by DACxH
9
Output Scaling
 The format of the 12-bit
data word in the DACxH
and DACxL registers
can be configured by
setting the appropriate
DACxDF bits (DACxCN.
[2:0])
 The five data word
orientations are 
10
Programming the DACs
 DACx can be programmed through the following sequence:
 Step 1: configure the voltage reference (REF0CN)
 Step 2: load the data word registers with the desired 12 bit digital
value (DACxH and DACxL)
 Step 3: set the appropriate output scheduling mode and data word
format, and turn on DACx (DACxCN.7)
 Step 4: set up and run the appropriate timers, if applicable
11
DAC0CN—DAC0 Control Register
Bit Symbol Description
7 DAC0EN
DAC0 Enable Bit
0: DAC0 disabled. DAC0 is in low power
shutdown mode and the output pin is in a high impedance state.
1: DAC0 enabled. DAC0 is operational and the output pin is active.
6-5 - UNUSED. Read=00, Write=don’t care
4-3 DAC0MD1-0
DAC0 Mode Bits
00: DAC output updates occur on write to DAC0H.
01: DAC output updates occur on Timer 3 overflow.
10: DAC output updates occur on Timer 4 overflow.
11: DAC output updates occur on Timer 2 overflow.
2-0 DAC0DF2-0
DAC0 Data Format Bits.
000: The most significant 4 bits of the DAC0 Data Word are in DAC0H[3:0], while the
least significant 8 bits are in DAC0L[7:0].
001: The most significant 5 bits of the DAC0 Data Word are in DAC0H[4:0], while the
least significant 7 bits are in DAC0L[7:1].
010: The most significant 6 bits of the DAC0 Data Word are in DAC0H[5:0], while the
least significant 6 bits are in DAC0L[7:2].
011: The most significant 7 bits of the DAC0 Data Word are in DAC0H[6:0], while the
least significant 5 bits are in DAC0L[7:3].
1xx: The most significant 8 bits of the DAC0 Data Word are in DAC0H[7:0], while the least
significant 4 bits are in DAC0L[7:4].
12
DAC1CN—DAC1 Control Register
Bit Symbol Description
7 DAC1EN
DAC1 Enable Bit
0: DAC1 disabled. DAC1 is in low power
shutdown mode and the output pin is in a high impedance state.
1: DAC1 enabled. DAC1 is operational and the output pin is active.
6-5 - UNUSED. Read=00, Write=don’t care
4-3 DAC1MD1-0
DAC1 Mode Bits
00: DAC output updates occur on write to DAC1H.
01: DAC output updates occur on Timer 3 overflow.
10: DAC output updates occur on Timer 4 overflow.
11: DAC output updates occur on Timer 2 overflow.
2-0 DAC1DF2-0
DAC1 Data Format Bits.
000: The most significant 4 bits of the DAC1 Data Word are in DAC1H[3:0], while the
least significant 8 bits are in DAC1L[7:0].
001: The most significant 5 bits of the DAC1 Data Word are in DAC1H[4:0], while the
least significant 7 bits are in DAC1L[7:1].
010: The most significant 6 bits of the DAC1 Data Word are in DAC1H[5:0], while the
least significant 6 bits are in DAC1L[7:2].
011: The most significant 7 bits of the DAC1 Data Word are in DAC1H[6:0], while the
least significant 5 bits are in DAC1L[7:3].
1xx: The most significant 8 bits of the DAC1 Data Word are in DAC1H[7:0], while the least
significant 4 bits are in DAC1L[7:4].
13
What is a Comparator?
 A simple analog device that compares two analog voltages
 A comparator generates an output of high (1) or low (0)
based on which of the inputs is greater than the other
14
Comparators—Introduction
 There are two voltage comparators which may be enabled
or disabled individually
 The inputs of each comparator are available at the package
pins
 The input range is: -0.25 V to [ (AV+) + 0.25 V ]
 The output of each comparator is optionally available at the
package pins via the crossbar
 Each comparator output can be programmed to operate in
open drain or push-pull modes
 Comparator control registers (CPT0CN and CPT1CN)
are used to program the comparators
15
Comparators—Functional Block Diagram
16
Comparators—Hysteresis Plot
Negative Hysteresis Voltage
(CP0HYN bits)
Positive Hysteresis Voltage
(CP0HYP bits)
17
Comparators—Hysteresis
 Hysteresis is useful to eliminate repetitive on-off output
transitions, which can happen when both the input values of
the comparator are close to each other
 The hysteresis of each comparator is software
programmable using the comparator control registers
(bits 3-0):
 Amount of hysteresis
 Positive- and negative-going symmetry around the threshold voltage
 CP0HYN (CP1HYN) bits for negative hysteresis (bits 1-0)
 CP0HYP (CP1HYP) bits for positive hysteresis (bits 3-2)
18
Comparator Output
 The output of the comparator can be polled in software or
can be used as interrupt source
 The output state of a comparator can be obtained any time
by reading the CP0OUT (CP1OUT) bit
 Comparator interrupts can be generated on rising-edge
and/or falling-edge output transitions:
 The CP0FIF (CP1FIF) flag is set upon a comparator falling-edge
interrupt
 The CP0RIF (CP1RIF) flag is set upon a comparator rising-edge
interrupt
 Once these flags are set, they remain set until cleared by software
19
Comparator Interrupts
Interrupt Source
Interrupt
Vector
Priority
Order
Pending Flag
Enable
Flag
Priority
Control
Comparator 0 Falling
Edge
0053 10
CP0FIF
(CPT0CN.4)
ECP0F
(EIE1.4)
PCP0F
(EIP1.2)
Comparator 0 Rising
Edge
005B 11
CP0RIF
(CPT0CN.5)
ECP0R
(EIE1.5)
PCP0R
(EIP1.5)
Comparator 1 Falling
Edge
0063 12
CP1FIF
(CPT1CN.4)
ECP1F
(EIE1.6)
PCP1F
(EIP1.6)
Comparator 1 Rising
Edge
006B 13
CP1RIF
(CPT1CN.5)
ECP1R
(EIE1.7)
PCP1F
(EIP1.7)
20
CPT0CN—Comparator0 Control Register
21
CPT1CN—Comparator1 Control Register
www.silabs.com/MCU

More Related Content

What's hot (20)

Data converter fundamentals
Data converter fundamentalsData converter fundamentals
Data converter fundamentals
 
Adc
AdcAdc
Adc
 
Dac, adc architecture
Dac, adc architectureDac, adc architecture
Dac, adc architecture
 
ADC and DAC Best Ever Pers
ADC and DAC Best Ever PersADC and DAC Best Ever Pers
ADC and DAC Best Ever Pers
 
Data serializing
Data serializingData serializing
Data serializing
 
Converter specification
Converter specificationConverter specification
Converter specification
 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
 
R-2R Ladder DAC
R-2R Ladder DACR-2R Ladder DAC
R-2R Ladder DAC
 
Adc and dac
Adc and dacAdc and dac
Adc and dac
 
ADC & DAC
ADC & DAC ADC & DAC
ADC & DAC
 
Lica 7th chapter slides
Lica 7th chapter slidesLica 7th chapter slides
Lica 7th chapter slides
 
Adc dac converter
Adc dac converterAdc dac converter
Adc dac converter
 
Dsp U Lec02 Data Converters
Dsp U   Lec02 Data ConvertersDsp U   Lec02 Data Converters
Dsp U Lec02 Data Converters
 
M-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATIONM-TECH 4th SEM PRESENTATION
M-TECH 4th SEM PRESENTATION
 
Analog to Digital Conversion
Analog to Digital ConversionAnalog to Digital Conversion
Analog to Digital Conversion
 
Adc.pptx ashvani 151503
Adc.pptx ashvani 151503Adc.pptx ashvani 151503
Adc.pptx ashvani 151503
 
R2 r dac
R2 r dacR2 r dac
R2 r dac
 
Digital to analog convertor
Digital to analog convertorDigital to analog convertor
Digital to analog convertor
 
ADC & DAC
ADC & DACADC & DAC
ADC & DAC
 
Adc f05
Adc f05Adc f05
Adc f05
 

Similar to Lecture 11 (dac and comparator) rv01

Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01cairo university
 
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxasolis5
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosps6005tec
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Siraj Ahmed
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Daman Singh
 
digital anlage c converter for digital .ppt
digital anlage c converter for digital .pptdigital anlage c converter for digital .ppt
digital anlage c converter for digital .pptAbdullahOmar64
 
05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15John Todora
 
Study on 12-/14-/16-Bit, Octal-Channel, DAC
Study on 12-/14-/16-Bit, Octal-Channel, DACStudy on 12-/14-/16-Bit, Octal-Channel, DAC
Study on 12-/14-/16-Bit, Octal-Channel, DACPremier Farnell
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptxnaveen088888
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACnanocdac
 
analog to digital converter seminar
analog to digital converter seminaranalog to digital converter seminar
analog to digital converter seminargayatrigayu1
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERChirag Lakhani
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfsatyamsinha37
 

Similar to Lecture 11 (dac and comparator) rv01 (20)

Lecture 12 (adc) rv01
Lecture 12  (adc) rv01Lecture 12  (adc) rv01
Lecture 12 (adc) rv01
 
Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01Lecture 2 (system overview of c8051 f020) rv01
Lecture 2 (system overview of c8051 f020) rv01
 
dsd.pptx
dsd.pptxdsd.pptx
dsd.pptx
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicos
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
 
digital anlage c converter for digital .ppt
digital anlage c converter for digital .pptdigital anlage c converter for digital .ppt
digital anlage c converter for digital .ppt
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
05 analog control_sp15
05 analog control_sp1505 analog control_sp15
05 analog control_sp15
 
Study on 12-/14-/16-Bit, Octal-Channel, DAC
Study on 12-/14-/16-Bit, Octal-Channel, DACStudy on 12-/14-/16-Bit, Octal-Channel, DAC
Study on 12-/14-/16-Bit, Octal-Channel, DAC
 
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
UNIT 4 & 5 - I         nterfacing_Lecture7.pptxUNIT 4 & 5 - I         nterfacing_Lecture7.pptx
UNIT 4 & 5 - I nterfacing_Lecture7.pptx
 
Keypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDACKeypad interfacing 8051 -NANOCDAC
Keypad interfacing 8051 -NANOCDAC
 
analog to digital converter seminar
analog to digital converter seminaranalog to digital converter seminar
analog to digital converter seminar
 
ATT SMK.pptx
ATT SMK.pptxATT SMK.pptx
ATT SMK.pptx
 
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLERDIGITAL VOLTMETER USING 8051 MICROCONTROLLER
DIGITAL VOLTMETER USING 8051 MICROCONTROLLER
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
8085 Architecture
8085 Architecture8085 Architecture
8085 Architecture
 
digitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdfdigitalvoltmeterusing805112b2-170214173216 (1).pdf
digitalvoltmeterusing805112b2-170214173216 (1).pdf
 

More from cairo university

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedcairo university
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devicescairo university
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitscairo university
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xcairo university
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitscairo university
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...cairo university
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuitscairo university
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuitscairo university
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuitscairo university
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency responsecairo university
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revisioncairo university
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01cairo university
 
Lecture 10 (serial communication)
Lecture 10 (serial communication)Lecture 10 (serial communication)
Lecture 10 (serial communication)cairo university
 

More from cairo university (20)

Tocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extendedTocci chapter 13 applications of programmable logic devices extended
Tocci chapter 13 applications of programmable logic devices extended
 
Tocci chapter 12 memory devices
Tocci chapter 12 memory devicesTocci chapter 12 memory devices
Tocci chapter 12 memory devices
 
Tocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuitsTocci ch 9 msi logic circuits
Tocci ch 9 msi logic circuits
 
Tocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified xTocci ch 7 counters and registers modified x
Tocci ch 7 counters and registers modified x
 
Tocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuitsTocci ch 6 digital arithmetic operations and circuits
Tocci ch 6 digital arithmetic operations and circuits
 
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
Tocci ch 3 5 boolean algebra, logic gates, combinational circuits, f fs, - re...
 
A15 sedra ch 15 memory circuits
A15  sedra ch 15 memory circuitsA15  sedra ch 15 memory circuits
A15 sedra ch 15 memory circuits
 
A14 sedra ch 14 advanced mos and bipolar logic circuits
A14  sedra ch 14 advanced mos and bipolar logic circuitsA14  sedra ch 14 advanced mos and bipolar logic circuits
A14 sedra ch 14 advanced mos and bipolar logic circuits
 
A13 sedra ch 13 cmos digital logic circuits
A13  sedra ch 13 cmos digital logic circuitsA13  sedra ch 13 cmos digital logic circuits
A13 sedra ch 13 cmos digital logic circuits
 
A09 sedra ch 9 frequency response
A09  sedra ch 9 frequency responseA09  sedra ch 9 frequency response
A09 sedra ch 9 frequency response
 
5 sedra ch 05 mosfet.ppsx
5  sedra ch 05  mosfet.ppsx5  sedra ch 05  mosfet.ppsx
5 sedra ch 05 mosfet.ppsx
 
5 sedra ch 05 mosfet
5  sedra ch 05  mosfet5  sedra ch 05  mosfet
5 sedra ch 05 mosfet
 
5 sedra ch 05 mosfet revision
5  sedra ch 05  mosfet revision5  sedra ch 05  mosfet revision
5 sedra ch 05 mosfet revision
 
Fields Lec 2
Fields Lec 2Fields Lec 2
Fields Lec 2
 
Fields Lec 1
Fields Lec 1Fields Lec 1
Fields Lec 1
 
Fields Lec 5&6
Fields Lec 5&6Fields Lec 5&6
Fields Lec 5&6
 
Fields Lec 4
Fields Lec 4Fields Lec 4
Fields Lec 4
 
Fields Lec 3
Fields Lec 3Fields Lec 3
Fields Lec 3
 
Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01Lecture 1 (course overview and 8051 architecture) rv01
Lecture 1 (course overview and 8051 architecture) rv01
 
Lecture 10 (serial communication)
Lecture 10 (serial communication)Lecture 10 (serial communication)
Lecture 10 (serial communication)
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 

Lecture 11 (dac and comparator) rv01

  • 2. 2 DACs and Comparators  What is a DAC?  Types of DACs  12-bit DACs (DAC0 and DAC1)  Output scheduling  Output scaling  Programming the DACs  Analog comparators  Functional block diagram  Hysteresis plot  Comparator output
  • 3. 3 C8051F020 Analog Peripherals  C8051F020 contains the following to analog peripherals:  One 8-bit and one 12-bit analog-to-digital converter (ADC)  Two 12-bit digital-to-analog converters (DAC)  Programmable gain amplifiers (PGAs)  Analog multiplexer (8-channel and 9-channel)  Two analog comparators  Precision voltage reference  Temperature sensor
  • 4. 4 What is a DAC?  DAC is the acronym for digital-to-analog converter  A DAC takes a digital value as an input, and produces an analog signal (voltage or current) at its output Digital Input (codes) AnalogOutput(VorI) 0 Full- Scale 0 (2N )-1 DAC Transfer Function
  • 5. 5 Different Types of DACs  There are a few different types of common DACs:  Voltage DACs:  Produce a voltage level proportional to the digital input  Use a voltage reference  Voltage is held steady at the output, current may vary  Current DACs:  Produce a current proportional to the digital input  Use a current reference  Current is held steady at the output, voltage may vary  Two types: current sourcing and current sinking
  • 6. 6 C8051F020 12-Bit DACs (DAC0 and DAC1)  The DAC subsystem consists of two 12-bit voltage DACs  DAC0 and DAC1  The two DACs are functionally identical and each is configured via the respective control registers, DAC0CN and DAC1CN  The DACs have an output swing of 0 V to VREF for a corresponding input code range of 000H to FFFH
  • 7. 7 12-bit DACs (DAC0 and DAC1) Output Buffers
  • 8. 8 Output Scheduling  The DACs have four modes of output scheduling:  Output on demand (writing to high byte of DACx data word register, DACxH)  Timer 2 overflow  Timer 3 overflow  Timer 4 overflow  The output on demand mode is the default mode  In this mode, the DAC output is updated when DACxH is written to  Writes to DACxL are held and have no effect on the output until DACxH is written to  To write a 12-bit data word at full resolution to DACx, the write sequence should be DACxL followed by DACxH
  • 9. 9 Output Scaling  The format of the 12-bit data word in the DACxH and DACxL registers can be configured by setting the appropriate DACxDF bits (DACxCN. [2:0])  The five data word orientations are 
  • 10. 10 Programming the DACs  DACx can be programmed through the following sequence:  Step 1: configure the voltage reference (REF0CN)  Step 2: load the data word registers with the desired 12 bit digital value (DACxH and DACxL)  Step 3: set the appropriate output scheduling mode and data word format, and turn on DACx (DACxCN.7)  Step 4: set up and run the appropriate timers, if applicable
  • 11. 11 DAC0CN—DAC0 Control Register Bit Symbol Description 7 DAC0EN DAC0 Enable Bit 0: DAC0 disabled. DAC0 is in low power shutdown mode and the output pin is in a high impedance state. 1: DAC0 enabled. DAC0 is operational and the output pin is active. 6-5 - UNUSED. Read=00, Write=don’t care 4-3 DAC0MD1-0 DAC0 Mode Bits 00: DAC output updates occur on write to DAC0H. 01: DAC output updates occur on Timer 3 overflow. 10: DAC output updates occur on Timer 4 overflow. 11: DAC output updates occur on Timer 2 overflow. 2-0 DAC0DF2-0 DAC0 Data Format Bits. 000: The most significant 4 bits of the DAC0 Data Word are in DAC0H[3:0], while the least significant 8 bits are in DAC0L[7:0]. 001: The most significant 5 bits of the DAC0 Data Word are in DAC0H[4:0], while the least significant 7 bits are in DAC0L[7:1]. 010: The most significant 6 bits of the DAC0 Data Word are in DAC0H[5:0], while the least significant 6 bits are in DAC0L[7:2]. 011: The most significant 7 bits of the DAC0 Data Word are in DAC0H[6:0], while the least significant 5 bits are in DAC0L[7:3]. 1xx: The most significant 8 bits of the DAC0 Data Word are in DAC0H[7:0], while the least significant 4 bits are in DAC0L[7:4].
  • 12. 12 DAC1CN—DAC1 Control Register Bit Symbol Description 7 DAC1EN DAC1 Enable Bit 0: DAC1 disabled. DAC1 is in low power shutdown mode and the output pin is in a high impedance state. 1: DAC1 enabled. DAC1 is operational and the output pin is active. 6-5 - UNUSED. Read=00, Write=don’t care 4-3 DAC1MD1-0 DAC1 Mode Bits 00: DAC output updates occur on write to DAC1H. 01: DAC output updates occur on Timer 3 overflow. 10: DAC output updates occur on Timer 4 overflow. 11: DAC output updates occur on Timer 2 overflow. 2-0 DAC1DF2-0 DAC1 Data Format Bits. 000: The most significant 4 bits of the DAC1 Data Word are in DAC1H[3:0], while the least significant 8 bits are in DAC1L[7:0]. 001: The most significant 5 bits of the DAC1 Data Word are in DAC1H[4:0], while the least significant 7 bits are in DAC1L[7:1]. 010: The most significant 6 bits of the DAC1 Data Word are in DAC1H[5:0], while the least significant 6 bits are in DAC1L[7:2]. 011: The most significant 7 bits of the DAC1 Data Word are in DAC1H[6:0], while the least significant 5 bits are in DAC1L[7:3]. 1xx: The most significant 8 bits of the DAC1 Data Word are in DAC1H[7:0], while the least significant 4 bits are in DAC1L[7:4].
  • 13. 13 What is a Comparator?  A simple analog device that compares two analog voltages  A comparator generates an output of high (1) or low (0) based on which of the inputs is greater than the other
  • 14. 14 Comparators—Introduction  There are two voltage comparators which may be enabled or disabled individually  The inputs of each comparator are available at the package pins  The input range is: -0.25 V to [ (AV+) + 0.25 V ]  The output of each comparator is optionally available at the package pins via the crossbar  Each comparator output can be programmed to operate in open drain or push-pull modes  Comparator control registers (CPT0CN and CPT1CN) are used to program the comparators
  • 16. 16 Comparators—Hysteresis Plot Negative Hysteresis Voltage (CP0HYN bits) Positive Hysteresis Voltage (CP0HYP bits)
  • 17. 17 Comparators—Hysteresis  Hysteresis is useful to eliminate repetitive on-off output transitions, which can happen when both the input values of the comparator are close to each other  The hysteresis of each comparator is software programmable using the comparator control registers (bits 3-0):  Amount of hysteresis  Positive- and negative-going symmetry around the threshold voltage  CP0HYN (CP1HYN) bits for negative hysteresis (bits 1-0)  CP0HYP (CP1HYP) bits for positive hysteresis (bits 3-2)
  • 18. 18 Comparator Output  The output of the comparator can be polled in software or can be used as interrupt source  The output state of a comparator can be obtained any time by reading the CP0OUT (CP1OUT) bit  Comparator interrupts can be generated on rising-edge and/or falling-edge output transitions:  The CP0FIF (CP1FIF) flag is set upon a comparator falling-edge interrupt  The CP0RIF (CP1RIF) flag is set upon a comparator rising-edge interrupt  Once these flags are set, they remain set until cleared by software
  • 19. 19 Comparator Interrupts Interrupt Source Interrupt Vector Priority Order Pending Flag Enable Flag Priority Control Comparator 0 Falling Edge 0053 10 CP0FIF (CPT0CN.4) ECP0F (EIE1.4) PCP0F (EIP1.2) Comparator 0 Rising Edge 005B 11 CP0RIF (CPT0CN.5) ECP0R (EIE1.5) PCP0R (EIP1.5) Comparator 1 Falling Edge 0063 12 CP1FIF (CPT1CN.4) ECP1F (EIE1.6) PCP1F (EIP1.6) Comparator 1 Rising Edge 006B 13 CP1RIF (CPT1CN.5) ECP1R (EIE1.7) PCP1F (EIP1.7)