How to make analog measurement if there is only one GPIO on FPGA

How to make analog measurement if there is only one GPIO on FPGA

Today, many modern Electronic devices require an on-board temperature monitoring system. The method of converting an analog signal into a pulse width modulation signal or a digital signal has been documented in a large number of documents. However, if the measurement solution requires an ADC, there are some disadvantages related to cost, accuracy, and speed. Generally, the more accurate the measurement, the more expensive the solution. This circuit provides a low-cost and easy-to-connect universal solution, the accuracy of which can be changed according to the needs of the temperature measurement system.

Q:

If there is only one GPIO left on the FPGA/microprocessor in the system, how to perform analog measurement?

A:

A Voltage-frequency converter can be used instead of the analog-to-digital converter.

However, the development of ASICs is time-consuming and expensive, and does not have the flexibility to meet other uses. Therefore, more and more applications are using microprocessors or small-sized FPGAs to complete product development on time, cost-effectively and efficiently. In this article, we will explore a temperature-frequency converter that only needs to use a GPIO pin to provide accurate temperature results. This article will also demonstrate how to use voltage-frequency converters for various detection applications.

motivation

Some sensor measurements (such as temperature, humidity, and air pressure) are essentially direct current, and their rate of change is not fast enough (and they don’t need precise enough resolution) enough to meet the requirements of the ADC and the design considerations associated with it. Most ADCs require fast and accurate clock generation and timing, stable reference voltages, reference buffers with very low output impedance, and analog front-end circuits in order to properly condition the sensor output before it can be digitally quantized and passed The system is monitored. When detecting the ambient temperature, discrete applications may use a thermistor in the Wheatstone bridge, and then get its output by the instrumentation amplifier, and then feed it into the ADC. This design is an over-design, requiring more space, power, and calculation cycles than the application requires, and the application itself may only need to perform a measurement every 15 seconds.

LTC6990

Fixed frequency or voltage controlled operation

– Fixed: A single resistor is responsible for setting the frequency (maximum error <1.5%)
– VCO: Two resistors are responsible for setting the VCO center frequency and tuning range
Frequency range: 488Hz to 2MHz
2.25V to 5.5V single supply operation
72μA supply current (at 100kHz)
500μs start-up time
VCO bandwidth> 300kHz (at 1MHz)
CMOS logic output can supply/absorb 20mA
50% duty cycle square wave output
Output enable (low or high impedance state can be selected when disabled)
-55ºC to 125ºC operating temperature range
Available in low profile (only 1mm height) SOT-23 (ThinSOTTM) package and 2mm x 3mm DFN package

Can an alternative measurement solution be designed that can reduce the number and complexity of components related to the ADC signal chain while also measuring analog voltage? The solution is to use a voltage-frequency converter (such as LTC6990, configure it as a voltage-controlled oscillator (VCO) mode, so that it can be used to measure analog voltage without the need for ADC. In this example, the precision thermocouple The AD8494 amplifier is configured as an ambient temperature sensor, and its output voltage is used as the input of the LTC6990 to generate a temperature-frequency converter signal chain.

How to make analog measurement if there is only one GPIO on FPGA
Figure 1. Simple temperature-frequency converter.

How to convert temperature input to frequency output?

Today, many modern electronic devices require an on-board temperature monitoring system. The method of converting an analog signal into a pulse width modulation signal or a digital signal has been documented in a large number of documents. However, if the measurement solution requires an ADC, there are some disadvantages related to cost, accuracy, and speed. Generally, the more accurate the measurement, the more expensive the solution. This circuit provides a low-cost and easy-to-connect universal solution, the accuracy of which can be changed according to the needs of the temperature measurement system.

AD8494 is a thermocouple precision amplifier, but it can also be used as an ambient temperature sensor by short-circuiting its input to ground. The output is defined as:

How to make analog measurement if there is only one GPIO on FPGA

In a circuit that uses a unipolar power supply, CVS=ground voltage (0 V), and an offset voltage must be applied to the REF pin of AD8494, so that the output voltage is biased higher than the ground voltage, even when the ambient temperature is negative is also like this.

The output voltage VOUT of the temperature sensor is defined as:

How to make analog measurement if there is only one GPIO on FPGA

In VCO mode, the frequency output of LTC6990 is defined as:

How to make analog measurement if there is only one GPIO on FPGA

Since the output voltage of AD8494 is the VCTRL of LTC6990, formula 1 can be used to replace VCTRL in formula 2. Setting RSET = RVCO will get the following results:

How to make analog measurement if there is only one GPIO on FPGA

In this way, Tambient can be solved to eliminate the voltage unit, so formula 5 is obtained:

How to make analog measurement if there is only one GPIO on FPGA

What’s the use of getting the frequency output?

The beauty of frequency output is that a single GPIO pin can be used for sensor measurements. If you use the synchronous counter circuit shown in Figure 3, the rising edge of the clock will always be observed at its CLK_IN input. If LTC6990’s FOUT is used as the input clock, the counter will increment each time the rising edge of FOUT is detected, creating a cycle counter. If the time interval between each measurement remains constant, the number of cycles within a given time interval can be counted, and the frequency can be calculated by floating-point arithmetic or a look-up table. Divide the acquisition time TAcquisition n by the number of cycles counted to get the cycle of FOUT. Taking the reciprocal of this relational expression yields formula 6.

How to make analog measurement if there is only one GPIO on FPGA
Figure 2. A 4-bit synchronous counter with the LTC6990 output as its clock input.

How to make analog measurement if there is only one GPIO on FPGA

The Verilog code example shows a function that counts the number of cycles by using a single GPIO input on the FPGA. The longer the acquisition period, the more accurate the measurement result. In the following code example, a 16-bit counter is used to increase the resolution. It is also assumed that the acquisition time measurement control logic is executed at a higher level of the architecture.

How to make analog measurement if there is only one GPIO on FPGA
Figure 3. Verilog code example.

in conclusion

In this application, we discussed a new type of temperature-frequency converter. It provides a low-cost method of accurately measuring temperature. If the temperature exceeds the industrial temperature range of C40°C to +125°C, a thermocouple can be installed at the input of the sensor. The following figure summarizes the errors of the measurement system. It illustrates the linear relationship between ambient temperature and output frequency and system accuracy. Although this solution may not provide very good temperature resolution results, it provides an economical and simple temperature measurement interface for applications that can accept an error of approximately ±2°C. In addition, the concept of using a voltage-frequency converter can also be used to measure the output of other types of sensors without the need for an ADC.

The Links:   G150XG03-V4 LM4Q30TA

micohuang