Basic rules of PCB layout

01
Basic rules of component layout
1. According to circuit modules, to make layout and related circuits that achieve the same function are called a module. The components in the circuit module should adopt the principle of nearby concentration, and the digital circuit and the analog circuit should be separated;
2. No components or devices shall be mounted within 1.27mm of non-mounting holes such as positioning holes, standard holes, and 3.5mm (for M2.5) and 4mm (for M3) of 3.5mm (for M2.5) and 4mm (for M3) shall not be allowed to mount components;
3. Avoid placing via holes under the horizontally mounted resistors, inductors (plug-ins), electrolytic capacitors and other components to avoid short-circuiting the vias and the component shell after wave soldering;
4. The distance between the outside of the component and the edge of the board is 5mm;
5. The distance between the outside of the mounting component pad and the outside of the adjacent interposing component is greater than 2mm;
6. Metal shell components and metal parts (shielding boxes, etc.) should not touch other components, and should not be close to printed lines and pads. The distance between them should be greater than 2mm. The size of the positioning hole, fastener installation hole, oval hole and other square holes in the board from the outside of the board edge is greater than 3mm;
7. Heating elements should not be in close proximity to wires and heat-sensitive elements; high-heating elements should be evenly distributed;
8. The power socket should be arranged around the printed board as far as possible, and the power socket and the bus bar terminal connected to it should be arranged on the same side. Particular attention should be paid not to arrange power sockets and other welding connectors between the connectors to facilitate the welding of these sockets and connectors, as well as the design and tie-up of power cables. The arrangement spacing of power sockets and welding connectors should be considered to facilitate the plugging and unplugging of power plugs;
9. Arrangement of other components:
All IC components are aligned on one side, and the polarity of the polar components is clearly marked. The polarity of the same printed board cannot be marked in more than two directions. When two directions appear, the two directions are perpendicular to each other;
10. The wiring on the board surface should be dense and dense. When the density difference is too large, it should be filled with mesh copper foil, and the grid should be greater than 8mil (or 0.2mm);
11. There should be no through holes on the SMD pads to avoid the loss of solder paste and cause false soldering of the components. Important signal lines are not allowed to pass between the socket pins;
12. The patch is aligned on one side, the character direction is the same, and the packaging direction is the same;
13. As far as possible, the polarized devices should be consistent with the polarity marking direction on the same board.

 

Component wiring rules

1. Draw the wiring area within 1mm from the edge of the PCB board and within 1mm around the mounting hole, wiring is forbidden;
2. The power line should be as wide as possible and should not be less than 18mil; the signal line width should not be less than 12mil; the cpu input and output lines should not be less than 10mil (or 8mil); the line spacing should not be less than 10mil;
3. The normal via is not less than 30mil;
4. Dual in-line: 60mil pad, 40mil aperture;
1/4W resistance: 51*55mil (0805 surface mount); when in-line, the pad is 62mil and the aperture is 42mil;
Infinite capacitance: 51*55mil (0805 surface mount); when in-line, the pad is 50mil, and the aperture is 28mil;
5. Note that the power line and the ground line should be as radial as possible, and the signal line must not be looped.

 

03
How to improve anti-interference ability and electromagnetic compatibility?
How to improve anti-interference ability and electromagnetic compatibility when developing electronic products with processors?

1. The following systems should pay special attention to anti-electromagnetic interference:
(1) A system where the microcontroller clock frequency is extremely high and the bus cycle is extremely fast.
(2) The system contains high-power, high-current drive circuits, such as spark-producing relays, high-current switches, etc.
(3) A system containing a weak analog signal circuit and a high-precision A/D conversion circuit.

2. Take the following measures to increase the anti-electromagnetic interference capability of the system:
(1) Choose a microcontroller with low frequency:
Choosing a microcontroller with a low external clock frequency can effectively reduce noise and improve the system’s anti-interference ability. For square waves and sine waves of the same frequency, the high frequency components in the square wave are much more than that in the sine wave. Although the amplitude of the high-frequency component of the square wave is smaller than the fundamental wave, the higher the frequency, the easier it is to emit as a noise source. The most influential high-frequency noise generated by the microcontroller is about 3 times the clock frequency.

(2) Reduce distortion in signal transmission
Microcontrollers are mainly manufactured using high-speed CMOS technology. The static input current of the signal input terminal is about 1mA, the input capacitance is about 10PF, and the input impedance is quite high. The output terminal of the high-speed CMOS circuit has a considerable load capacity, that is, a relatively large output value. The long wire leads to the input terminal with quite high input impedance, the reflection problem is very serious, it will cause signal distortion and increase system noise. When Tpd>Tr, it becomes a transmission line problem, and problems such as signal reflection and impedance matching must be considered.

The delay time of the signal on the printed board is related to the characteristic impedance of the lead, which is related to the dielectric constant of the printed circuit board material. It can be roughly considered that the transmission speed of the signal on the printed board leads is about 1/3 to 1/2 of the speed of light. The Tr (standard delay time) of the commonly used logic phone components in a system composed of a microcontroller is between 3 and 18 ns.

On the printed circuit board, the signal passes through a 7W resistor and a 25cm-long lead, and the delay time on the line is roughly between 4~20ns. In other words, the shorter the signal lead on the printed circuit, the better, and the longest should not exceed 25cm. And the number of vias should be as small as possible, preferably no more than two.
When the signal’s rise time is faster than the signal delay time, it must be processed in accordance with fast electronics. At this time, the impedance matching of the transmission line should be considered. For the signal transmission between the integrated blocks on a printed circuit board, the situation of Td>Trd should be avoided. The larger the printed circuit board, the faster the system speed cannot be.
Use the following conclusions to summarize a rule of printed circuit board design:
The signal is transmitted on the printed board, and its delay time should not be greater than the nominal delay time of the device used.

(3) Reduce the cross* interference between signal lines:
A step signal with a rise time of Tr at point A is transmitted to terminal B through lead AB. The delay time of the signal on the AB line is Td. At point D, due to the forward transmission of the signal from point A, the signal reflection after reaching point B and the delay of the AB line, a page pulse signal with a width of Tr will be induced after Td time. At point C, due to the transmission and reflection of the signal on AB, a positive pulse signal with a width of twice the delay time of the signal on the AB line, that is, 2Td, is induced. This is the cross-interference between signals. The intensity of the interference signal is related to the di/at of the signal at point C and the distance between the lines. When the two signal lines are not very long, what you see on AB is actually the superposition of two pulses.

The micro-control made by CMOS technology has high input impedance, high noise, and high noise tolerance. The digital circuit is superimposed with 100~200mv noise and does not affect its operation. If the AB line in the figure is an analog signal, this interference becomes intolerable. For example, the printed circuit board is a four-layer board, one of which is a large-area ground, or a double-sided board, and when the reverse side of the signal line is a large-area ground, the cross* interference between such signals will be reduced. The reason is that the large area of ​​the ground reduces the characteristic impedance of the signal line, and the reflection of the signal at the D end is greatly reduced. The characteristic impedance is inversely proportional to the square of the dielectric constant of the medium from the signal line to the ground, and proportional to the natural logarithm of the thickness of the medium. If the AB line is an analog signal, to avoid the interference of the digital circuit signal line CD to AB, there should be a large area under the AB line, and the distance between the AB line and the CD line should be greater than 2 to 3 times the distance between the AB line and the ground. It can be partially shielded, and ground wires are placed on the left and right sides of the lead on the side with the lead.

(4) Reduce noise from power supply
While the power supply provides energy to the system, it also adds its noise to the power supply. The reset line, interrupt line, and other control lines of the microcontroller in the circuit are most susceptible to interference from external noise. Strong interference on the power grid enters the circuit through the power supply. Even in a battery-powered system, the battery itself has high-frequency noise. The analog signal in the analog circuit is even less able to withstand the interference from the power supply.

(5) Pay attention to the high frequency characteristics of printed wiring boards and components
In the case of high frequency, the leads, vias, resistors, capacitors, and the distributed inductance and capacitance of the connectors on the printed circuit board cannot be ignored. The distributed inductance of the capacitor cannot be ignored, and the distributed capacitance of the inductor cannot be ignored. The resistance produces the reflection of the high-frequency signal, and the distributed capacitance of the lead will play a role. When the length is greater than 1/20 of the corresponding wavelength of the noise frequency, an antenna effect is produced, and the noise is emitted through the lead.

The via holes of the printed circuit board cause approximately 0.6 pf of capacitance.
The packaging material of an integrated circuit itself introduces 2~6pf capacitors.
A connector on a circuit board has a distributed inductance of 520nH. A dual-in-line 24-pin integrated circuit skewer introduces 4~18nH distributed inductance.
These small distribution parameters are negligible in this line of low-frequency microcontroller systems; special attention must be paid to high-speed systems.

(6) The layout of components should be reasonably partitioned
The position of the components on the printed circuit board should fully consider the problem of anti-electromagnetic interference. One of the principles is that the leads between the components should be as short as possible. In the layout, the analog signal part, the high-speed digital circuit part, and the noise source part (such as relays, high-current switches, etc.) should be reasonably separated to minimize the signal coupling between them.

G Handle the ground wire
On the printed circuit board, the power line and the ground line are the most important. The most important method to overcome electromagnetic interference is to ground.
For double panels, the ground wire layout is particularly particular. Through the use of single-point grounding, the power supply and ground are connected to the printed circuit board from both ends of the power supply. The power supply has one contact and the ground has one contact. On the printed circuit board, there must be multiple return ground wires, which will be gathered on the contact point of the return power supply, which is the so-called single-point grounding. The so-called analog ground, digital ground, and high-power device ground splitting refers to the separation of wiring, and finally all converge to this grounding point. When connecting with signals other than printed circuit boards, shielded cables are usually used. For high frequency and digital signals, both ends of the shielded cable are grounded. One end of the shielded cable for low-frequency analog signals should be grounded.
Circuits that are very sensitive to noise and interference or circuits that are particularly high-frequency noise should be shielded with a metal cover.

(7) Use decoupling capacitors well.
A good high-frequency decoupling capacitor can remove high-frequency components as high as 1GHZ. Ceramic chip capacitors or multilayer ceramic capacitors have better high-frequency characteristics. When designing a printed circuit board, a decoupling capacitor must be added between the power and ground of each integrated circuit. The decoupling capacitor has two functions: on the one hand, it is the energy storage capacitor of the integrated circuit, which provides and absorbs the charging and discharging energy at the moment of opening and closing the integrated circuit; on the other hand, it bypasses the high-frequency noise of the device. The typical decoupling capacitor of 0.1uf in digital circuits has 5nH distributed inductance, and its parallel resonance frequency is about 7MHz, which means that it has a better decoupling effect for noise below 10MHz, and it has a better decoupling effect for noise above 40MHz. Noise has almost no effect.

1uf, 10uf capacitors, the parallel resonance frequency is above 20MHz, the effect of removing high frequency noise is better. It is often advantageous to use a 1uf or 10uf de-high frequency capacitor where the power enters the printed board, even for battery-powered systems.
Every 10 pieces of integrated circuits need to add a charge and discharge capacitor, or called a storage capacitor, the size of the capacitor can be 10uf. It is best not to use electrolytic capacitors. Electrolytic capacitors are rolled up with two layers of pu film. This rolled up structure acts as an inductance at high frequencies. It is best to use a bile capacitor or a polycarbonate capacitor.

The selection of the decoupling capacitor value is not strict, it can be calculated according to C=1/f; that is, 0.1uf for 10MHz, and for a system composed of a microcontroller, it can be between 0.1uf and 0.01uf.

3. Some experience in reducing noise and electromagnetic interference.
(1) Low-speed chips can be used instead of high-speed chips. High-speed chips are used in key places.
(2) A resistor can be connected in series to reduce the jump rate of the upper and lower edges of the control circuit.
(3) Try to provide some form of damping for relays, etc.
(4) Use the lowest frequency clock that meets the system requirements.
(5) The clock generator is as close as possible to the device that uses the clock. The shell of the quartz crystal oscillator should be grounded.
(6) Enclose the clock area with a ground wire and keep the clock wire as short as possible.
(7) The I/O drive circuit should be as close as possible to the edge of the printed board, and let it leave the printed board as soon as possible. The signal entering the printed board should be filtered, and the signal from the high-noise area should also be filtered. At the same time, a series of terminal resistors should be used to reduce signal reflection.
(8) The useless end of MCD should be connected to high, or grounded, or defined as the output end. The end of the integrated circuit that should be connected to the power supply ground should be connected to it, and it should not be left floating.
(9) The input terminal of the gate circuit that is not in use should not be left floating. The positive input terminal of the unused operational amplifier should be grounded, and the negative input terminal should be connected to the output terminal. (10) The printed board should try to use 45-fold lines instead of 90-fold lines to reduce the external emission and coupling of high-frequency signals.
(11) The printed boards are partitioned according to frequency and current switching characteristics, and the noise components and non-noise components should be farther apart.
(12) Use single-point power and single-point grounding for single and double panels. The power line and ground line should be as thick as possible. If the economy is affordable, use a multilayer board to reduce the capacitive inductance of the power supply and ground.
(13) Keep the clock, bus, and chip select signals away from I/O lines and connectors.
(14) The analog voltage input line and reference voltage terminal should be as far away as possible from the digital circuit signal line, especially the clock.
(15) For A/D devices, the digital part and the analog part would rather be unified than handed over*.
(16) The clock line perpendicular to the I/O line has less interference than the parallel I/O line, and the clock component pins are far away from the I/O cable.
(17) The component pins should be as short as possible, and the decoupling capacitor pins should be as short as possible.
(18) The key line should be as thick as possible, and protective ground should be added on both sides. The high-speed line should be short and straight.
(19) Lines sensitive to noise should not be parallel to high-current, high-speed switching lines.
(20) Do not route wires under the quartz crystal or under noise-sensitive devices.
(21) For weak signal circuits, do not form current loops around low-frequency circuits.
(22) Do not form a loop for any signal. If it is unavoidable, make the loop area as small as possible.
(23) One decoupling capacitor per integrated circuit. A small high-frequency bypass capacitor must be added to each electrolytic capacitor.
(24) Use large-capacity tantalum capacitors or juku capacitors instead of electrolytic capacitors to charge and discharge energy storage capacitors. When using tubular capacitors, the case should be grounded.

 

04
PROTEL commonly used shortcut keys
Page Up Zoom in with the mouse as the center
Page Down Zoom out with the mouse as the center.
Home Center the position pointed by the mouse
End refresh (redraw)
* Switch between the top and bottom layers
+ (-) Switch layer by layer: “+” and “-” are in the opposite direction
Q mm (millimeter) and mil (mil) unit switch
IM measures the distance between two points
E x Edit X, X is the editing target, the code is as follows: (A)=arc; (C)=component; (F)=fill; (P)=pad; (N)=network; (S)=character ; (T) = wire; (V) = via; (I) = connecting line; (G) = filled polygon. For example, when you want to edit a component, press E C, the mouse pointer will appear “ten”, click to edit
The edited components can be edited.
P x Place X, X is the placement target, the code is the same as above.
M x moves X, X is the moving target, (A), (C), (F), (P), (S), (T), (V), (G) Same as above, and (I) = flip selection Part; (O) Rotate the selection part; (M) = Move the selection part; (R) = Rewiring.
S x select X, X is the selected content, the code is as follows: (I)=internal area; (O)=outer area; (A)=all; (L)=all on the layer; (K)=locked part; ( N) = physical network; (C) = physical connection line; (H) = pad with specified aperture; (G) = pad outside the grid. For example, when you want to select all, press S A, all the graphics light up to indicate that they have been selected, and you can copy, clear, and move the selected files.