| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Simons analog digital converter (A/D) primary tool that allows an
Top Searches for this datasheetMASTERING PIC16C7X CONVERTER Simons analog digital converter (A/D) primary tool that allows analog signals quantized into world digital electronics. Once signal digitally represented, stored, analyzed manipulated variety logic devices. PIC16C7X microcontrollers have integrated onto PIC16CXX core processor. Utilizing Microchip's requires only basic level understanding result. However, maximizing effectiveness each specific application requires higher level thought understanding. Typically thorough comprehension device obtained through experience, studying data sheets studying application notes reasonable amount time. This article addresses main technical considerations effective design reduce your design time. When detailing maximize effectiveness design, look weakest (and strongest) elements. Please misinterpret statements detailing weaknesses below specification. part specifications based upon worst case. suggestions should improve worst case specifications. We'll start covering Basics, then dive into other three general technical categories which essential effective design: Speed Accuracy Power Usage Even though converting `digital world', must remember that certain analog `laws' still hold true. Specifically, basically capacitor which have time charge/discharge analog level before conversion started. Source impedance internal impedances give effective resistance series with capacitor(s). This time constant determines minimum amount charge/discharge time achieve desired accuracy. This time minimum tracking time (referred minimum sampling time data book). Once minimum time been met, voltage capacitor will track voltage until conversion started. Once conversion begun, internally disconnected from capacitor. voltage capacitor held constant entire conversion process. This type sampling circuit referred "track hold". Step Step order perform conversion, must enable setting ADON (ADCON0 register). Select channel sampled setting/clearing CHS2, CHS1, CHS0 bits (ADCON0 register). ADCON0 register's descriptions device's data sheet actual combinations selected channel(s). default input setup analog pins analog, digital. pins analog, digital input buffers internally disconnected. This keep analog voltages CMOS input buffer. input voltage digital 0.5VDD example, then both PMOS NMOS cells which make CMOS input buffer would turned This causes input buffer draw around 150µA. using analog digital input, load register ADCON1 with correct value change default from analog digital. pin's will always read when configured analog input (since disconnected from pin). ADCON1 register's descriptions device's data sheet actual combinations selected channel(s). BASICS Specifications Microchip's successive approximation which uses bank internal capacitors totalling 51.2pF. maximum resolution 8-bits. converter accuracy specification bit, that made better worse your design. analog channels multiplexed converter which means that only analog channel sampled time. conversion time maximum sampling frequency application specific. 1996 Microchip Technology Inc. FACT002-page This document created with FrameMaker Step Step (cont'd) Wait least minimum tracking time. tracking time time required charge 51.2pF capacitor (located internal PIC16C7X) voltage level selected channel. tracking time made three components: Amplifier Settling Time Holding Capacitor Charging Time Temperature Coefficient EXAMPLE VREF Error bits ±1/2 tCHARGE 10k)(51.2pF) 1/512 5.75µs EXAMPLE Same values Example except .01µF decoupling capacitor pin. This effectively reduces impedance capacitor. TCHARGE 50)(51.2pF) 1/512 2.57µs Choosing clock source (TAD) determines time required conversion each bit. There four choices clock source: FOSC/2, FOSC/8, FOSC/32 FRC. Bits ADCS1 ADCS0 (ADCON0 register) determine clock source. TTRACKING TAMP TCHARGE TTEMP Given:TtAMP Given: TTEMP= (Temp 25°C)(0.05µs/°C), 25°C TTEMP= 25°C TCHARGE Equation Derivation: Basic Capacitor Charge Equation applies Table will help choose clock source according your oscillator frequency. TABLE DEVICE OSCILLATOR FREQUENCY CLOCK SOURCE FOSC/2 FOSC/8 FOSC/32 4MHz 16MHz 20MHz Where: Source Impedance Internal Interconnect Impedance Internal Sampling Switch Impedance (see PIC16/17 Data Book, Section 13.1 values) 51.2pF VREF -error PIC16C71 1MHz PIC16C70/71A/72/73/74 1.25MHz 5MHz Note: assigns internal oscillator which typically (min 2µs, 6µs). Therefore: VREF error error error error calculate precise period have chosen: where either After setting waiting minimum tracking time, GO/DONE (ADCON0 register) start conversion. Either poll GO/DONE cleared, poll ADIF set, enable interrupts wait interrupt happen. When these events occurs, conversion finished result located ADRES register. will begin tracking analog signal again (TRESET) after conversion completed. time necessary take analog digital sample total tracking time plus conversion time. repetitive samples, TRESET added total time. this equation calculate max. repetitive sampling rate (FSAMPLING). 1/FSAMPLING TSAMPLE TTRACKING TCONVERSION TRESET Reducing this time significantly reduce accuracy result. FACT002-page 1996 Microchip Technology Inc. SPEED your design will require sample time less than 60µs then will want consider following factors: tracking time, conversion time, minimum acceptable precision. When choosing clock source fastest conversion time, want close (but less than) PIC16C71 1.6µs PIC16C70, PIC16C71A, PIC16C72, PIC16C73 PIC16C74. What minimum precision your design requires (i.e., 4-bit, 6-bit 8-bit)? This important question, since accelerate conversion after desired accuracy been achieved. cannot interrupt abort conversion after achieving desired accuracy since result written ADRES until entire bits have been converted (regardless accuracy each bit). Figure illustrates timing required determine each bit. Since operates synchronously with respect internal instruction cycle (4/FOSC), accurately determine when select faster (FOSC/2). least significant bits determined after conversion been accelerated will unreliable most likely inaccurate. following calculation determines minimum amount time before change clock select bits resolution required. TCONVERSION N)(2 Tosc) (where Number bits resolution) FIGURE CONVERSION TIMING (TOSC/2) ADCON0, DATA ADRES ADIF TRACKING TIME clock source selected time added before clock starts. This allows sleep instruction executed. TRACKING STOPPED DONE NEW_DATA OLD_DATA 1996 Microchip Technology Inc. FACT002-page TABLE Parameter CONVERSION REQUIREMENTS* Sym. Characteristic clock period Internal Oscillator source 9.5TAD Min. Typ. Max. Units VREF3.0V VREF full range ADCS1,0 oscillator source) PIC16LC74 PIC16C74 Conditions TCNV Conversion time (not including time)(Note Sampling time TSMP minimum time amplifier settling time. This used "new" input voltage changed more than 1LSb (i.e., 20mV 5.12V) from last sampled voltage stated CHOLD). These parameters characterized tested. Data "Typ" column 5.0V, 25°C unless otherwise stated. These parameters design guidance only tested. Note ADRES register read following cycle. TTRACK TSMP. Parameter #132 TSMP Sampling Time. EXAMPLE STANDARD LSb) FAST CONVERSION Processor PIC16C74 Oscillator 20MHz possible 1.6µs clock source FOSC/32 1.6µs TTRACKING (5µs 2.57µs) 7.65µs [from Example tCONVERSIOn 15.2µs TAD_SAMPLE 15.2µs 7.6µs 26µs FMAX_A/D_SAMPLING_RATE 38.4kHz EXAMPLE (±1/32 LSb) FAST CONVERSION Processor PIC16C71 Oscillator 16MHz possible 2.0µs clock source FOSC/32 2.0µs TTRACKING (5µs 2.57µs) 7.65µs [from Example TCONVERSION 11.5µs TAD_SAMPLE 11.5µs 7.6µs 23.1µs FMAX_A/D_SAMPLING_RATE 43.3kHz Executing instructions while previous conversion still running will allow `overhead' code executed during tracking time conversion time. Don't worry about using data from immediately after been cleared. ADRES register will contain previous result until updated with result. (The cleared that time.) order ensure that sampling time started quickly possible, channel next conversion (ADCON1) after current tracking stopped before current conversion done (this will affect current conversion). FACT002-page 1996 Microchip Technology Inc. ACCURACY Every designer should understand what effects accuracy A/D. following techniques improve your designs. meticulous careful design achieve approximately LSb. critical factor A/D's accuracy power supply PIC16C7X. Noise ripple adversely affect conversion's accuracy (the degree which accuracy affected dependent upon amplitude noise). improve supply, common filtering techniques, such decoupling capacitors various frequencies. Note: Remember that capacitors ideal really band-pass, low-pass, filters (i.e., more than different values necessary). VREF pull 20ns when conversion started. VREF source (either VDD) doesn't change current draw. Make sure your design source this current (and able very fast). Capacitors VREF will source this current draw. better VREF source than because noise present absolutely coupled, linearly coupled. Increasing tracking time (TTRACKING) >5µs produces measurable increase accuracy. 20µs generally good length tracking time before starting conversion. Increase about 4µs. This allows internal comparator response time increase with less overdrive error. Notice that typically 4µs. Operate room temperature (25°C) since high temperature increases leakage from sample capacitor temperatures shift threshold levels. know that high temperature operation possible, keep close minimum possible. change value pins which configured output while conversion progress (regardless port). high source/sink capability pins could directly inject noise onto VDD. capable finishing conversion while part sleeping. Putting part sleep helps accuracy since this mode eliminates internal switching noise processor core. Note: this with oscillator mode, will have allow wake-up time when using modes. mode start-up timer starts instantly. EXAMPLE 20mV noise when 5.0V VREF 20mV noise when VREF Noise input channel during tracking will error desired result. properly sized filter capacitor input will help correct this. Note: PIC16C71 PIC16C70, right next OSC1 cannot help pick some noise. possible, make this output help isolate noise from getting RA1. processor sleep, consider clearing interrupt enable bits (including bit), except ADIE. This will cause processor wake from sleep when conversion complete resume executing code with instruction following sleep instruction. This method helps simplify your interrupt service routine other peripherals. EXAMPLE CLRF SLEEP MOVF (PIC16C71 PIC16C70) INTCON INTCON,ADIE ADCON0,GO ADRES,0 1996 Microchip Technology Inc. FACT002-page POWER USAGE following simple, straight-forward pointers help application meet power requirements. Keeping turned until ready start tracking will reduce approximately 180µA current draw from your system. ADON (ADCON0) turns off. Configure analog inputs analog since this will disconnect CMOS digital input buffer. not, signal 0.5VDD, both transistors CMOS input buffer will turned causing maximum current draw input buffer. want controller sleep during conversion. There several factors consider this decision, here few: move must selected conversion clock. have timers running that cannot stopped? wake-up from sleep time longer than conversion time? afford lose processing time while sleeping waking from sleep? Keeping Usage Simple decoupling capacitor VDD. .01µF capacitor analog input source. Select which pins digital which pins analog (register ADCON1). Using internal oscillator determine provides relatively fast accurate conversion most applications (bits ADCS1, ADCS0 register ADCON1). using mode core's oscillator, then should part sleep during conversion (see PIC16C71 errata) choose appropriate source other than Select which channel sampled (bits CHS2, CHS1 CHS0 register ADCON0). Turn setting ADON (reg ADCON0). Wait 20µs (tracking time). (reg ADCON0) start conversion. Poll either ADIF determine when conversion completed. Utilize result located ADRES register. Clear ADIF bit. EXAMPLE MOVLW MOVWF CLRF MOVLW MOVF CALL BTFSC GOTO STATUS,RP0 0xFE TRISA ADCON1 STATUS,RP0 0C9h ADCON0,W 20US_DELAY INTCON,GIE INTCON,GIE GIE_OFF ;MAKE OUTPUT ;AND INPUT ;MAKE ANALOG INPUTS OSC, RA1, ADON GIE_OFF ;MAKE SURE INTERRUPTED AD_GOING ADCON0,G0 BTFSC ADCON0,GO GOTO AD_GOING ;Result located ADRES FACT002-page 1996 Microchip Technology Inc. Other recent searchesSi4310DY - Si4310DY Si4310DY Datasheet REJ03D0797-0100 - REJ03D0797-0100 REJ03D0797-0100 Datasheet MSC8101 - MSC8101 MSC8101 Datasheet MO127 - MO127 MO127 Datasheet MMDT4413 - MMDT4413 MMDT4413 Datasheet DD3520 - DD3520 DD3520 Datasheet DD3524 - DD3524 DD3524 Datasheet ADT7301 - ADT7301 ADT7301 Datasheet
Privacy Policy | Disclaimer |