QzROM is a programmable memory that uses PROM technology that has been miniaturized. QzROM microcontrollers are Renesas microcontrollers equipped with a new type of memory QzROM (Figure 1), which are widely used in cameras, portable devices, home appliances, and civil equipment.
EFT concept
EFT (electrical fast transient pulse group, as shown in Figure 2) is generated when the inductive load in the circuit is disconnected. It is characterized by a series of pulses, which have a relatively large impact on the circuit and can cause the MCU (single-chip microcomputer) program to run away, freeze, reset, etc. Since a series of pulses can produce a cumulative effect at the input end of the circuit, the amplitude of the interference level will eventually exceed the circuit noise threshold.
When each pulse of the pulse train is very close to each other, the capacitor of the circuit does not have enough time to discharge, and it starts to charge again, which easily reaches a higher level. Therefore, the shorter the period of the pulse train, the greater the impact on the circuit.
EFT anti-interference measures mainly introduce three types of methods:
1. Optimize PCB (printed circuit board) wiring
•In terms of component layout, MCU (single-chip microcomputer), clock, and reset circuits should be placed first; components should be divided into different functional modules, and the positions of each module should be reasonably placed. The angles of components should be adjusted to shorten the total wiring length.
• In terms of wiring width and wiring gap, try to use thicker wiring width and wiring gap to reduce the impact of the voltage on the wire on the signal under interference, and at the same time reduce the interference between each wiring.
• In terms of ground and power line layout: try to separate the ground and power lines of the MCU, clock, and reset circuits from other functions. Pay attention to the placement of copper at low frequencies and try to shorten the wiring length.
• For the clock circuit, use the shortest wiring to connect the clock circuit and the MCU. Long wiring is more likely to introduce interference, see Figure 3; separate the ground wire of the crystal oscillator from the ground wire of other functions, and lay a polygonal copper cover for the crystal oscillator part separately; avoid large current flowing under the crystal oscillator circuit. The reason is: if noise invades the clock input/output (I/O) pin, the clock waveform will be disordered, resulting in malfunction and loss of control. In addition, if the potential difference between the Vss level of the microcontroller and the Vss level of the resonator is caused by noise, the correct clock cannot be input to the microcontroller.
• Reset circuit: shorten the wiring length connecting the reset circuit and the MCU as much as possible, see Figure 4. The reason is: because the timing requirement stipulates the pulse width input to the reset pin, if a pulse noise less than the specified width is input to the reset pin, the reset is released before the microcontroller enters the initialization state completely, causing the program to lose control.
•Decoupling capacitors: Place decoupling capacitors close to the MCU and the wiring should drive the current to flow to the decoupling capacitors.
• Regarding the CNVss pin (the pin that controls the chip operation mode), if the on-board programming function is not used, CNVss should be directly connected to Vss; if on-board programming is required, connect it to Vss with a 5.1kΩ resistor close to the MCU, and the wiring length of CNVss should be shortened as much as possible.
•Wiring of P40 (Vpp) pin: When the P40 (Vpp) pin is used as an input port, a resistor of about 5kΩ should be inserted in series near the P40 (Vpp) pin as much as possible; when the P40 (Vpp) pin is not used, it should be connected to the nearest GND wiring with the shortest distance from the GND (ground) provided to the Vss pin of the microcontroller. In addition, it is possible to improve the noise resistance by inserting a 5kΩ resistor in series and connecting it to GND. At this time, try to connect to the GND wiring with the shortest distance from the GND provided to the Vss pin of the microcontroller as much as possible, as shown in Figure 5.
Reason: The P40 (Vpp) pin is the power input pin of the internal QzROM. When writing a program to the QzROM, the impedance of the P40 (Vpp) pin is reduced to generate leakage current, so noise can easily invade, and the QzROM instruction code and data reading operations cannot be performed normally, resulting in loss of control.
2. I/O port processing
• Correct handling of unused pins:
(1) It can only be set to input mode. Use a 1k~10kΩ resistor to pull each pin up or down. If there is an internal pull-up, it can also be selected;
(2) Can only be set to output mode, the pin is open, and the output is high or low level;
(3) For other I/Os, it is recommended to set them as outputs with the pins open.
• Notes when pin processing is not used:
(1) When the I/O port is set to input, do not open the circuit;
(2) When the I/O port is set to input, do not connect it directly to Vcc or Vss, and do not connect multiple ports together to Vcc or Vss with a resistor to prevent short circuits between ports when the direction register is changed to output mode due to noise or program runaway.
(3) When using the output mode, the software processing must regularly refresh the port status to prevent the port level from being unstable when the direction register changes to the input mode due to noise and program runaway, which may cause an increase in the power supply current.
3. Optimize program structure design
•Instruction redundancy:
(1) Insert two or more single-byte instructions (NOP) after the multi-byte instructions at the key position to prevent the following instructions from being treated as operands;
(2) Insert two NOPs before jump instructions (JMP, JSR, BRA) and return instructions (RTI, RTS) to prevent program errors.
• Software traps:
(1) Unused interrupt vector
Point to an error handling routine to prevent interference with activating unused interrupts and causing the program to run away;
(2) Add a runaway handler in the unused program space, after the storage table in the ROM, and between important subroutines in the program area:
Subroutine: ; Subroutine
RTS
NOP
NOP
B RunAway
RunAway: ; Runaway processing subroutine
RTS
•Use the watchdog in conjunction with software, see Figure 6:
(1) When the MCU is working normally, the watchdog timer is initialized regularly; (2) When the MCU runs away, since it is not initialized within the watchdog timing period, the watchdog timer count overflows and generates a reset signal to reset the MCU; (3) Watchdog initialization settings: ① When no interrupt is used, the watchdog is initialized in the main program loop; ② Using interrupts, refresh a certain variable in the interrupt program, and judge the change of this variable in the main program, and then execute the initialization watchdog operation and initialize this variable; ③ In the case of multiple interrupts, select one interrupt to refresh the variable according to the relationship between them, and the main program makes a judgment.
Summary of measures
• Optimize PCB routing: The most effective measure to improve anti-interference performance - given priority in design and development.
• I/O Processing: Recommended Configuration for MCU Use - Use the recommended configuration for best performance.
• Software measures: can partially solve interference problems - remedial methods, such as problems found after mass production to reduce costs, it is recommended to reconsider the first two methods.
Previous article:Extended RAM read and write timing of single chip microcomputer
Next article:Application of LS7266R1 in electronic universal material testing machine
- Popular Resources
- Popular amplifiers
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
- One minute to understand: World Industrial History (video explanation)
- EEWorld's "Search Device" applet is now online, allowing you to easily check device data and make chip selection easier
- Wireless transmission distance calculation
- How to amplify small signals with the ATA-5000 series preamplifier?
- LOTO Lesson 4: Practice of the common emitter amplifier circuit of transistor 2N3904
- Ahhhh urgent help, please help me analyze the simple circuit diagram
- Inventory of several commonly used protection circuits
- 4G Small Base Station
- [AT-START-F403A Review] Part 1: Newbie Unboxing Experience
- Radar microwave division table