1 Introduction
With the application and development of modern electronic technology, more and more electronic applications are changing from
Field Programmable Gate Array (FPGA) is a programmable logic device developed in the mid-1980s based on PAL, GAL and other logic devices. It is characterized by high integration, high speed and high reliability, and designers can modify the logic function of the device on site. VHDL (VHSIC Hardvcare Description Language) is one of the common hardware description languages currently used to describe the input, output, and mutual behavior and function of a digital circuit.
The high integration and high speed of FPGA make it more suitable for sampling control of high-speed A/D devices than single-chip microcomputers and microcontrollers. This paper designs a controller of high-speed serial input/output A/D converter based on FPGA, which completes the sampling control of ADS7844 chip, improves the real-time performance of sampling and reduces the operating burden of the main CPU.
2 ADS7844 Function Introduction
ADS7844 is a high-performance, wide-voltage, low-power 12-bit serial digital-to-analog converter launched by Burr_Brown. It has 8 analog inputs and can be programmed as an 8-channel single-ended input A/D converter or a 4-channel differential input A/D converter by software. Its conversion rate is up to 200 kHz, and the maximum linear error and differential error are only ±1 LSB. ADS7844 can work normally with a power supply voltage between 2.7 and 5 V, with a maximum operating current of 1 mA and a power consumption of only 3 μA after entering the low-power state. ADS7844 communicates with the CPU through a 6-wire serial interface, and the interface is simple and convenient.
2.1 Pin Functions of ADS7844
CH0~CH7: analog input terminals. When the device is set to single-ended input, these pins can be connected to the signal ground to form an 8-channel single-ended input A/D converter. When the device is set to differential input, CH0-CH1, CH2-CH3, CH4-CH5, and CH6-CH7 can form a 4-channel differential input A/D converter.
COM: signal ground;
Vref: reference voltage input terminal, the maximum value is the power supply voltage;
CS: Chip select terminal, low level is valid, when this pin is high level, other digital interfaces are in three states;
Dclk: external clock input terminal. Under the action of the clock, the CPU writes the control word into ADS7844 and reads the conversion result from it;
Din: Serial data input terminal. When chip select is valid, the control word is locked into ADS7844 bit by bit on the rising edge of Dclk.
Dout: Serial data output terminal. When the chip select is valid, the conversion result is shifted out of ADS7844 bit by bit starting from the falling edge of DcIk.
BUSY: The "busy" signal output terminal becomes low after receiving the first bit of the control word. This pin outputs a high pulse only when the conversion is completed and the chip select is valid.
SHDN: Power off terminal, low level is valid. When SHDN is low level, ADS7844 enters low power consumption state;
Vcc, GND: power supply and digital ground respectively.
2.2 ADS7844 control word and conversion timing
The control word of ADS7844 is described in Table 1.
The control word of ADS7844 has 8 bits, of which S is the start bit, and the start bit of the control word is always "1". A2~A0 are channel selection bits, corresponding to 8 channels in single-ended input, and for differential input, 000~011 correspond to CH0-CH1, CH2-CH3, CH4-CH5, CH6-CH7, and 100~111 correspond to CH0-CH1, CH1-CH0, CH3-CH2, CH5-CH4, CH7-CH6. Bit3 is not defined. SGL/DIF is the mode control bit. When this bit is "1", it is single-ended input mode, and when it is "0", it is differential input mode. PD1 and PD0 are power-off mode control bits. If it is "00", it means that ADS7844 automatically enters power-off mode when no data conversion is performed. If it is "11", the chip is always in power-on mode.
ADS7844 has multiple conversion timings, and the basic timing is shown in Figure 1.
As can be seen from Figure 1, a conversion cycle requires 24 clock cycles, 8 of which are used to input the control word and 16 are used to read the conversion result. All bits of the control word are locked into the chip at the rising edge of the clock, and the conversion result is shifted out one by one at the falling edge of the clock. All data shifted in and out are high-bit first and low-bit last. It should be noted that ADS7844 is a 12-bit A/D converter, and its conversion result is only 12 bits. Therefore, after shifting out the 12-bit result, 4 clocks must be sent in to complete the entire conversion process. The data shifted out by these 4 extra clocks is "0" and should not be treated as a conversion result when used. [page]
3 Design of ADS7844 controller
The interface circuit between the sampling controller AD_CONTROLLER designed with FPGA and ADS7844 is shown in Figure 2, and the basic timing is as described above.
The input clock of AD_CONTROLLER is 12 MHz, which is divided by 4 internally and output to the CLK pin of ADS7844. cs_all is the start signal from the CPU. When it is low, AD_CONTROLLER starts working. addr[3..0] is the corresponding channel address of ADS7844, and data[15..0] is the A/D conversion result of the channel corresponding to a certain address. When the conversion of a certain channel is completed, the oe signal changes from low level to high level and lasts for 1 cycle.
AD_CONTROLLER is mainly composed of frequency division module (fq), A/D conversion cycle forming module (fq_cs); A/D
Take the FPGA operating frequency of 10 MHz, divide it by 4 to get 2.5 MHz as the clock of the A/D converter. The divider is usually implemented by a counter, which has been described in detail in various VHDL textbooks and will not be repeated here. The signal cs sends a high-level pulse of 1 clk1 cycle every 28 clk1 clock cycles and converts once
The circuit consists of a counter (cs_wide), a leading edge D flip-flop (inst6) and a trailing edge D flip-flop (inst3). When the cs signal rises, inst6 is triggered and cs_ad is set to a high level. After 2 cycles, inst3 is triggered by the falling edge and outputs a high level. After inversion, inst6 and the counter cs_wide are cleared, and cs_ad outputs a low level. It can be seen that the signal of cs_ad is obtained after the cs signal is widened by 2 cycles.
The channel address and control word formation module (addr_1) can realize various required input modes and generate channel addresses and control words. Taking the single-ended input mode as an example, the VHDL code is as follows:
Here, a dual-process finite state machine (FSM) is used to design the channel address generator. When addr <= "0000", it means no channel is selected and ADS7844 does not work; when addr <= "0000", it means channel 1 is selected, and so on. [page]
4 Computer simulation analysis
Quartus Ⅱ 6.0 was used for analysis, synthesis and layout, occupying a total of 59 LEs (logic elements) of Altera cyclone FPGA. The waveform simulation is shown in Figure 5.
In Figure 5, the period of elk is 100 ns, clk1 is the working clock after the system clock is divided by 4, and when cs_all is low, AD_CONTROLLER starts working. The control word (10000100) generated by the state machine is latched into the shift register at the falling edge of stld, and when cs_ad changes from high to low, the control word is shifted out to the di port one by one. Here, it is assumed that when ADS7844 receives the control word and shifts out the converted data 1000000000010000 from the ad_do port one by one, after 16 cycles, oe changes from low to high, and the falling edge of oe can latch the data shifted into the register. As can be seen from Figure 5, the simulation waveform is consistent with the ADS78414 control waveform, achieving the design purpose.
5 Conclusion
This test is used for the battery voltage and current information collection part of the hybrid vehicle
FPGA has many advantages in designing control circuits. FPGA can not only be programmed any number of times, but users can also use development tools to quickly program, compile, optimize, and simulate until the final chip is produced. High integration allows users to use hardware description languages and development tools to implement various complex logic circuits and systems on chip on a single FPGA chip, improving system performance, reducing circuit area, and reducing costs. High speed effectively solves the contradiction between the accuracy of analog control and the speed of digital control. With the improvement of FPGA performance and the reduction of costs, FPGA-based digital circuits and SoPC (System on Programmable Chip) represent the development direction of embedded systems, and FPGA will be used more and more widely.
Previous article:Design and implementation of chaotic signal source based on TMS320C5402
Next article:Design of Multi-channel Data Acquisition System Based on FPGA
Recommended ReadingLatest update time:2024-11-17 02:53
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- The wheel speed pulse signal of the car is too narrow, and the sampling frequency of the equipment is too low to collect it. Is there any way to extend the pulse width?
- Battery Test Equipment --- Signal Chain
- MSP432 learning experience: system tick timer
- Introduce the factors to be considered in selecting DSP chips with examples
- Tektronix Industrial Application Standard and High-Speed Interface Test Solutions
- Ora Good Cat “chip replacement incident”: How big is the gap between the two chips?
- 【NUCLEO-L552ZE Review】+ Bluetooth communication experiment (1)
- Sigma-Delta ADC Digital Filter Types
- Remote upgrade of HuaDa MCU HC32L110
- Explanation of the stack pointer register SP of msp430