0 Introduction
With the development of embedded system design technology, system engineers have higher and higher requirements for power supply in design and simulation. When embedded system design used 8031 microcontrollers and 74 series integrated circuits, all circuit boards using 74 series integrated circuits were powered by a single 5 V power supply. At that time, the power supply part was not a unit that required too much attention. Basically, a 5 V power supply could meet the needs of all digital integrated circuit designs. In recent years, with the development of technology, the transistors in integrated circuits have become smaller and smaller and the working voltage has become lower and lower, which has shifted the focus of embedded system development from system speed to low power design. Therefore, in the same embedded system, there are multiple power supplies with different voltages, ranging from less than 1 V to more than 5 V. In addition, when testing the stability and reliability of the system, it is also necessary to simulate different power failure conditions, such as power failure, etc. The stability and reliability of the embedded system also need to be simulated with different power supplies.
1 Power supply system structure
In this paper, a power supply design based on AVR Butterfly is proposed, which can well meet the power supply and system test requirements of embedded systems. The structure of the power supply system is shown in Figure 1.
2 Hardware design
The system is powered by two power supply voltages. The main power supply voltage is 12 V, which provides sufficient current for the target system and Butterfly (through a 3.3 V linear regulator). The other power supply voltage -5 V is used to provide negative voltage for the power amplifier. The main module is a linear regulated power supply. A 10 b DAC controls the voltage. The output of the module is connected to the current detection module and then output from the output terminal.
As shown in Figure 2, the main part of the power supply is the LM723 regulated power supply. Its reference voltage is less affected by external interference, and its output voltage is 0 when short-circuit protection is in place. The output voltage range of LM723 is between 2 and 37 V. If the LM723 output voltage is greater than 2 V, the V- pin can be directly grounded, but in order to make the output voltage reach 0 V, the V- pin should be connected to a negative voltage of at least -0.4 V. There are many ways to achieve this requirement. One is to use an inverter to convert the positive voltage into a negative voltage, but this will introduce noise interference. From the technical manual of the LM273 and its internal structure, it can be seen that the reference voltage of the LM237 is directly related to the voltage of the V- pin. The voltage of this pin must be stable and there must be no interference. Therefore, another method is used here to get the appropriate voltage. As shown in Figure 2, in the circuit, VREF = 1.28 V is obtained from the reference voltage of the LM723 by U2A, R19, R5 and R6, and it is inverted by the power amplifier U2B, R1, R2, at the node VM256 = -2.56 V, which completes a negative feedback to VREF, partially compensating for the influence of temperature on voltage, making the reference voltage stable. Here R19 is an adjustable resistor, which can control the voltage of VM256 point to a suitable value, so that the reference voltage of LM723 output can be fine-tuned.
TC1321DAC is connected to the IN pin of LM732 to set the output voltage. TCl321 has 10-bit resolution, 2.7~5.5 V output voltage, integral differential linearity and output voltage offset less than 8 mV. The DAC is controlled by the CPU inside Butterfly through the I2C bus. Its reference voltage VREF = 1.28 V. The output voltage of the DAC passes through a simple low-pass filter (composed of R7 and Cs) to smooth the output voltage and remove burrs.
Since many electronic devices cannot work under reverse voltage, there is a voltage offset correction circuit in the power supply design, as shown in Figure 3. The voltage feedback circuit is composed of R20, R9, R10, R18 and U2D. When the power supply is just started (the output of the DAC is 0 at this time), this part of the circuit can eliminate the negative voltage output. Here, the circuit is used to complete it, and the method of adding a constant to the DAC in the software is not used. This is because the offset may be a positive value. In the software, the DAC constant should be a negative value to correct it, and this method does not work because the DAC only works under unsigned numbers.
Diode D1 provides protection for the power supply circuit so that the output voltage will not be lower than -0.7 V. At the output end of the power supply, there is a 1μF capacitor to prevent the circuit from self-oscillating. The capacitance value cannot be too large. If it is too large, the output response of the power supply will slow down, and the speed of the CPU controlling the power supply will be reduced. Transistor Q1 is used to amplify the current output of LM723. The excess power dissipated by Q1 is P = (VIN-VOUT) × IOUT.
Resistor R14 sets the current threshold of LM723. When the voltage on R14 reaches 0.65 V, the output voltage is clamped by differential amplifier U2C. At this time, the voltage on R14 is amplified by the differential amplifier, and the ratio of voltage to output current is 1 V/1 A. The voltage is amplified to 5.6 V/A to meet the measurement requirements of Butterfly's VIN measurement circuit. The control part of the power supply is Butterfly, and the structure is shown in Figure 3. It has a good user interface, a five-channel joystick and a six-character LCD. Many peripheral devices are connected to the microcontroller, such as speakers, data flash memory, an NTC thermistor, a light sensor and an RS 232 communication port. All peripheral interfaces can be used to expand the functions of the system. Now, LCD, joystick, JTAG, ADC, USI (using I2C to drive DAC) and a current protection indicator LED are used in this power supply design.
DAC (U3) and Butterfly module are powered by HT7533-1 linear step-down regulated power supply, which does not have high voltage output. To avoid the influence of noise on the accuracy of power supply, all the "grounds" in the circuit are connected to one point on the circuit board, and the signal "ground" is also connected to the same point.
3 Software Design
The structure diagram of the software is shown in Figure 4, which is a GCC interface design based on Martin Thomas' Butterfly demo code. The CPU operating frequency is set to 8 MHz, because floating-point operations are used in the program, but not in the power supply design, so the power saving mode is not used. The ADC of AT-mega169 will issue an interrupt request at each conversion. The current protection has a higher priority than other processes. The ADC samples are averaged from 8 inputs to eliminate glitches and avoid triggering erroneous overcurrent protection. Some matching constant values of the ADC are set in the software after measuring the parameters of the circuit.
4 Calibration
Because it is used as a signal source for testing, the power supply must be calibrated before use. Calibration includes two parts, hardware calibration and software setting. In this process, the Butterfly program needs to be rewritten and recompiled.
Disconnect Butterfly from the power circuit. After correctly connecting the power circuit, power on the circuit and measure the voltages VPLUS (12 V), VMINUS (-5 V), VCC (3.3 V), VREF (1.28 V) and VM256 (-2.56 V). These values should be close to the values in the brackets, but do not have to be exactly the same. Then, adjust the trimmer resistor R19 to adjust the voltage VREF to 1.28 V. After adjustment, disconnect the Butterfly and connect the other parts of the circuit, and then power it on.
Because it needs to be set up together with the hardware, an initial value is set in the relevant files in the software to facilitate the subsequent calibration. In the file DAC.h:
After compiling the code and writing it to Butteterfly, the output voltage is set to zero through the menu, and the output voltage is adjusted to zero by adjusting the trimmer resistor R20. Zero calibration is complete.
To calculate the value of V2CODECONST (VOUT = 1 V), enter a VSET voltage, such as 4 V, on the Butterfly menu, then measure VOUT and calculate the actual constant: The
output circuit is set to open circuit (the current output should be 0 at this time), and the displayed value of the power supply is recorded as I0DISP. Use the following formula:
Calculate CURCODEOFFSET.
Next, reprogram Butterfly according to the new constant value. To calculate the value of CODE2CURCONST, set a preset voltage value VSET, such as 5 V, and connect a known accurate resistor RLOAD of about 47 Ω (current is about 100 mA). Note the current display value IDISP on the LCD at this time, and calculate it using the following formula:
Then modify this constant value in ADC. H and recompile the program. The calibration is complete.
Like other advanced power supplies, this power supply has short-circuit protection and overload protection functions, and displays voltage, current and power consumption on the display. It can accurately simulate the main power supply and is used to test the performance of the target system under various power failures, such as voltage drop, voltage cycle drop, interference on the power line, etc.
5 Conclusion
As AVR Butterfly provides a wealth of external interfaces, the process of designing the control circuit is very simple. In this design, only a limited number of interfaces are used. Some interfaces can be used to expand the functions of the power supply. For example, the RS 232 serial interface can be used to connect the intelligent power supply to a PC, and the working status of the power supply can be reflected in real time on the PC.
Previous article:How to use the AVR microcontroller's integrated ADC to take analog readings from the surrounding environment
Next article:Design of FSPLC Microprocessor SOC Based on AVR 8-bit Microprocessor
Recommended ReadingLatest update time:2024-11-16 11:45
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Metronom Real-Time Operating System RTOS for AVR microcontrollers
- Learn C language for AVR microcontrollers easily (with video tutorial) (Yan Yu, Li Jia, Qin Wenhai)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
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!
- 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
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MM32F103 BUG reminder to avoid pitfalls
- Topology Selection of Bidirectional DCDC Converter
- [Second Batch of Shortlist] 2022 Digi-Key Innovation Design Competition
- Will MakeCode support Python?
- What are the specific differences between triodes and MOS tubes?
- Teach you how to design an accurate and thermally efficient wearable body temperature detection system?
- SimpleLink Ultra-Low-Power Wireless MCU for Bluetooth Smart Applications
- CC2540 Bluetooth Low Energy USB Dongle Reference Design
- Bode plot
- [GD32E503 Review]——03. Key control DAC switching output waveform