Page 219

April 23, 2018 | Author: boppanamuralikrishna | Category: Field Programmable Gate Array, Analog To Digital Converter, Microcontroller, Sensor, Analogue Electronics
Share Embed Donate


Short Description

Download Page 219...

Description

International Scientific Conference Comput er Science’2008 Science’2008

Precise Temperatur Temperatur e Measurement Measurement and Data Processing Process ing with wit h Xilin x Spartan-3E Starter Kit Daniel Daniel Hadji, Valentin S. Moll Moll ov Dept. of Computer Science, Technical University of Sofia, Sofia, Bulgaria  Ab st rac t: Temperature is among the most frequently measured analogue analogue parameters. This might be expected since most electrical, chemical, mechanical, and environmental systems are strongly affected by the temperature directly or use its value to control other relevant processes. Intuitively, temperature is a measure of how hot or cold something is, although the most immediate way in which we can measure this, by feeling it, is unreliable, resulting in the phenomenon of felt air temperature, which can differ at varying degrees from actual temperature. Here we present a prototyped design of an engineering system for precise measurement measurement of temperature based on Xilinx Spartan 3E developing kit. Keywords: measurement, Keywords: measurement, FPGA design, microprocessor, ADC, data processing

1. INTRODUCTION. DESIGN DESIGN FLOW Today, almost every VLSI design team applies programmable logic devices [1] to facilitate the overall design process and to minimize the final cost. Fast reconfigurable logic together with high rate analog-to-digital converter (ADC) opens this area for digital data processing and control. The on-site data processing in FPGA-based systems minimizes the risk of faulty transmission of analog measured data [2]. The design performed here uses Xilinx Spartan-3E Starter Kit board [3] and the provided on-board devices: Linear Technology LTC1407A-1 dual channel analog-todigital converter (ADC), LTC6912-1 dual-channel programmable amplifier, and a 2lines/16-characters liquid crystal display (LCD). As a sensing device we choose National Semiconductor LM94021 multi-gain analogue temperature sensor. The design applies embedded PicoBlaze 8-bit microcontoller [4] implemented on Spartan-3E FPGA for data processing, control and storage, as well as the on-board available LCD display for results visualization. Fig.1 presents the design flow of the reported measurement system. The main system resources are also shortly described there with its main features and parameters. LM94021  Analo Tem erature Sensor

LTC6912-1 dual channel programmable am lifier  Channel Channel A VINA onl

PicoBlaze embedded microcontroller

• • •

Read A/D converter value Compute VINA input value. Calculate the temperature corresponding to the VINA input value

LTC1407A-1 14bi 14bitt Analo Analo ue to Di ital ital con conve vert rter  er 



Liquid crystal display (LCD)

Fig. 1: System design flow and resources

219

International Scientific Conference Comput er Sci ence’2008

 An extended presentation of the FPGA-based measurement system is presented in Fig.2. There, all important application specific details concerning the design resources are shown.

Fig 2: Detailed block diagram of the system

2. DESCRIPTION OF THE SYSTEM RESOURCES 2.1. Temperature Sensor For this application we choose LM94021 CMOS multi gain temperature sensor from National Semiconductor [5]. It has an analog output that operates at supply voltage as low as 1.5V while operating over a wide temperature range from −50°C to +150°C. The sensor delivers an output voltage that is inversely proportional to the measured temperature. The sensor’s low voltage supply capability makes it an ideal solution for battery-powered systems as well as for general sensing applications. The two logic inputs: GS1 and GS0 select the gain of the temperature-to-voltage output transfer function. Four slopes are selectable: −5.5 mV/°C, −8.2 mV/°C, −10.9 mV/°C, and −13.6 mV/°C. For our application we use GS1=0 GS0=1 in accordance with the onboard supply voltage of 3.3V – Fig.3.

220

International Scientific Conference Comput er Science’2008

Fig 3: LM94021 performance specifications

2.2. Analog-to-digital converter The analog capture circuit (Fig.4) consists of a Linear Technology low noise, digitally programmable gain pre-amplifier LTC6912-1 that scales the incoming analog signal from the sensor output with a gain fixed to -1, followed by LTC1407A-1 analog-to-digital converter. Both the pre-amplifier and the ADC are serially controlled by the FPGA.

Fig 4: Detailed view of analog capture circuit

The LTC1407A-1 is a 14-bit, 3Msps ADC with two 1.5Msps simultaneously sampled differential inputs, suitable for high speed, portable applications. The analog capture circuit converts the analog voltage on VINA or VINB and transform it to a 14-bit digital code D[13:0], as expressed by the eq.1:

221

International Scientific Conference Comput er Sci ence’2008

(1)

⎛ (VIN  – 1.65V) ⎞ ⎟ × 8192 ⎝  1.25V  ⎠

D[13 : 0] =  GAIN  × ⎜

The pre-amplifier reference voltage shown by the manufacturer is 1.65V. The laboratory measurements reveal a value close to 1.666V at the output of the voltage divider - Fig.4. So, we subtract a value of 1.666V instead of 1.65V to get the proper digital code from eq.1. 2.3. PicoBl aze embedded mic roco ntr oll er The main processing unit for this design is the PicoBlaze soft processor implemented onboard over Xilinx XC3S500E Spartan-3E Field Programmable Gate  Array (FPGA). The FPGA XC3S500E has over 10,000 logic cells and 320-pin package. The PicoBlaze microcontroller is a compact and cost-effective fully embedded 8-bit RISC microcontroller core optimized for the Spartan-3, Virtex-II, and Virtex-II Pro FPGA families. It occupies just 96 FPGA slices. The core (Fig.5) is totally embedded within the target FPGA and requires no external resources. It has the following main features: 16 byte-wide general-purpose data registers; 1K instructions of programmable on-chip program store, automatically loaded during FPGA configuration; byte-wide Arithmetic Logic Unit (ALU) with CARRY  and ZERO indicator flags; 64-byte internal scratchpad RAM; 256 input and 256 output ports for easy expansion and enhancement; automatic 31-location CALL/RETURN stack; predictable performance, 2-clock cycles/instruction; fast interrupt response; worst-case 5 clock cycles.

Fig 5: PicoBlaze embedded microcontroller block diagram

The software control for this application is performed by assembler program which controls all onboard devices, as well as reads the digital value from the ADC and convert it to the corresponding digital value, according to the sensor specifications. 2.4. Liquid crystal display The board features a 2-lines x 16-characters liquid crystal display (LCD). The FPGA controls the LCD via the 4-bit data interface. Compared to the 50 MHz on board clock available, the display is relatively slow. The PicoBlaze efficiently controls display timing plus the actual content of the display. 222

International Scientific Conference Comput er Science’2008

3. MEASUREMENT AND RESULTS We perform 1-day continued measurement to get the results presented on the chart in Fig.6. There, the results derived with our system is compared with these, simultaneously obtained using a sample Agilent 34401A digital multimeter. The average comparative error for both measurement devices is quite low: approx. 0.026[%] with a maximum value of 0.091[%], so we can consider our system very accurate (maximum diversion -/+1 mV).

Fig 6: Comparison between the data measured with the Agilient multimeter and Picoblaze-based system

 After proper reading the analog values, we are able to convert these values to usable temperature reading using two methods: LUT (lookup table) or formula. By using the formula these values are computed further to calculate the temperature for the corresponding points. This is done by modifying sensor’s manufacturer formula:

⎛  V  – V1 ⎞ ⎟⎟ × (T - T1 ) , V - V1 = ⎜⎜ 2 − T T ⎝  2 1  ⎠

(2)

where V is in mV and T is in °C. T 1 and V1  are the coordinates of the lowest temperature, T2 and V2 are the coordinates of the highest temperature. In our case we discuss a temperature range from -50 to +125, and the coordinate from the transfer table for GS=01 is 1955mV for -50°C and 521mV for +125°C. So we derive the following: (3)

⎛ 521 – 1955 ⎞ ⎟⎟ × (T - (- 50)) ⎝ 125 − (- 50) ⎠

V - 1955 = ⎜⎜



V - 1955 = (- 8.194 )× (T + 50) .

 As we need to calculate the temperature from the voltage value, the above formula should be rewrite as: ⎛  V – 1955 ⎞ ⎛  V – 1545.3 ⎞ T=⎜ (4) ⎟ - 50 or T = ⎜ ⎟ ⎝  - 8.194  ⎠ ⎝  - 8.194  ⎠

223

International Scientific Conference Comput er Sci ence’2008

Fig.7 shows the temperature values over the 1-day measurements calculated using eq.4.

Fig 7: Temperature vs. corresponding voltage over 1-day measurement trial

4.

CONCLUSIONS

The FPGA-based prototype measurement system presented above shows a very good accuracy, quite simple and cost-effective structure. As it is obvious, the presented design serves as a sample one for a wide range of application aimed to capture various analog data. Using PicoBlaze embedded core, we have a very reliable programmable data processing tool, easy extendable to perform other useful function as calibration, data storage, switching between several sensors, etc. Apart from inclusion other functionality, the basic design described here uses minimum chip resources. 5. REFERENCES [1] Pong P. Chu ( 2008), FPGA Prototyping by VHDL Examples: Xilinx Spartan-3 Version. Wiley-Interscience (February 4, 2008). [2] Losansky J., Rentzsch M., Guldner, H. Intelligent measurement and control platform using Spartan3 FPGA, European Conf.on Power Electronics and  Appl.,2005, pp.1-5. [3] Xilinx UG230 (v1.0). Mar., 2006. Spartan-3E Starter Kit Board User Guide. [4] Xilinx UG129 (v1.1.1). Nov., 2005. PicoBlaze 8-bit Embedded Microcontroller User’s Guide. [5] http://www.national.com/pf/LM/LM94021.html - Multi-Gain Temperature Sensor.

224

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF