Share this

Design of I/F converter based on ADuC847

2026-04-06 05:57:36 · · #1

Abstract: An I/F converter, or current-to-frequency converter, is a device that converts an input current signal into an output frequency signal according to a fixed linear ratio. This paper, considering the limitations of analog I/F converters in terms of conversion accuracy, designs an I/F converter based on the ADuC847. The design conditions the input bipolar current signal into a unipolar analog voltage signal, which is then converted into a unipolar digital signal by the ADuC847's integrated 24-bit Σ-Δ analog-to-digital converter. The filtered and zeroed bipolar digital signal is used to calculate the linear scaling factor to obtain the output frequency value, which is output by the PWM0 function of the ADuC847 microcontroller.

Keywords: ADuC847; I/F converter; digital sliding filter algorithm; frequency synthesis algorithm

The design of the current-frequency converter based on the ADuC847

Yu Lei, Wang Yanping

(Qingdao University of Science and Technology College of Automation and Electronic Engineering, Qingdao 266042)

Abstract: I/F converter - the current frequency converter, is the equipment or device of putting an input current signal to convert the output frequency signal with a fixed linear proportional relationship. In view of the limit of the analog I/F converter in conversion accuracy, we design the I/F converter based on the ADuC847.First, we convert the bipolar current input signal into a unipolar analog voltage signal ,and ADuC847 chip with integrates 24 sigma-delta analog-to-digital converts the voltage signal into a unipolar digital signal. After digital signal filtering and zeroing, we get the bipolar output frequency value by calculating the coefficient of linear proportion, and the frequency signal output from the PWM0 of the ADuC847 microcontroller.

Key words: ADuC847; current-frequency converter; Digital slide filtering algorithm; Frequency synthesis algorithm

An I/F converter, or current-frequency converter, is a device that converts an input current signal into an output frequency signal in a linear proportional relationship. It is widely used in aerospace, remote sensing, long-distance data acquisition and communication [1] , industrial fields, and military fields. In particular, the military field has high requirements for the conversion accuracy of I/F converters. In the past, I/F converters were mainly based on analog circuits. Due to the influence of various noise and temperature drift of analog circuits, the improvement of conversion accuracy was limited. Even with compensation methods [2] , the conversion accuracy was only six or seven ten-thousandths. With the development of digital circuit technology, dedicated integrated current-frequency conversion chips have been developed abroad. This paper addresses the shortcomings of analog I/F converters in terms of conversion accuracy by designing an I/F converter based on the ADuC847 microcontroller. This I/F converter mostly uses integrated devices and implements the I/F conversion function through software.

1 Hardware Design of I/F Converter

1.1 System Design Overall Block Diagram

The converter consists of four parts: a current input and conditioning circuit, an ADuC847 main control circuit, a PWM frequency output circuit, and a power supply circuit. The overall block diagram is shown in Figure 1.

Figure 1 Overall block diagram of the I/F converter

Fig.1 Overall block diagram of current-frequency converter

1.2 System Working Principle

The design goal of this design is to output a frequency signal of -100kHz to +100kHz when the input current signal is -60mA to +60mA. The performance requirements are a conversion accuracy of less than 0.05%, a relatively stable output frequency, and the ability of the output frequency signal to track the input current signal quickly.

1.2.1 Current Input and Conditioning Circuit

The input current (-60mA~60mA) flows through precision resistors (R1 and R2) and is converted into an analog voltage signal (-6V~+6V). This analog voltage signal is bipolar, and AD8275 can convert this bipolar voltage signal into a unipolar voltage signal Vout (0.05~2.45V). The integrating circuit composed of R3 and C1 acts as a low-pass filter. The circuit schematic of the current input and conditioning circuit is shown in Figure 2, and Figure 3 shows the internal circuit structure of AD8275 [3] .

Figure 2 Current input and conditioning circuit

Fig.2 Current input and conditioning circuit

Figure 3 Internal structure of AD8275

Fig.3 The internal structure of AD8275

The relationship between the input current and the unipolar analog voltage Vout can be calculated from Figures 2 and 3:

Vout = 20 * Iin + 0.5 * Vref_2.5V = 20 * Iin + 1.25 (1)

When the input current is -60mA to +60mA, the output Vout of the AD8275 is 0.05V to 2.45V. When the input current is 0mA, Vout = 1.25V.

1.2.2 ADuC847 Main Control Circuit

The ADuC847 is a high-performance 8052 core microcontroller from Analog Devices (ADI) [4] . This microcontroller integrates a high-performance, low-drift 10-channel unipolar or 5-channel bipolar 24-bit Σ-Δ analog-to-digital converter, three 16-bit timer/counters, and two 16-channel PWM modules. The ADuC847 also has up to 62KB of on-chip Flash program memory and 2304 bytes of on-chip data RAM. The large memory capacity provides a guarantee for the algorithm implementation of the I/F converter.

The ADuC847 main control circuit primarily performs AD conversion on the analog voltage V_IN, converting the unipolar analog voltage signal V_IN (0.05V~2.45V) into a 24-bit unipolar digital value. It also filters and zeros the sampled V_IN digital signal, ensuring reliable and stable digital signal processing. The linear proportional coefficient K is calculated to set the PWM0 output frequency signal of the ADuC847. Figure 4 only shows the parts relevant to this design.

Figure 4. ADuC847 related circuit connections

Fig.4 Relevant circuit connection of ADuC847

1.2.3 PWM Frequency Output Circuit

The frequency signal is output from the PWM0 pin, T0 acts as a counter, and /INT0, or SIGN, reflects the frequency output channel. The 74LS00 consists of four 2-input NAND gates. As shown in Figure 5, when SIGN = 1 (high level), Fout- is always high, while Fout+ outputs the frequency, i.e., the positive channel; when SIGN = 0 (low level), Fout+ is always high, while Fout- outputs the frequency, i.e., the negative channel, thus achieving bipolar frequency output.

Figure 6 PWM frequency output circuit

Fig.6 PWM frequency output circuit

1.2.4 Power Supply Circuit

An external DC input of +5V (IN) power supply is used. This power supply powers the AD8275, ADuC847, and 74LS00 chips, as well as the ADR421, to generate a low-drift +2.5V reference voltage, i.e., Vref_2.5V. Note that a 0.1uF capacitor should be connected between each pair of power and ground pins on each chip for power filtering.

Figure 7 Power supply circuit

Fig. 7 Power supply circuit

2 Software Design of I/F Converter

The software design includes an initialization module, an AD acquisition and digital filtering module, a frequency calculation module, and a digital frequency synthesis module.

2.1 Initialization Module

The initialization module includes the initialization of the ADC, T0, TIC, and PWM0 and PWM1. The ADC adopts unipolar mode, with on-chip PGA = 1, i.e., the range of 0 to 2.56V, and SF = 82, which has 50Hz and 60Hz notch filtering function [5] . The sampling frequency is set to 16.65Hz. T0 is initialized to 16-bit counter mode, TIC is initialized to 1/16s time interval timer mode, and PWM0 and PWM1 are initialized to mode 1, variable duty cycle mode.

2.2 AD Acquisition and Digital Filtering Module

This design converts a bipolar analog current signal into a unipolar analog voltage signal, which is then converted into a digital value via an analog-to-digital converter (AD). Since the AD conversion uses unipolar mode, the AD value needs to be zeroed out. That is, when the input current is 0mA, the obtained AD sample value is ZERO_OFFSET. During calculations, the sampled AD value needs to be subtracted from ZERO_OFFSET to maintain the bipolarity of the AD sample value. A stable ZERO_OFFSET can be obtained through filtering.

In order to obtain stable AD sampling values, digital filtering is required on the sampling values. This design adopts the digital moving average filtering algorithm [6] . The so-called digital moving average filtering is to average the new sampling value with the past N-1 sampling values. Each time a new data is collected, it is stored in the temporary storage area, and the oldest data is removed to keep the N data always the latest data. This design defines N+1 storage spaces. The new sampling value is stored in the i%(N+1)th space. Each sampling adds the new sampling value and subtracts the sampling value in the (i+1)%(N+1)th storage space. The sum is divided by N to get the average value, which is the filtered value.

2.3 Frequency Calculation

Calculation of the linear proportional coefficient K: When the input current is 0mA, the AD sampling value is 0 (reset to zero); when the input current is 60mA, the AD sampling value is AD_60mA.

K = 100000/(AD_60mA – 0) = 100000/AD_60mA

Output frequency Fout = ADC_Value * K;

2.4 Digital Frequency Synthesis

The calculated output frequency Fout is set. If Fout>=0, then SIGN = 1, and the frequency is output from Fout+; if Fout < 0, then SIGN = 0, and the frequency is output from Fout-.

Since T0 is a 16-bit counter with a maximum count value of 65536, outputting a frequency of 100kHz requires at least two counts. This design uses a 1/16s count method, i.e., 16 counts. The algorithm is described as follows:

The calculated output frequency Fout is divided by 16 and rounded down to Fre, with the precise value Fre_P. PWM0 sends Fre pulses every 1/16 second, and T0 counts. When the count value of T0 reaches Fre, PWM0 stops, and a correction value is calculated. Because Fre pulses are sent every 1/16 second, Fre_P – Fre pulses are sent less than 1. When the count accumulates to 1 pulse, Fre is incremented by 1, thus allowing for precise control of the number of output pulses.

2.5 System Software Design Flowchart

The program takes 1/16s to execute one loop. During this 1/16s time, the microcontroller needs to acquire AD values, perform filtering and normalization processing, and calculate the output frequency value and the pulse value and its precision value required for each loop. When the T0 count value reaches Fre, the PWM is stopped, the correction value is calculated, and then the 1/16s time is waited for to start a new loop. The filter order is set to 16, so that the output pulse can track the changes in input current relatively quickly.

Figure 8 System software flowchart

Fig.8 System software flow chart

3. Experimental Test Results

Based on the formula for calculating the nonlinearity of an analog I/F converter, the nonlinearity of the I/F converter was calculated through testing, as shown in the table below:

Table 1. Conversion accuracy test calculation data of I/F converter

Tab.1 Conversion accuracy test data of I/F converter

4. Conclusion

The filtering algorithm used in this design can meet the conversion accuracy requirements. However, when the output frequency is increased, the corresponding scaling factor K will increase, meaning that the AD value corresponding to 1Hz will decrease. Therefore, a better digital filtering algorithm is needed to ensure that the conversion accuracy meets the requirements. The key task in the future is to design a better digital filtering algorithm to improve the output frequency.

References:

[1] Zhang Yawei, Zhang Zhiwen. Research on a high-precision I/F converter [J]. Life Science Instruments, 2009, 7(12): 52-54.

[2] Zhao Tong, Jiang Jianwei, Yu Xiaojiao, Zhai Yawei. Compensation of a class of current-frequency conversion chips [J]. Journal of Qingdao University of Science and Technology (Natural Science Edition), 2012, 33(1):93-98.

[3] Analog Devices.G=0.2,Level Translation 16-Bit ADC Driver AD8275 DataSheet Rev.0[M]. America:Analog Devices,2008.

[4] Li Gang, Lin Ling, He Feng. ADuC845 Microcontroller Principle Development Methods and Application Examples [M]. Beijing: Electronic Industry Press, 2006: 20-65.

[5] Analog Devices.MicroConverter Multichannel24-/16-Bit ADCs with Embedded 62 kBFlash and Single-Cycle MCUADuC845/ADuC847/ADuC848 DataSheet Rev.B[M].America: Analog Devices, 2005.

[6] Zhao Yi. Moving average method and low-pass filtering method for digital filtering [J]. Instrumentation Technology, 2001(5):40-46.

Read next

CATDOLL Nanako 109CM TPE (Soft Silicone Head with Pale Tone)

Height: 109cm Weight: 15.6kg Shoulder Width: 26cm Bust/Waist/Hip: 52/50/57cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22