The most basic process of designing a circuit board can be divided into three major steps: the design of the circuit schematic, the generation of a network table, and the design of a printed circuit board. Whether it is on the board layout or routing, etc. have specific requirements.
For example, input and output traces should be avoided as much as possible to avoid interference. Parallel routing of the two signal lines must be separated by grounding, and the wiring of two adjacent layers should be perpendicular to each other as much as possible. Parallel coupling is easy to occur in parallel. The power and ground wires should be placed as perpendicular to each other on two layers. In terms of line width, the digital circuit PCB can be made into a loop by using a wide ground line, that is, a ground net (the analog circuit cannot be used in this way), and copper is spread over a large area.
The following article explains the principles and some details of the PCB design of the microcontroller control board.
1. Component layout
In terms of component layout, the related components should be placed as close as possible. For example, clock generators, crystal oscillators, and CPU clock inputs are prone to noise, and should be placed close to them when placed. For those devices that are prone to noise, small current circuits, high-current circuit switching circuits, etc., try to keep them away from the logic control circuit and memory circuit (ROM, RAM) of the microcontroller, and if possible, make these circuits into circuits. The board is good for anti-interference and improves the reliability of the circuit operation.
2. Decoupling capacitor
Try to install decoupling capacitors on critical components such as ROM, RAM, etc. In fact, printed circuit board traces, pin connections, and wiring can all have large inductive effects. Large inductors can cause severe switching noise spikes on the Vcc trace. The only way to prevent switching noise spikes on the Vcc trace is to place a 0.1uF electronic decoupling capacitor between VCC and the power ground. If a surface mount component is used on the board, a chip capacitor can be used to directly abut the component and be fixed on the Vcc pin. It is best to use ceramic capacitors because of their low electrostatic loss (ESL) and high frequency impedance, and the stability of the capacitor temperature and time is also good. Try not to use tantalum capacitors because of its high impedance at high frequencies.
Pay attention to the following points when placing the decoupling capacitor:
Connect an electrolytic capacitor of about 100uF at the power input end of the printed circuit board. If the volume allows, the larger the capacitance, the better.
In principle, a 0.01uF ceramic capacitor needs to be placed next to each integrated circuit chip. If the space of the circuit board is too small to be placed, a 1-10 tantalum capacitor can be placed around every 10 chips.
For components with weak anti-interference ability, large current change during shutdown, and memory components such as RAM and ROM, a decoupling capacitor should be connected between the power supply line (Vcc) and the ground.
The lead of the capacitor should not be too long, especially the high-frequency bypass capacitor can not be leaded.
3. Ground wire design
In the MCU control system, there are many types of ground wires, such as system ground, shield ground, logic ground, analog ground, etc. Whether the ground wire is properly laid out will determine the anti-interference ability of the circuit board. When designing ground and ground points, you should consider the following questions:
The logic and the analog ground are to be separately routed, and they cannot be used together, and their respective ground lines are respectively connected to the corresponding power ground lines. At the time of design, the analog ground wire should be as thick as possible, and the grounding area of the lead end should be increased as much as possible. In general, the analog signal for input and output is preferably isolated from the microcontroller circuit by an optocoupler.
When designing the printed circuit board of the logic circuit, the ground line should form a closed loop form to improve the anti-interference ability of the circuit.
The ground wire should be as thick as possible. If the ground wire is very thin, the ground wire resistance will be large, causing the ground potential to change with the change of the current, causing the signal level to be unstable, resulting in a decrease in the anti-interference ability of the circuit. In the case where the wiring space allows, ensure that the width of the main ground wire is at least 2-3 mm or more, and the ground wire on the component leads should be about 1.5 mm.
Pay attention to the choice of grounding point. When the signal frequency on the circuit board is lower than 1MHz, since the electromagnetic induction between the wiring and the component has little influence, and the circulating current formed by the grounding circuit has a great influence on the interference, a grounding is adopted so that the loop is not formed. When the signal frequency on the circuit board is higher than 10MHz, the inductance of the PCB wiring design is obvious, and the ground line impedance becomes large. At this time, the circulation formed by the ground circuit is no longer a major problem. Therefore, multi-point grounding should be used to minimize the ground impedance.
·In addition to the current line size, the layout of the power line should be as thick as possible. In the PCB layout design, the wiring direction of the power line and the ground line should be consistent with the line of the data line. Finally, the ground wire is used to fill the bottom layer of the board without traces. These methods help to enhance the anti-interference ability of the circuit.
The width of the data line should be as wide as possible to reduce the impedance. The width of the data line is at least 0.3mm (12mil), which is more ideal if it is 0.46~0.5mm (18mil~20mil).
Since a via of the board will cause a capacitive effect of about 10pF, this will introduce too much interference for the high frequency circuit, so the number of vias should be reduced as much as possible in the PCB layout design. Furthermore, too many vias can cause a decrease in the mechanical strength of the board.