Article count:10804 Read by:13623255

Account Entry

Practical skills | Teach you hardware circuit design step by step

Latest update time:2020-07-07
    Reads:

When you first start working with circuit boards, you may be full of doubts and excitement at the same time. There is a lot of experience and knowledge about hardware circuits on the Internet that is dizzying, such as signal integrity, EMI, and PS design, which will definitely confuse you. Don't worry, everything should be done slowly.

1
general idea


When designing hardware circuits, you need to understand the big framework and architecture, but it is not easy to do this. Some big frameworks may have been thought out by your boss or teacher, and you just need to implement the ideas; but some of you need to design your own framework, so you need to understand what functions you want to achieve, and then look for reference circuit boards that can achieve the same or similar functions (you need to know how to make use of other people's achievements as much as possible, and the more experienced engineers are, the more they will know how to learn from others' achievements).

2
Understanding Circuits


If you have found a reference design, then congratulations, you can save a lot of time (including early design and later debugging). Copy it immediately? NO, it is better to read and understand it first, which can improve our circuit understanding ability and avoid mistakes in design.

3
Didn't find a reference design?


It doesn't matter. First, find the datasheet of the big IC chip to see if its key parameters meet your requirements, which are the key parameters you need, and whether you can understand these key parameters, which are all manifestations of the ability of hardware engineers, which also requires long-term and slow accumulation. During this period, you must be good at asking questions, because others can often enlighten you with just one sentence if you don't understand something, especially in hardware design.

4
Design hardware circuit


Hardware circuit design mainly consists of three parts: schematic diagram, PCB and bill of materials (BOM).


  • Schematic design is to convert the previous ideas into a circuit schematic, which is very similar to the circuit diagram in our textbooks.
  • PCB involves the actual circuit board, which places (lays out) the packages of specific components on the circuit board based on the netlist converted from the schematic diagram (the netlist is the bridge between the schematic diagram and the PCB), and then connects its electrical signals (wiring) according to flying wires (also called pre-drawn wires).
  • After completing the PCB layout and wiring, the components to be used should be summarized, so we will use the BOM table.

5
What tools to use?


Protel, also known as altimuml, is easy to use and is also popular in China. It is sufficient to handle general work and is suitable for novice designers.


In fact, whether you use simple Protel or complex Cadence tools, the major steps of hardware design are the same (the operation on Protel is similar to Windows, which is a post-command type; while Cadence's product Allegro is a pre-command type. This is the reason why you will feel uncomfortable when you are used to Protel and suddenly switch to Cadence tools).




Now let’s briefly talk about the design process:


Schematic library creation


To place a new component on the schematic, we must create a component library. The library mainly defines the pin definition and properties of the new component, and represents it in a specific graphical form (we often see a rectangle (representing its IC BODY) surrounded by many short lines (representing IC pins)).


Protel is very simple to create a library, and because it is used by many people, many components can find ready-made libraries, which is very convenient for users. You should understand the differences between IC body, IC pins, input pin, output pin, analog pin, digital pin, power pin, etc.
Draw the schematic


With sufficient libraries, you can draw on the schematic diagram. According to the requirements of the datasheet and system design, connect the relevant components through wires, and add line and text annotations in relevant places. The difference between wire and line is that the former has electrical properties, while the latter does not. Wire is suitable for connecting the same network, and line is suitable for annotating graphics. At this time, you should understand some basic concepts, such as: wire, line, bus, part, footprint, etc.


For example, post-command, if we want to copy an object (component), we first select the object, then press ctrl+C, and then press ctrl+V (the copy command occurs after the object is selected). This operation is adopted by both Windows and Protel. But Allegro is another way, which we call pre-command. Similarly, if we want to copy something, we first press ctrl+C, then select the object, and then click outside (the copy command occurs before the object is selected).
Generate netlist


After completing the previous step, we can generate a netlist, which is the bridge between the schematic diagram and the PCB. The schematic diagram is a form that we can recognize. If the computer wants to convert it into a PCB, it must convert the schematic diagram into a form it recognizes, the netlist, and then process and convert it into a PCB.
Electrical rules check


Draw PCB right after getting netlist? Don't worry, do ERC first. ERC is the abbreviation of electrical rule check. It can check some basic design errors of schematics, such as multiple outputs connected together. (But you must check your own schematics carefully and don't rely too much on tools. After all, tools cannot understand your system. They just check based on some basic rules.)
Get PCB


After getting the PCB from the netlist, are you shocked by the densely packed components and countless flying wires? Don't worry, you have to take your time.
Determine the frame size


Draw a board frame in the keepout area (or mechanical area), which will limit the area where you can route. You need to consider the board length and width (sometimes, the board thickness) according to your needs. Of course, you also need to consider the stackup. (Stackup means how many layers the board has and how to use them. For example, if the board has 4 layers in total, the top layer is for signals, the first layer in the middle is for power, the second layer in the middle is for ground, and the bottom layer is for signals).

layout


After the board frame is determined, it is time to layout (place) the components. This step is extremely critical. It often determines the difficulty of later wiring. Which components should be placed on the front and which components should be placed on the back must be considered. However, these are all issues of personal opinion, and the placement can be different from different perspectives.


In fact, if you draw the schematic yourself and understand the functions of all components, you will naturally have a clear understanding of component placement (if you ask someone who is not a schematic diagram drawer to place components, the result will often surprise you^_^). For beginners, pay attention to the isolation of analog components, digital components, and the placement of mechanical positions, and pay attention to the topology of the power supply.
wiring


The next step is wiring, which is often interactive with layout. Experienced people can often see which places can be successfully wired at the beginning. If some places are difficult to wire, the layout needs to be modified. For FPGA design, the schematic diagram is often modified to make the wiring smoother. There are many factors involved in wiring and layout issues. For high-speed digital parts, it becomes complicated because of the signal integrity issues involved, but these problems are often difficult to quantify or even difficult to calculate. Therefore, when the signal frequency is not very high, the first principle should be to make the wiring smooth.
Issues that need attention after layout and routing


OK? Don't worry, check it with DRC first, this is a must. DRC will mark the wiring completion coverage and rule violations, and check and correct them one by one according to this.


Some PCBs also need to add copper foil (which may increase costs), make the outgoing wires into teardrops (the factory may add this for you), and finally convert the PCB file into a gerber file before delivering it to PCB production. (Some PCBs can be delivered directly, and the factory will help you convert the gerber).


To prepare the BOM for PCB assembly, it can usually be directly exported from the schematic diagram. However, it should be noted that you should have a clear idea of ​​which parts of the schematic diagram should be installed and which parts should not be installed. For small batches or research boards, it is convenient to manage them yourself with Excel (large companies often use professional software to manage). For novices, it is not recommended to directly hand over the first version to the assembly factory or welding factory to weld all the BOM materials, which is not convenient for troubleshooting. The best way is to prepare the components yourself according to the BOM table. After the board arrives, add components and debug step by step.




Now let's talk briefly about debugging


What should you do first after getting the board? Don't rush to power on and test the function. Hardware debugging cannot be completed in one step. First use a multimeter to check if there is any abnormality in the key network, mainly to see if there is a short circuit between the power supply and the ground (although the manufacturer has done the test for you, you still have to check this step yourself. Sometimes some steps seem cumbersome, but it can save you a lot of time later!). In fact, short circuit is not only related to PCB, but may cause this problem in any link of production. IO short circuit generally does not cause catastrophic consequences, but power short circuit will...
Is the power network not short-circuited?


Well then, let's see if the power supply output is your ideal value. For beginners, it is best to debug the ICs one by one, and the first one to be debugged is the power supply chip.

Power network short circuit?


This is more troublesome, but you need to carefully look at your schematic to see if there is such a situation. At the same time, use the cutting method to step by step check where the short circuit is, whether it is a PCB problem (generally, this situation may occur in poor PCB factories), an assembly problem, or a problem with your own design.
The power chip has no output?


Check whether the input of your power chip is normal. Other places that need to be checked include the enable signal, voltage divider resistor, feedback network, etc.
The output value of the power chip is not within the expected range?


If the excess is outrageous, for example, up to 10%, then look at the voltage divider resistors first. These two voltage divider resistors generally have a precision of 1%. Have you achieved this? At the same time, look at the feedback network, which will also affect the range of your output power supply.
Is the output transition of the power supply normal?


If the power supply output is normal, don't be happy. If conditions permit, use an oscilloscope to see if the power supply output jump is normal. That is, capture the moment of power on to see the power supply from nothing to something.




Now let's talk briefly about power supply


Undoubtedly, power supply design is the most important part of the entire circuit board. If the power supply is unstable, nothing else can be discussed. In power supply design, the most common occasion we use is to get a stable "low" voltage from a stable "high" voltage.


This is what we often call DC-DC (direct current-direct current). There are two most commonly used power supply voltage regulator chips in DC-DC, one is called LDO (low dropout linear regulator, which we will refer to as linear voltage regulator later), and the other is called PWM (pulse width modulation switching power supply, which we also call switching power supply in this article). We often hear that PWM has high efficiency, but LDO has fast response. Why is this? Don't worry, let's take a look at their principles first.


The following will involve some theoretical knowledge, but it is still very easy to understand. If you don’t understand, hey, you need to check your basics.


Working principle of linear regulated power supply

Simple schematic diagram of the internal structure of a linear regulated power supply
The figure is a simple schematic diagram of the internal structure of a linear voltage regulator. Our goal is to obtain a low voltage Vo from a high voltage Vs. In the figure, Vo is divided by two voltage-dividing resistors to obtain V+, which is sent to the positive terminal of the amplifier (we call this amplifier the error amplifier), while the negative terminal of the amplifier Vref is the reference level inside the power supply (this reference level is constant).


The output Va of the amplifier is connected to the gate of the MOSFET to control the impedance of the MOSFET. When Va becomes larger, the impedance of the MOSFET becomes larger; when Va becomes smaller, the impedance of the MOSFET becomes smaller. The voltage drop across the MOSFET will be Vs-Vo.


Now let's see how Vo is stable. If Vo becomes smaller, then V+ will become smaller, and the amplifier's output Va will also become smaller, which will cause the MOSFET's impedance to become smaller. In this way, with the same current, the MOSFET's voltage difference will become smaller, so Vo is raised to suppress the decrease in Vo. Similarly, when Vo increases, V+ increases, Va increases, and the MOSFET's impedance increases. With the same current, the MOSFET's voltage difference increases, thus suppressing Vo from increasing.

Working Principle of Switching Power Supply

As shown in the figure above, in order to obtain Vo from the high voltage Vs, the switching power supply uses square waves Vg1 and Vg2 with a certain duty cycle to drive the upper and lower MOS tubes. Vg1 and Vg2 are in anti-phase, Vg1 is high, and Vg2 is low. When the upper MOS tube is turned on, the lower MOS tube is turned off; when the lower MOS tube is turned on, the upper MOS tube is turned off.


As a result, a square wave voltage with a certain duty cycle is formed at the left end of L. We can regard the inductor L and the capacitor C as a low-pass filter. Therefore, after the square wave voltage is filtered, the filtered stable voltage Vo is obtained.


After being divided by R1 and R2, Vo is sent to the negative terminal V+ of the first amplifier (error amplifier). The output Va of the error amplifier serves as the positive terminal of the second amplifier (PWM amplifier). The output Vpwm of the PWM amplifier is a square wave with a certain duty cycle. After being processed by the gate logic circuit, two inverted square waves Vg1 and Vg2 are obtained to control the switching of the MOSFET.


The positive terminal Vref of the error amplifier is a constant voltage, and the negative terminal Vt of the PWM amplifier is a triangular wave signal. Once Va is larger than the triangular wave, Vpwm is high; when Va is smaller than the triangular wave, Vpwm is low. Therefore, the relationship between Va and the triangular wave determines the duty cycle of the square wave signal Vpwm; when Va is high, the duty cycle is low, and when Va is low, the duty cycle is high.


After processing, Vg1 is in phase with Vpwm, and Vg2 is in anti-phase with Vpwm; finally, the square wave voltage Vp at the left end of L is the same as Vg1. As shown in the figure below

When Vo rises, V+ will rise, Va will fall, Vpwm duty cycle will fall, after gate logic, Vg1 duty cycle will fall, Vg2 duty cycle will rise, Vp duty cycle will fall, which will lead to Vo falling, so the rise of Vo will be suppressed. And vice versa.

Comparison between linear regulated power supply and switching power supply

After understanding the working principles of linear regulated power supplies and switching power supplies, we can understand why linear regulated power supplies have lower noise, faster transient response, but poor efficiency; while switching power supplies have higher noise, slower transient response, but higher efficiency.
The linear voltage regulator has a simple internal structure and a short feedback loop, so it has low noise and fast transient response (when the output voltage changes, the compensation is fast). However, because the voltage difference between the input and output falls on the MOSFET, its efficiency is low. Therefore, linear voltage regulator is generally used in applications with low current and high voltage accuracy requirements.


The switching power supply has a complex internal structure, and there are many factors that affect the output voltage noise performance. In addition, its feedback loop is long, so its noise performance is lower than that of a linear voltage regulator, and its transient response is slow. However, according to the structure of the switching power supply, the MOSFET is in two states: fully on and fully off. In addition to the energy consumed by driving the MOSFET and the internal resistance of the MOSFET itself, all other energy is used in the output (theoretically, L and C do not consume energy, although this is not the case in reality, but the energy consumed is very small).
Some misunderstandings about high-speed signals


High speed refers to the signal edge, not the clock frequency. Generally speaking, the higher the clock frequency, the faster the signal rising edge, so we usually treat them as high-speed signals; but the reverse is not necessarily true. If the clock frequency is low, but the signal rising edge is still fast, it should also be treated as a high-speed signal.


According to signal theory, the rising edge of a signal contains high-frequency information (a quantitative expression can be found using Fourier transform). Therefore, if the rising edge of a signal is very steep, we should process it as a high-speed signal. If the design is not good, the rising edge may be too slow, or there may be overshoot, undershoot, or ringing.


For example, the I2C signal has a clock frequency of 1MHz in ultra-fast mode, but its specification requires that the rise time or fall time should not exceed 120ns.


Therefore, we should pay more attention to the signal bandwidth. According to the empirical formula, the relationship between bandwidth and rise time (10%~90%) is Fw * Tr = 3.5.




Oscilloscope Selection


Be aware of your oscilloscope’s bandwidth


Many people pay attention to the sampling rate of the oscilloscope, but not the bandwidth of the oscilloscope. However, the bandwidth of the oscilloscope is often a more important parameter. Some people think that as long as the sampling rate of the oscilloscope is more than twice the signal clock frequency, it will be fine. This is a big mistake. The reason for the mistake is that the sampling theorem is misunderstood. The sampling theorem states that when the sampling frequency is greater than twice the maximum bandwidth of the signal, the original signal can be perfectly restored. However, the signal referred to by the sampling theorem is a band-limited signal (the bandwidth is limited), which is seriously inconsistent with the signal in reality.

Our general digital signals, except for the clock, are not periodic. In the long run, their spectrum is infinitely wide. To capture high-speed signals, their high-frequency components cannot be distorted too much. The oscilloscope bandwidth index is closely related to this. Therefore, what we really need to pay attention to is that the rising edge distortion of the signal captured by the oscilloscope is within our acceptable range.
So what bandwidth is appropriate for an oscilloscope?


Theoretically, an oscilloscope with 5 times the signal bandwidth will capture a signal with less than 3% loss of the original signal. If the loss requirement is more relaxed, you can choose a lower-end oscilloscope. An oscilloscope with 3 times the signal bandwidth should meet most requirements, but don't forget the bandwidth of your probe.

Disclaimer: This article is reprinted from the Internet, and the copyright belongs to the original author. If the videos, pictures, and texts used in this article involve copyright issues, please leave a message at the end of the article to let us know, and we will deal with it as soon as possible! The content of this article is the original author's point of view, and does not mean that this public account agrees with its point of view and is responsible for its authenticity.



July 9 live broadcast: Enjoy the purity - ams active noise reduction and proximity sensing bring a new level of headphone design

Make an appointment now and get a gift for viewing~

Highlights of the live broadcast: Digital hearing enhancement solutions, optical proximity in-ear detection, demos, potential applications


Since the WeChat official account has recently changed its push rules, if you want to see our articles frequently, you can click "Like" or "Reading" at the bottom of the page after each reading, so that each pushed article will appear in your subscription list as soon as possible.

Or set our public account as a star. After entering the public account homepage, click the "three dots" in the upper right corner, click "Set as Star", and a yellow five-pointed star will appear next to our public account name (the operation is the same for Android and iOS users).


Focus on industry hot spots and understand the latest frontiers
Please pay attention to EEWorld electronic headlines
https://www.eeworld.com.cn/mp/wap
Copy this link to your browser or long press the QR code below to browse
The following WeChat public accounts belong to
EEWorld (www.eeworld.com.cn)
Welcome to long press the QR code to follow us!

EEWorld Subscription Account: Electronic Engineering World
EEWorld Service Account: Electronic Engineering World Welfare Club

Latest articles about

 
EEWorld WeChat Subscription

 
EEWorld WeChat Service Number

 
AutoDevelopers

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building,Block B, 18 Zhongguancun Street, Haidian District,Beijing, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号