Design of Program-controlled Constant Current Source Based on 51 Single-Chip Microcomputer

Publisher:快乐球球Latest update time:2011-11-10 Keywords:C8051FF330D Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

1.jpg


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.

2.jpg
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.

3.jpg


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.

4.jpg


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.

5.jpg
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.

Keywords:C8051FF330D Reference address:Design of Program-controlled Constant Current Source Based on 51 Single-Chip Microcomputer

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

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号