AN780 MICROCHIP | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 10
Technical content
DS00780A-page 1© 2002 Microchip Technology, Inc. 15-Kilogram Scale Using the TC500A and the TC520 FIGURE 1: Functional block diagram. INTRODUCTION A 15kg weighing scale was designed using Microchip's TC500A Analog Processor and the TC520 16-bit Controller. The scale is required to resolve down to 1/8 gram and correct to within 61/2 gram. This project takes into account all aspects of a functional scale:
- Dynamic Range
- Strain Gauge Compensation
- Zeroing
- Oversampling
- Units Conversion (kilograms to pounds) The TC500A is an analog processor device which performs a dual- slope analog-to-digital conversion function. All of the counting and timing for the conversion must be controlled by an external source. In nearly all applications, this control source is a microprocessor. The microprocessor is programmed to monitor the status and to control the timing of the TC500A. It must also be programmed to count the conversion results. Author: Ted Dabney, Microchip Technology, Inc. The TC500A has no agenda of its own so it can be used to generate slow, high resolution conversions or fast, low resolution conver- sions. The trade-off for accuracy is about 1000 counts per millisec- ond of integration time, i.e., 16-bits with T INT approximately equal to 60mS. Typically, the total conversion time is about 4 times the integration time but, with the TC500A, this is quite flexible. T INT = CINT RINT VINT/VIN (max) eq1 The TC520 is a digital interface device which can be used to replace all of the TC500A timing and counting functions performed by a microprocessor. The TC520 can use either a crystal or external clock as a time-base to control the operation of either a TC500 or a TC500A. Level Shift Control Logic Analog Switch Control Signals 2 16 VIN Analog Common + VREF+ – BUF CAZ Buffer Integrator SWR SWIZ Comp 1 Comp 2 Comp Output GND15 1346897 12 13 B Control Logic SW1 TC500/TC500A CREF CREF SWR CREF CAZ RINT CINT CINT SWRI +SWRI +SWRI –SWRI SWZ SWI VIN SWZ VS– VS+ Phase Decoding Logic Polarity Detection A B Converter State 0 0 Zero Integrator Output 0 1 Auto-zero 1 0 Signal Integrate 1 1 Deintegrate VREF+ SWI A
© 2002 Microchip Technology, Inc.DS00780A-page 2 The 16-bit conversion result is accumulated in the TC520 along with a polarity bit and an overrange bit. These bits are formed into one 18-bit serial word which may be read at any rate and at any time. Reading the serial data from the TC520 does not effect the TC500A/TC520 conversion cycle except that the output shift register will not update while reading is in progress. DEVELOPING THE SCALE APPLICATION USING THE TC500A AND THE TC520 Input Stage The first consideration for a low signal level source is the amount of gain required for the input amplifier. The TC500A has a CMOS input buffer which, due to unity-gain phase margin, must have no lower than about 68kΩ for R INT. The maximum buffer current VIN(max)/RINT) should be no more than about 20µA. This means that the maximum input voltage to the TC500A should be about 1.5V. The 15kG strain gauge used for this application has an output of about 1mV/gram which gives a gain requirement of at least 50. The MCP606 CMOS operational amplifier is best suited for this because of its low noise and minimal drift. The output impedance of the strain gauge is only 300Ω so a single-ended configuration is more than adequate. Instead of 1.5V, the actual full-scale output wound up to be about 1V. The value of R INT was set to 130kΩ , well above the 68kΩ minimum. This gives a maximum buffer current of 7.6µA instead of 20µA. Integrator Stage The signal-to-noise ratio of the TC500A's integrator stage is a function of the band-width. The 15kG scale needs to resolve 1g with at least 8:1 over-sampling. This means at least 120,000 counts. The above rule of "1000 counts per millisecond" requires at least 120ms for the integration time of the TC500A. Selecting 200mS will lower the band-width and get maximum rejection of 50/ 60Hz. The strain gauge is a balanced bridge so the output will have some common mode component. A value of 3.5V for V INT instead of 4V will allow for some offset. Rearranging equation 1 gives an expression for CINT: C INT =V IN (max) TINT/VINT RINT = 1V 200mS/3.5V 130k = .439mF eq2 The next higher common value is .47µF which was selected for C INT. It is essential that this capacitor is a polypropylene type for very low dielectric absorption. REFERENCE VOLTAGE CIRCUIT The differential reference voltage is derived by the standard, dual- slope ratiometric technique: V REF = VIN (max) TINT/TDEINT eq3 where TDEINT is the deintegration time required for a full-scale conversion. INT CAZ BUF IN+ IN– REF+ REF– COM COMP B A CR– CR+ GND OSCOUT LOAD READ DCLK DIN DOUT *CINT CAZ RINT 100k LM285-2.5 Analog Ground .01µ .01u 100k OSCIN COMP B A DV CE GND –5V DGND Crystal CREF TC520TC500A +5V SI VIN+ SO SK RD LD10k DV CE *CINT recommended Polypropylene VIN– FIGURE 2: TC500A and TC520
DS00780A-page 3© 2002 Microchip Technology, Inc. AN780 This application requires 120,000 counts which means that the TC520's overrange bit must be used as the MSB, i.e., 17-bits. A reference voltage with a tempco of 0.3ppm/°C would normally be required for stability over a 30°C range. This could be a prohibitive requirement. Fortunately the strain gauge has an output sensitivity which is directly proportional to the supply voltage applied, V SG = K (V+ – V–)PSG , eq3/a where K is the constant for a particular strain gauge and the dual slope converter produces a result which is inversely proportional to its reference voltage: TDEINT = VIN TINT/VREF By deriving the reference from the supply voltage, any variations will exactly cancel. VREF = RREF x (V+ – V–)/RTOTAL eq3/b –VSG = K PSG (V+– V–) G = –RB/RA VIN = (V+– V–) PSG K G R REF = R2B + R3 R TOTAL = R1 + R2 + R3 + R4 VREF = (V+– V–) RREF /RTOTAL TDEINT =VIN VREF TINT = (V+– V–) PSG K G (V+– V–) RREF/R TOTAL TINT = PSG K G R TOTAL R REF TINT The TC500A has a differential reference input so the reference voltage need not be referenced to ground. Rather than using a precision reference for the TC500A and a precision supply for the strain gauge, combining eq3/a and eq3/b into eq4 produces an equation for the system: T DEINT = K G PSG TINT RTOTAL /RREF eq4 Notice that VIN has been replaced by an expression for the pressure on the strain gauge (PSG ), the strain gage constant (K) and the gain of the amplifier (G). The actual differential reference voltage is determined only by the ratio of resistance values (RTOTAL / R REF ). VIN+ BUF 672 41 3 TC500A VIN– CAZ CINT VREF+ VREF– CREF+ CREF– V– Analog Common VREF Ground –5V .68µ CINT CAZ RINT +5V VIN R2a R2b RA VSG RB Strain Gauge PSG – FIGURE 3: Differential ratiometric reference voltage.
© 2002 Microchip Technology, Inc.DS00780A-page 4 AUTO-ZERO AND REFERENCE CAPACITORS The voltage on these capacitors stay very constant so dielectric absorption is not a consideration. The long integration time does require capacitors with very low leakage. A .68µF polyester capacitor was used in both cases. TC520 TIMING A 200ms integration time is already selected. There are a few options available with the TC520 to do this. The exact crystal (or clock rate) can be select in conjunction with one of the two default timings in the TC520 or, the microprocessor can be used to program the TC520 for the proper timing with some arbitrary crystal frequency. The main constraint is that the TC500A has a comparator delay of about 4µS. Also, the TC520 has a divide-by-4 on the clock input. This means that anything around 1MHz will be acceptable. The TC520 can be programmed by the micro to set the actual integration time to within approximately .5ms. The crystal used in this application is 1.0703MHz. There are 4 clocks/count in the TC520 and the base integration counter is 256 counts. This calculates to a timebase period of 0.9567mS with the crystal being used. The 200mS integration time requires 209 timebase periods. Since the TC520 gives 256 timebase periods, 47 of them need to be taken away. The value can be determined from the equation: f OSC x TINT 1024N = 256 – = 256 –1.0703MHz x 200mS 1024 = 46.957 The micro was programmed to load a "47" (2FH ) into the TC520 at the start of the program. This will cause the TC500A to have an integration time of 199.96mS. This value will give at least 120dB of rejection at 50/60Hz. The TC520 will also use the integration timing for the TC500A's Auto-Zero phase. A 17-bit conversion will require a deintegration time which is a function of the oscillator frequency, i.e., 17 x 4 ÷ fOSC = 490mS.
DS00780A-page 5© 2002 Microchip Technology, Inc. AN780 TC7211AM GND DS1 DS 2C S 1 CS2 B0 B 1B 2 OSC V IN+BUF 911 V IN– C AZ C INT V REF+ V REF C REF+ C REF– AnalogCommon 10 8 .68µ130k 22K 10K 24K 20K 1.0M – + 15K StrainGauge – + 0.1µ MCP606 47µIN+ IN– 33K 33K +5V GND –5V ≈0V15K≈.3V≈.5V 0.1µ0.1µ .68µ.47µ ±5V Power S upply COMP B A DGND 16 14 13 12 15 1 3 4 5 2 V+ COMPB A DGNDOSC IN OSC OUT 1.07MHz DV LOAD D IN D CLK D OUT REA D 13 12 11 10 9 8 11 12 16 14 15 17 18 RC0RC1RC5/SORC3/SKRC4/SIRC6RC1Reset V CC RB7 RB4RB3RB2RB1RB0 28 27 26 25 24 23 22 21 ResetV+ GND B2 B OS C TC7211AMDS1 DS2 CS1 CS 47K GND CK I 18 16 14 12 9 7 5 3 1, 19 8MHz OSC. (HC04) 8, 19 171513118642 47K x 8 8MHz 74HTTC244 PIC16C62A TC520 RB6RB5 TC500A FIGURE 4: Kilogram scale schematic.
© 2002 Microchip Technology, Inc.DS00780A-page 6 REFERENCE VOLTAGE CALCULATION Now that the timing has been determined, eq3 can be used to calculate the reference voltage: VREF =V IN (max) TINT/TDCINT = 1V 200mS/490mS ≈ .408V The reference voltage does not need to be calculated very precise since it will have to be trimmed during calibration. A ±25% adjust- ment range is enough to make up for just about any minor calculation error. MICROPROCESSOR PROGRAMMING The PIC16C62A 8-Bit microcontroller was selected but any reasonable processor/controller will suffice. The PIC16C62A is a 28-pin part that has EPROM programmability. CONCLUSION The scale works extremely well. The 8X oversampling makes it very smooth and noise-free. The response time is within one conversion (≈1/2 sec) for changes of 2 grams or more. Changes of less than 2 grams are accumulated in an integrating register until it gets to either +1 gram or –1 gram. When this happens, the current conversion is allowed to "get through" and a new base is estab- lished in the accumulator. There is also a facility in the programming that allows the raw data to be displayed. These displays show the full 17-bit conversion results. The basic converter noise is as predicted, typically 1 to 2 counts of flicker (16-bit accuracy) with an intermittent jump of about 3 or 4 counts (1/f noise). One count is equivalent to 1/8 gram. The actually 60Hz power line rejection ration of the TC500A was not measured, but judging from the 6 to 8 counts of "rolling noise" before preloading the TC520 with 2F H , it is quite adequate. The effect of the differential ratiometric reference was tested by changing the supply voltage from +4V to +6V. Although there was a 1 – 2 second delay due to unmatched time constants between the reference and the strain gauge, the final readings were exactly the same. This shows that the power supply rejection is better than 100dB. Read Format OUT LOAD DIN MSB DCLK READ DCLK LSBLoad Format OVR POL MSB LSBDOUT FIGURE 5: Serial interface protocol.
DS00780A-page 7© 2002 Microchip Technology, Inc. AN780 Start Read Conversion Results from TC520 Yes Setup Conversion Complete Save Results as Offset Value
15 Times
Delta = This Reading - Saved Reading Delta >
2 Grams
Read Conversion Results from TC520 FIGURE 6: TC520 program flow chart. FIGURE 7: PIC16C62A program flow chart. Power Output A = 0 B = 0 Zero Integrate Comparator Output A = 0 B = 1 LowAuto Zero High Stop Counter Latch Count Overrange Polarity Clear Count Overrrange Start Timer Timer Overflow Yes Output A = 1 B = 0 Start Timer Timer Overflow No No Output A = 1 B = 1 Deintegrate Start Counter Yes Comparator Counter Overflow Set Overrange Bit Low No Yes High Integrate Reset Polarity Bit Comparator Set Polarity Bit LowHigh
DS00780A-page 8 2002 Microchip Technology Inc. NOTES:
2002 Microchip Technology Inc. DS00780A - page 9 Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Microchip’s products as critical com- ponents in life support systems is not authorized except with express written approval by Microchip. No licenses are con- veyed, implicitly or otherwise, under any intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, FilterLab, KEELOQ, microID, MPLAB, PIC, PICmicro, PICMASTER, PIC- START, PRO MATE, SEEVAL and The Embedded Control Solu- tions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. dsPIC, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP , ICEPIC, microPort, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, MXDEV, PICC, PICDEM, PICDEM.net, rfPIC, Select Mode and T otal Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. Serialized Quick Turn Programming (SQTP) is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2002, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received QS-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona in July 1999. The Company’s quality system processes and procedures are QS-9000 compliant for its PICmicro ® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs and microperipheral products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001 certified.
DS00780A-page 10 2002 Microchip Technology Inc. M AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: 480-792-7627 Web Address: http://www.microchip.com Rocky Mountain 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7966 Fax: 480-792-7456 Atlanta
500 Sugar Mill Road, Suite 200B
Atlanta, GA 30350 Tel: 770-640-0034 Fax: 770-640-0307 Boston
2 Lan Drive, Suite 120
Westford, MA 01886 Tel: 978-692-3848 Fax: 978-692-3821 Chicago
333 Pierce Road, Suite 180
Itasca, IL 60143 Tel: 630-285-0071 Fax: 630-285-0075 Dallas
4570 Westgrove Drive, Suite 160
Addison, TX 75001 Tel: 972-818-7423 Fax: 972-818-2924 Detroit Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334 Tel: 248-538-2250 Fax: 248-538-2260 Kokomo 2767 S. Albright Road Kokomo, Indiana 46902 Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles
18201 Von Karman, Suite 1090
Irvine, CA 92612 Tel: 949-263-1888 Fax: 949-263-1338 New York
150 Motor Parkway, Suite 202
Hauppauge, NY 11788 Tel: 631-273-5305 Fax: 631-273-5335 San Jose Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131 Tel: 408-436-7950 Fax: 408-436-7955 Toronto
6285 Northam Drive, Suite 108
Mississauga, Ontario L4V 1X5, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Australia Microchip Technology Australia Pty Ltd Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 China - Beijing Microchip Technology Consulting (Shanghai) Co., Ltd., Beijing Liaison Office Unit 915 Bei Hai Wan T ai Bldg. No. 6 Chaoyangmen Beidajie Beijing, 100027, No. China Tel: 86-10-85282100 Fax: 86-10-85282104 China - Chengdu Microchip Technology Consulting (Shanghai) Co., Ltd., Chengdu Liaison Office Rm. 2401, 24th Floor, Ming Xing Financial Tower No. 88 TIDU Street Chengdu 610016, China Tel: 86-28-6766200 Fax: 86-28-6766599 China - Fuzhou Microchip Technology Consulting (Shanghai) Co., Ltd., Fuzhou Liaison Office Unit 28F, World Trade Plaza No. 71 Wusi Road Fuzhou 350001, China Tel: 86-591-7503506 Fax: 86-591-7503521 China - Shanghai Microchip Technology Consulting (Shanghai) Co., Ltd. Room 701, Bldg. B Far East International Plaza No. 317 Xian Xia Road Shanghai, 200051 Tel: 86-21-6275-5700 Fax: 86-21-6275-5060 China - Shenzhen Microchip Technology Consulting (Shanghai) Co., Ltd., Shenzhen Liaison Office Rm. 1315, 13/F, Shenzhen Kerry Centre, Renminnan Lu Shenzhen 518001, China Tel: 86-755-2350361 Fax: 86-755-2366086 Hong Kong Microchip Technology Hongkong Ltd. Unit 901-6, Tower 2, Metroplaza
223 Hing Fong Road
Kwai Fong, N.T., Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431 India Microchip Technology Inc. India Liaison Office Divyasree Chambers
1 Floor, Wing A (A3/A4)
No. 11, O’Shaugnessey Road Bangalore, 560 025, India Tel: 91-80-2290061 Fax: 91-80-2290062 Japan Microchip Technology Japan K.K. Benex S-1 6F 3-18-20, Shinyokohama Kohoku-Ku, Yokohama-shi Kanagawa, 222-0033, Japan Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Korea Microchip Technology Korea 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku Seoul, Korea 135-882 Tel: 82-2-554-7200 Fax: 82-2-558-5934 Singapore Microchip Technology Singapore Pte Ltd.
200 Middle Road
#07-02 Prime Centre Singapore, 188980 Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan Microchip Technology Taiwan 11F-3, No. 207 Tung Hua North Road Taipei, 105, Taiwan Tel: 886-2-2717-7175 Fax: 886-2-2545-0139 EUROPE Denmark Microchip Technology Nordic ApS Regus Business Centre Lautrup hoj 1-3 Ballerup DK-2750 Denmark Tel: 45 4420 9895 Fax: 45 4420 9910 France Microchip Technology SARL Parc d’Activite du Moulin de Massy
43 Rue du Saule Trapu
91300 Massy, France
D-81739 Munich, Germany Tel: 49-89-627-144 0 Fax: 49-89-627-144-44 Italy Microchip Technology SRL Centro Direzionale Colleoni Palazzo Taurus 1 V. Le Colleoni 1
20041 Agrate Brianza
Milan, Italy Tel: 39-039-65791-1 Fax: 39-039-6899883 United Kingdom Arizona Microchip Technology Ltd.
505 Eskdale Road
Berkshire, England RG41 5TU Tel: 44 118 921 5869 Fax: 44-118 921-5820 03/01/02 DS00780A WORLDWIDE SALES AND SERVICE