ECT 357 Ch 10 Analog to Digital COnversion. Today’s Quote: It’s better to die with a good name...
-
Upload
adela-butler -
Category
Documents
-
view
213 -
download
0
Transcript of ECT 357 Ch 10 Analog to Digital COnversion. Today’s Quote: It’s better to die with a good name...
ECT 357ECT 357
Ch 10 Analog to Digital Ch 10 Analog to Digital COnversionCOnversion
Today’s Quote:Today’s Quote:
It’s better to die with a It’s better to die with a good name than to live good name than to live with a bad one.with a bad one.
A good name is better than precious A good name is better than precious ointment.ointment.
Ecclesiastes 7:1Ecclesiastes 7:1
Analog to Digital Converter Analog to Digital Converter TypesTypes
• Sigma DeltaSigma Delta
• IncrementalIncremental
• Successive ApproximationSuccessive Approximation
• FlashFlash
PIC18F452 ADC OverviewPIC18F452 ADC Overview
• 10 bit resolution10 bit resolution
• 2 output formats (ADRESH,ADRESL)2 output formats (ADRESH,ADRESL)
• 15 port configurations15 port configurations
• Internal/external referenceInternal/external reference
• Interrupt optionInterrupt option
• Clock optionsClock options
ADC UsesADC Uses
• Analog InputAnalog Input
• Control LoopsControl Loops
• PID ControlPID Control
• External InterfacesExternal Interfaces
ADC I/O pinsADC I/O pins
• Port A 0-3, Port A 5, Port E 0-2Port A 0-3, Port A 5, Port E 0-2
• Port Configuration determined by Port Configuration determined by PCFG bits in ADCON1PCFG bits in ADCON1
• Selects internal or external voltage Selects internal or external voltage referencereference
• Selects digital input or analog input Selects digital input or analog input for each pinfor each pin
ADC CharacteristicsADC Characteristics
• ADC conversion time ADC conversion time (50kHz<X<625kHz)(50kHz<X<625kHz)
• Minimum sample time (15 usec)Minimum sample time (15 usec)
• Conversion time (12xADC clock Conversion time (12xADC clock period)period)
ADC Initialization and ADC Initialization and OperationOperation
• Setup ADCON0Setup ADCON0
• Setup ADCON1Setup ADCON1
• Select ChannelSelect Channel
• Wait 15 usec for holding cap Wait 15 usec for holding cap
• Set GO_DONE bit in ADCON0Set GO_DONE bit in ADCON0
• Wait for GO_DONE to clearWait for GO_DONE to clear
• Get data out of ADRESH and ADRESLGet data out of ADRESH and ADRESL