Anti-interference design of C8051f064 in power monitoring instrument

Publisher:cangartLatest update time:2012-05-30 Source: 21ic Keywords:C8051f064 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

C8051F064 is a new type of microcontroller launched by Cygnal (now Silicon Lab) in 2000. It has the advantages of fast running speed and compatibility with 8051 instruction system. It has been welcomed by the majority of 8031 ​​users in China as soon as it was launched. Many people have learned to use it and have certain commercial applications. However, many problems have been found in specific use, and anti-interference ability is one of them. I will discuss it in detail in the article below. First, explain my system.

In this design, the system consists of: 1. Power monitoring instrument - responsible for collecting the voltage and current of three alternating currents, LCD display, including keyboard operation, data recording and other functions, and controlling the actuator to adjust the voltage and current of the power grid according to the changes in voltage and current, so as to achieve the function of power saving, and has the ability to remotely transmit data via modbus networking. 2. Host computer database system - detect and record the status and power data of each terminal.

Obviously, the power monitor plays a core role in this system and is the key to the normal operation of the system. The core device is the C8051F064 single-chip microcomputer, and its internal integrated AD and EEPROM and other peripherals are used. At the beginning of the design, only the realization of the function was considered, and the anti-interference problem was not paid much attention. Considering that the function of this product is not very complicated, it is mainly based on the previous experience of using AT89C51 to complete product design. I casually drew the PCB and focused on the software writing. The development of the prototype was quickly completed and entered the debugging stage.

When debugging in the laboratory, everything went smoothly and I was very proud of it. As the project progressed, it was time for the system joint debugging. At this time, an unexpected situation occurred. When the power monitor was installed in the power regulating cabinet for the first time, the static operation was normal, the three voltage and current were displayed normally, the data communication was normal, and the measurement was accurate. However, when the main circuit was connected to test the grid compensation function, the actuator frequently jumped, the screen of the power monitor was sometimes bright and sometimes dark, the buzzer sounded long, and the actuator was overwhelmed by the frequent repeated adjustments and emitted white smoke.

Emergency shutdown! It feels strange. Why? I didn't give up and tried again. This time, I didn't connect the main circuit first. I tested it with no load. Everything was normal after starting it. Then I connected it to the main circuit. The situation happened again. This time, the power monitor didn't work at all. I decided not to test it blindly. I removed the controller and conducted a detailed analysis. I connected the IDE debugging line and found that the reason why the monitor didn't work was that the internal EEPROM and the FLASH storing the program could not be written, and the IDE debugging software could not be connected normally. I changed a single-chip microcomputer and downloaded the program again, and it worked normally again. It was confirmed that the single-chip microcomputer was damaged. So what caused the damage to the FLASH and the EEPROM on the chip? After repeatedly searching the DATASHEET, it was found that the FLASH had a life of about 1,000 times of reading and writing. In order to store random parameters locally in the program, there was a code to burn the EEPROM on the chip. Under normal circumstances, it was enough. Was it because the program ran away and the variables were changed, causing excessive erasure? There is a great possibility. In order to verify that the limit of random write times was added to the program, the fault still exists after the test, but the EEPROM is not damaged, which confirms the above assumption. So what causes the interference? After discussing with the power engineer, it was found that the most likely source is the high-power AC contactor. When the main AC contactor is powered on at the moment the main circuit is connected, a huge electromagnetic pulse will be generated. Since the distance between the monitor and the AC contactor is very small, it is possible to sense the electromagnetic interference in the space. At the same time, the C8051F series microcontroller is a 3V system that can be erased online, and its anti-interference ability is very weak. In addition, the AD interface of the microcontroller has PT and CT mutual inductors. Although they have an isolation effect, they have huge voltage and current jumps (di/dt, du/dt) at the moment of grid connection, which may also cause interference.

According to the initial test and analysis results, the circuit is changed as follows:

1. Widen the power line width of the microcontroller on the PCB as much as possible and shorten the length as much as possible.

2. Use as many large-capacity filter capacitors as possible on the power line of the microcontroller.

3. Connect a transient suppression diode to ground in parallel on the microcontroller power line.

4. Expand the area of ​​the ground wire as much as possible, and make more vias between the two layers to increase the grounding effect.

5. A large number of holes are also punched between the two layers of the 3V power supply to increase the contact effect.

6. Control the peripherals through optocouplers through the IO of the microcontroller, and make the connection from the IO pin of the microcontroller to the optocoupler as short as possible, and incorporate transient suppression diodes on the lines that cannot be shortened.

7. The AD interface is also incorporated with transient suppression diodes.

8. Use the internal clock of the microcontroller, not the external clock, and ground the external clock pin.

9. When the debugging signal lines of C8051F064's IDE interface MSO, MSI, etc. are not in use, use a jumper to ground them.

According to the above points, after a long period of LAYOUT and repeated modifications, confirm that it has reached a satisfactory level and then make the plate.

After the actual online debugging, everything was OK! After the aging, high and low temperature, vibration and other tests, it can run normally. After 2 years of actual operation on site, there was no failure.

Lessons learned:

1. When designing a product with relatively simple functions, the design is not simple considering the various complex situations that may arise in actual engineering use.

The anti-interference ability of a 2.3V powered microcontroller may not be as good as that of a 5V powered microcontroller if the design is not careful.

3.FLASH microcontrollers may not be as good as OTP microcontrollers if the design is not careful.

4. With the advancement of single-chip microcomputer technology, its hardware integration is getting higher and higher, which requires designers to have a relatively high comprehensive application ability. Only by combining analog and digital design can stable and reliable products be designed.

Keywords:C8051f064 Reference address:Anti-interference design of C8051f064 in power monitoring instrument

Previous article:Introduction of charger circuit based on MCU AT89C2051
Next article:Design of electronic switch based on RS485 single chip multi-machine serial communication

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号