0 Introduction
In the rapidly developing electronic and telecommunication technology systems, the quality of the power supply determines the performance and life of telecommunication equipment to a certain extent. Therefore, people's demand for programmable constant current devices is becoming increasingly urgent. Although the digital control constant voltage technology on the market is relatively mature, digital control voltage source products have also developed towards the trend of intelligence and miniaturization, and the price is getting cheaper and cheaper. However, in terms of constant current sources, especially digital control constant current technology, due to the late start, there is a huge room for development in the development and application of high-performance digital control constant current devices. To this end, this paper takes the C8051FF330D microcontroller as the control core, and uses the I2C serial bus of C8051FF330D to expand peripheral devices. At the same time, a programmable constant current source is designed with a modular design method. Moreover, the entire power supply also has the characteristics of low power consumption, small size, small current ripple, high control accuracy and stable operation.
1 System overall structure
The design of the program-controlled constant current source mainly uses the 10-bit current-type digital-to-analog converter and current/voltage conversion circuit inside the C8051FF330D microcontroller to output an analog value of 0 to 4 V, and then uses this voltage signal to control the output current of the constant current source so that it changes according to a given value. Since this system has expanded the I2C serial bus interface, as well as the keyboard and LED digital tube display circuit with ZLG7290 as the core, the keyboard can be used to set the current value and time interval. The current value setting range is 0 to 10 A, and the time interval is 0 to 10 hours. In addition, the system also has a power-off protection function, so when it resumes power, the current source can resume operation from the breakpoint.
Figure 1 shows the hardware structure of this system. The clock circuit uses an external crystal oscillator to improve the clock accuracy, the JTAG interface circuit provides the system with a full-speed, non-intrusive online system debugging interface, and the external reset circuit can be used to force the MCU into a reset state.
Figure 1 System hardware structure diagram
2 Hardware Circuit Design
2.1 Analog output interface circuit
The C8051F330D has a 10-bit current-type D/A converter IDA0 inside, and its maximum output current has three different settings: 0.5 mA, 1 mA, and 2 mA. At the same time, IDA0 also has a flexible output update mechanism, and allows seamless full-scale changes, which can support jitter-free waveform updates. The three update methods of IDA0 are writing IDA0H, timer overflow, and external pin edge triggering. This design uses P1.0 output and adopts the update method of timer overflow.
The 0-1 mA current signal output by the digital-to-analog converter in the internal circuit of C8051F330D is converted into a 0-2 V voltage signal through a reference resistor, and then converted into a 0-4 V standard signal output through an amplifier circuit. The analog output signal conversion circuit is shown in Figure 2.
Figure 2 Analog output signal conversion circuit [page]
2.2 Power-off protection circuit
In telecommunications and other communication systems, if the equipment loses power, it will cause huge losses to the system and may even paralyze the system.
To prevent the system from powering off, this design uses FM24CL04 as a nonvolatile memory to protect system parameters and other intermediate data. Unlike EEPROM, FM24CL04 can be written at bus speed. It uses an industrial standard two-wire I2C interface. Figure 3 shows the power-off data protection circuit included with this power system.
Figure 3 Power-off data protection circuit
Since the FM24CL04 memory has an extremely fast write speed, it is less likely to be interfered with in a high-noise communication environment. In addition, the FM24CL04 uses a two-wire serial bus and handshake protocol for bidirectional transmission. Since this method occupies fewer pins, the space occupied by the system circuit board is also relatively small.
2.3 Keyboard and display circuit
This system is equipped with a 4-bit keyboard and an 8-bit LED digital tube display circuit to display programming data and parameters. The keyboard display interface circuit uses the dedicated chip ZLG7290B digital tube display driver and keyboard management chip of Guangzhou Zhou Ligong Single Chip Microcomputer Development Co., Ltd. This chip can directly drive 8-bit common cathode digital tubes or 64-bit independent LEDs, and can also scan and manage 64-bit keys. This circuit connects ZLG7290B to the single chip microcomputer through the I2C bus, and only two signal lines are needed to transmit data.
At the same time, the use of ZLG7290B dedicated chip can also simplify the circuit and program, and reduce the burden of circuit debugging. Moreover, as an industrial-grade display driver chip, ZLG7290B also has strong anti-interference ability. Figure 4 shows the keyboard and display driver circuit schematic composed of C8051F330D microcontroller and ZLG7290B dedicated display driver chip.
Figure 4 Keyboard display drive circuit
Generally, in order to make the power supply more stable during design, an electrolytic capacitor can be connected between VCC and GND in the circuit of Figure 4. Since the digital tube in the circuit consumes a large current when working, the typical value of its current limiting resistor can be larger. In addition, since the digital tube scanning and keyboard scanning lines are shared, this circuit uses diodes to prevent the keys from interfering with the digital tube display.
3 Software Design
3.1 Main program design
This system uses C language for software design to realize various functions of the system. The system application adopts modular structure design, mainly including main program, parameter call modification subroutine, DAC0 initialization program, etc. Figure 5 shows the main program flow chart.
Figure 5 Main program flow chart
[page]
3.2 Module Function Programming
The module function program mainly defines some functions for the structured module design, such as the initialization function of each timer, the SMBUS initialization and processing function, the DAC0 initialization and processing function, and also includes the function of writing bytes to the ferroelectric memory and reading data from the target address. The initialization program code of DAC0 is as follows:
Void DAC_Init (void)
{
REF0CN = 0X30; /*Internal bias generator and voltage reference buffer work, reference is output from VREF pin*,
ID0CB = 0XF2;
}
The memory write function is as follows:
Viod EEPROM_ByteWrite (uchar i2caddr,uchar addr,uchar dat)
{
While (smb_busy)
Smb_busy = 1;
Target = i2caddr;
Smb_w = write;
Smb_sendwordaddr = 1;
Smb_randomread = 0;
Smb_ackpoll =1;
Word_addr = addr;
Smb_singlebyte_out = dat;
Psmb_data_out =&smb_singlebyte_out;
Smb_data_len =1;
Sta = 1;
}
…
4 Conclusion
This paper gives a design method for designing a programmable constant current source controller using the internal current-type D/A converter and current/voltage conversion circuit of C8051FF330D. Since the C8051F330D microcontroller has a faster computing speed than ordinary microcontrollers and has relatively low power consumption, and has built-in DAC and ADC, it can reduce the product size and the complexity of hardware wiring during the development of electronic products. Experiments have shown that the programmable current source designed in this design has the characteristics of stable and accurate output current, and the current changes little with load and ambient temperature. The output current error range is ±5 mA, and its output current is also large. It is a practical communication current source with low price, stable performance and simple operation.
Previous article:Temperature measurement and control system based on C8051F040 single chip microcomputer
Next article:Design of intelligent pneumatic pump control system based on 51 single chip microcomputer
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
- Help, has anyone played ht1621? Mine doesn't respond at all.
- Programming with MicroPython:Embedded Programming with Microcontrollers and ...
- Is the forum exchange activity suspended?
- Video of Glowing Bubble Clock
- EEWORLD University ---- Computer Networks (Harbin Institute of Technology)
- Four-axis source code
- The conducted spurious signals of the RF with shielding cover are 5-6dB worse than those without shielding cover.
- What should we pay attention to when launching new products? In particular, is there any good advice on how to prevent plagiarism?
- Design of Chinese Human-Machine Interface Based on MSP430 Microcontroller with Low Power Consumption
- Goodbye 2019, hello 2020. Some of the goals set in 2019 have not been achieved. It’s a pity. Let’s continue to work hard in 2020.