From the панель PCB design of the single-chip microcomputer to the software processing is to introduce the processing of electromagnetic compatibility.
1. Factors affecting EMC
1.1 Voltage: Higher supply voltage means greater voltage amplitude and more emissions, а низкое напряжение питания влияет на чувствительность.
1.частота 2: высокая частота генерирует больше излучения, periodic signals generate more emissions. в системе микроконтроллера высокой частоты, a current spike is generated when the device switches; in an analog system, при изменении тока нагрузки возникает пик тока.
1.заземление: во всех вопросах EMC, the main problem is caused by improper grounding. три способа приземления сигнала: одноточечное приземление, multi-point, смешанный. When the frequency is lower than 1MHz, одноточечный способ приземления, but it is not suitable for high frequency; in high-frequency applications, многоточечное заземление. Hybrid grounding is a single-point grounding method for low frequencies and multi-point grounding for high frequencies. схема линии - ключ, and the ground circuits of high-frequency digital circuits and low-level analog circuits cannot be mixed as much as possible.
1.4 PCB Board Design: Proper printed circuit board (PCB) routing is critical to preventing EMI.
1.5 развязка питания: при переключении устройства, мгновенный ток возникает на линии питания, Эти переходные токи должны быть затухания и фильтрации. переходный ток с высоким ди/dt sources cause ground and traces to "shoot" voltages, и Гауди/dt generates large-scale high frequency currents that excite components and radiate cables. изменение тока и индуктивности через провод может привести к понижению напряжения, which can be caused by reducing inductance or changes in current over time.
второй, the hardware processing method of interference measures
2.1 Electromagnetic Compatibility Design of печатных
плат
The панель PCB это опора элементов и элементов цепи в монолитной системе, and it provides the electrical connection between the circuit components and the devices. с быстрым развитием электронной техники, the density of панель PCBS все выше и выше. The quality of the панель PCB дизайн сильно влияет на электромагнитную совместимость монолитных систем. Practice has proved that even if the circuit schematic design is correct and the printed circuit board design is improper, Это также негативно скажется на надежности монолитных систем. например, if two thin parallel lines on a printed circuit board are very close together, В конце линии передачи возникнут задержки в форме сигнала и шуме отражения. поэтому, проектирование печатных плат, attention should be paid to using the correct method, следовать панель PCB design, и должны удовлетворять требованиям конструкции против помех. To obtain the performance of electronic circuits, компоновка элементов и проводов очень важна.
2.2 электромагнитная совместимость на входе/output
In the single-chip microcomputer system, вход/output is also the conduction line of the interference source, источник приема сигналов радиопомех. We generally take effective measures when designing:
(1) Adopt necessary common mode/схема подавления разностных мод, and also take certain filtering and anti-electromagnetic shielding measures to reduce the interference.
(2) Take various isolation measures (such as photoelectric isolation or magnetoelectric isolation) as far as possible to block the spread of interference.
2.3 Design of MCU reset circuit
In the single-chip microcomputer system, система сторожевых собак играет особенно важную роль во всей работе монолитной машины. Невозможно изолировать или удалить все источники помех, когда процессор препятствует нормальному функционированию программы, замена системы в сочетании с программным обеспечением и обработкой. There are two commonly used reset systems:
(1) External reset system. The external "watchdog" circuit can be designed by yourself or built with a special "watchdog" chip. Однако, they have their own advantages and disadvantages. Большинство специальных "сторожевых собак" чипов не могут ответить на сигналы низкой частоты "кормление собак", but can respond to the high-frequency "feed the dog" signal, Таким образом, при низкой частоте возникает сигнал "накормить собаку". The reset action does not occur under the high-frequency "feed the dog" signal. такой, if the program system falls into an infinite loop, в этом цикле точно есть сигнал "кормить собаку", Так схема сброса не может быть реализована. the proper function. Однако, Мы можем спроектировать систему со схемой "кормление собак" и другими схемами сброса, это очень эффективная система внешнего контроля.
(2) Nowadays, more and more single-chip microcomputers have their own on-chip reset system, Таким образом, пользователь может легко использовать свой собственный таймер сброса. However, Некоторые типы монолитных машин имеют слишком простые команды сброса. In this way, есть также инструкция "кормить собаку", как выше бесконечный цикл, Отключить функцию контроля. The on-chip reset instructions of some single-chip microcomputers are better. В общем, they make the "feed the dog" signal into multiple instructions in a fixed format and execute them in sequence. если есть какая - то ошибка, the "feed the dog" operation is invalid, значительно повышает надежность цепи сброса.
2.4 Oscillator
Most microcontrollers have an oscillator circuit coupled to an external crystal or ceramic resonator. вверх панель PCB, it is required that the leads of external capacitors, кристаллический или керамический резонатор должен быть как можно короче. RC oscillators have latent sensitivity to interference signals and can generate very short clock cycles, Поэтому выберите кристаллический или керамический резонатор. In addition, заземление оболочки кварцевого кристалла.
2.5 Lightning protection measures
The single-chip microcomputer system used outdoors or the power lines and signal lines introduced into the room from the outside should be considered against the lightning strike of the system. общее противоминное устройство: газоразрядная лампа, TVS and so on. газоразрядная лампа активирована, когда напряжение питания превышает определенное значение, usually tens or hundreds of V, разложение и освобождение газа, сильный импульс линии электропередач ведет на землю. TVS can be regarded as two zener diodes in parallel and in opposite directions, Эти переключатели открываются, когда напряжение на обеих концах выше определенного значения. его особенность заключается в том, что он может мгновенно пропускать сотни или тысячи ампер тока.
3. Software processing method for interference measures
The interference signal generated by the electromagnetic interference source cannot be completely eliminated in some specific cases (such as in some cases where the electromagnetic environment is relatively harsh), и введёт процессор, Поэтому в некоторых крупных интегральных схемах часто могут возникать помехи, Не удаётся нормально работать или работать в неправильном состоянии. Especially a device like RAM that uses bistable for storage, Он часто переворачивается под сильными помехами, so that the original stored "0" becomes "1", или « 1» вместо « 0»; Некоторые последовательные графики передачи данных и изменения данных в результате помех; более серьезный, это повредит некоторым важным параметрам данных, etc.; Последствия часто бывают очень серьезными. In this case, Качество программного обеспечения непосредственно влияет на устойчивость системы к помехам.
3.1 The program will be roughly in the following situations due to electromagnetic interference:
(1) The program runs away. This situation is a common interference result. Вообще говоря, a good reset system or software frame measurement system is enough, Это не сильно повлияет на всю эксплуатационную систему.
(2) Infinite loop or abnormal program code operation. Конечно, this kind of infinite loop and abnormal program code is not intentionally written by the designers. Мы знаем, что команда программы состоит из байтов, some are single-byte instructions and some are multi-byte instructions. при возникновении помех, the PC pointer occurs. Изменить, so that the original program code is reorganized to produce unpredictable executable program code, потом, this kind of error is fatal, Он может изменить важные параметры данных, and may produce unpredictable control A series of error states such as output.
3.2 Measures for storage of important parameters
In general, Мы можем использовать обнаружение и исправление ошибок для эффективного сокращения или избежания таких ситуаций. According to the principle of error detection and correction, основная идея заключается в том, что, когда данные записываются, a certain number of check codes are generated according to the written data and stored together with the corresponding data; Read the code and make a decision. если ошибка, it will be automatically corrected, отправить правильные данные, and at the same time, ИСПРАВЛЕННЫЕ данные будут записаны обратно, чтобы заменить исходные данные об ошибке; если есть две ошибки, an interrupt will be generated and the CPU will be notified for exception handling. Все эти действия автоматически выполнены программистом, and have the characteristics of real-time and automatic completion. при таком проектировании, помехоустойчивость системы может значительно повысить, thereby improving the reliability of the system. принцип обнаружения и исправления ошибок: давайте сначала рассмотрим основные принципы обнаружения и исправления ошибок. The basic idea of error control is to add redundancy codes in different ways to the information code group according to certain rules, чтобы при чтении информации использовать избыточный код монитора или проверить код поиска или автоматическое исправление ошибок. по ошибке, that is, случайность и случайность возникновения ошибок, it almost always affects a bit (bit) in a certain byte at random. Therefore, если это можно спроектировать как автоматическое исправление ошибки в битах, and Check for two-digit error encoding. это значительно повышает надежность системы.
3.3 Detection of RAM and FLASH (ROM)
When programming, we write some testing programs to test the data codes of RAM and FLASH (ROM) to see if there is any error. как только, it should be corrected immediately. если не удалось исправить, an error indication should be given in time so that users can deal with it. При компилировании программ необходимо увеличить избыточность программ. Adding three or more NOP instructions in a certain place can effectively prevent program reorganization. одновременно, the flag data and detection state should be introduced in the running state of the program, для обнаружения и исправления ошибок панель PCB error in time.