| Electronic Components Datasheet Search |
|
AN897 Datasheet(PDF) 3 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN897 Datasheet(HTML) 3 Page - Microchip Technology |
|
3 / 16 page ![]() 2004 Microchip Technology Inc. DS00897B-page 3 AN897 FIGURE 6: ADC’s Temperature Resolution. FIGURE 7: Analog Circuit Errors. Digital Design The PIC16F684 microcontroller (discussed in Appendix A.2.5 “Signal Analysis PICtail Daughter Board”) handles several important tasks. It communi- cates with the PGA to set its input channel, can aver- age the measured signal to reduce noise and converts the result into the temperature at the thermistor using a piece-wise linear interpolation table. The microcontrol- ler can either have a SPI™ port built in or the SPI interface can be implemented in software on the microcontroller [7]. FLOWCHART The flowchart in Figure 8 shows the program flow for the first design. The firmware is available in 00897.zip file in the Design 1 directory. The firmware was written in relocatable assembly code. main.asm controls the overall program flow. The PGA routines are in pga.inc and pga.asm. The thermistor routines are located in Therm_PGA1.inc and Therm_PGA1.asm . The Signal Analysis PC Program commands the PIC16F684 firmware to perform a real-time sample. The firmware reads the ADC value and passes it to the Piece-wise Linear Interpolation (PwLI) routine. The PwLI routine converts the 10-bit ADC value into a 16-bit fixed decimal point degrees Celsius value. The fixed decimal point format reports degrees Celsius in tenths of a degree. Performing the piece-wise linear interpola- tion in tenths of a degree provides better resolution of degrees Celsius. Finally, the 16-bit degrees Celsius value is sent to the Signal Analysis PC Program for display on the real-time strip chart graph. In the final design, the designer can elect to report in tenths of a degree or round up in whole degrees. FIGURE 8: Flowchart for First Design. PIECE-WISE LINEAR INTERPOLATION TABLE A piece-wise linear interpolation table [9] is used to convert ADC codes to estimated temperature. The ADC’s codes were divided into 64 segments, with 16 codes per segment. The codes in the table are at end points between segments. Table 1 shows the end points chosen for this design. TABLE 1: INTERPOLATION TABLE END POINTS. Values given for RTH, when the temperature is outside the thermistor’s specified range (-40°C to +150°C), are estimates only; they are not supported by actual data. The thermistor self-heating error correction has been included in Table 1. The table’s entries go outside of the -40°C to +150°C range to ensure proper functioning of the piece-wise linear interpolation table when the reading overflows. In this algorithm (Appendix A.2.6 “Firmware for the Signal Analysis PICtail Daughter Board”), the table values outside the valid range take on the nearest valid value. This means that when ADC code > 1008, the table returns a value of -49.3°C. When ADC code < 16, the table returns a value of 156.1°C. -2.5 -2.0 -1.5 -1.0 -0.5 0.0 -50 -25 0 25 50 75 100 125 150 Thermistor Temperature (°C) 10-bit ADC DC Error ≤ 3.5 LSb Design # 1 G = +1 RA = 10 kΩ 0 1 2 3 4 5 6 7 8 9 10 -50 -25 0 25 50 75 100 125 150 Thermistor Temperature (°C) ADC Error RA Error PGA Error Design # 1 G = +1 RA = 10 k Gain (V/V) ADC Code (LSb) TTH (°C) RTH ( Ω) VOUT (V) 1 1008 -49.4 630 k 4.922 16 156.1 159 0.078 Start Read ADC Perform PwLI Send Temperature in °C to Strip Chart End Get Real Time Sample |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |