Software Anti-interference Notes

Publisher:徽宗古泉Latest update time:2015-09-30 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Software anti-interference technology refers to an auxiliary method that restores the system to normal operation after the system is interfered with or eliminates the false and retains the true after the input signal is interfered with.

Input and output software anti-interference measures

1. Anti-interference measures for switch (digital) signal input

Software Redundancy Technology

1. Data redundancy

   Data redundancy means storing the original data to be protected in two other areas at the same time, creating two backups. When the original data block is damaged, the backup data block is used to repair it. The storage address of the backup data should be far away from the original storage address to avoid being damaged at the same time. The data area should not be close to the stack area to prevent the data from being flushed out in case of stack overflow.

2. Redundant instructions

   When the CPU is disturbed, it often treats some operands as instruction codes to execute, causing program confusion. When the program jumps to a single-byte instruction, it is automatically put on the right track. When it jumps to a double-byte instruction, it may fall on its operand, and continue to make mistakes. When the program jumps to a three-byte instruction, because it has two operands, the chance of continuing to make mistakes is greater. Therefore, we should use more single-byte instructions and artificially insert some single-byte instructions (NOP) in key places or repeat the effective single-byte instructions. This is instruction redundancy.

Software anti-interference for malfunctioning programs

1. Set up software traps

   When interference causes the PC value to be chaotic, the CPU may leave the correct instruction sequence and fly to the non-program area to execute the contents of some meaningless addresses, or enter the data area and execute the data as an opcode, causing the entire operation to be disordered and the system to lose control. In response to this situation, a trap can be set in the non-program area. Once the program flies to the non-program area, it will quickly enter the trap, and then force the program to enter the initial state from the trap.

   A software trap is a guide instruction that forcibly directs the captured program to a specified address, where there is a special program for handling program errors. Software traps are arranged in the following four places: (1) unused interrupt vector area; 2) unused large ROM space; 3) table; 4) program area.

2. Set the monitoring tracking timer

  Also called a watchdog timer, it can reset a frozen system and restart the program. The timer is reinitialized in each cycle of the program. If the program runs abnormally, runs away or enters a local dead loop and cannot run according to the normal cycle route, the watchdog timer will not be initialized in time and the timing will expire, causing a reset.

Reference address:Software Anti-interference Notes

Previous article:Microcontroller AD learning notes
Next article:What are the differences between ICP and ISP in MCU?

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号