Phone

    00852-6915 1330

ic Related Articles

Stay Ahead with Expert Electronics Insights,
Industry Trends, and Innovative Tips

FPGA

FPGA - Characteristics, New Applications and Development Trend

Introduction Everyone has heard of FPGA more or less, such as Bitcoin mining, or Microsoft said before that it will use FPGA instead of CPU in the data center. So what exactly is it? Why use it? Compared with CPU, GPU, and ASIC, what are the characteristics of FPGA? FPGA is a chip that can reconfigure circuits and is a hardware reconfigurable architecture. Through programming, users can change its application scenarios at any time, and it can simulate various parallel operations of hardware such as CPU and GPU. By interconnecting with the high-speed interface of the target hardware, the FPGA can complete the low-efficiency part of the target hardware, thereby achieving acceleration at the system level. What Is an FPGA? Catalog Introduction Ⅰ FPGA vs CPU vs GPU vs ASIC Ⅱ Five Advantages of FPGA 2.1 Performance 2.2 Time-to-Market 2.3 Cost 2.4 Stability 2.5 Long-Term Maintenance Ⅲ New Applications of FPGA Ⅳ Development Trend of FPGA Ⅴ FAQ Ⅰ FPGA vs CPU vs GPU vs ASIC The core difference between FPGA and CPU, GPU, ASIC chips, etc. is that the connection and logic layout of the underlying operation unit are not solidified. Users can program the logic unit and switch array through EDA software to configure the function, so as to realize the integration of specific functions.FPGA appears as a semi-custom circuit in the field of application-specific integrated circuits (ASIC), which not only solves the shortcomings of custom circuits, but also improves the limited number of original programmable device gate circuits. Compared with ASIC chips, an important feature of FPGA is its programmable characteristics, that is, the user can specify the FPGA to realize a specific digital circuit through the program. Furthermore, FPGA chips are one of the best choices for small batch systems to improve system integration and reliability. Figure 1. FPGA Basic Structure So why is FPGA so fast? This is all because the computer's CPU(central processing unit) and GPU(graphics processing unit) belong to the von Neumann structure, with instruction decoding and execution, and shared memory. FPGAs, on the other hand, are instruction-free and memory-free architectures that make FPGA chips much more energy-efficient than CPUs or even GPUs. Figure 2. Von Neumann Structure In the von Neumann architecture, since the execution unit (such as the CPU core) may execute any instruction, so an instruction memory, a decoder, an operator of various instructions, and branch and jump processing logic are required. Due to the complex control logic of the instruction stream, it is impossible to have too many independent instruction streams. Therefore, the GPU uses SIMD (single instruction, multiple data) to allow multiple execution units to process different data at the same pace, and the CPU also supports SIMD instruction. The function of each logic unit of the FPGA has been determined during reprogramming, and no instructions are required. Figure 3. Computer CPU If the GPU is used for acceleration, in order to fully utilize the GPU computing, the batch size cannot be too small, and the delay will be on the order of milliseconds. Using FPGA to accelerate, only microsecond-level PCle delay is required. Why is FPGA so much lower latency than GPU? This is basically an architectural difference. FPGAs have both pipeline parallelism and data parallelism, while GPUs have almost only data parallelism (with limited pipeline depth).For example, FPGA chips can change the running hardware design on the chip every few seconds, while chips such as CPU and ASIC are already solidified when they leave the factory and cannot be changed. If ASIC, CPU, GPU, etc. are built buildings, and the routes of rooms, corridors, and stairs in the building have been fixed, while the interior of FPGA is similar to the magic staircase in Hogwarts, which can change the route of room to room at any time. In addition, FPGA does not need to compile the instruction system at the software application level like CPU and GPU. To program FPGA, use hardware description language, and directly compile and burn it into a combination of transistor circuits, that is, directly use transistor circuits to implement user algorithms.The biggest feature of FPGA is its flexibility. It can realize any digital circuit you want and can customize various circuits. Reduce the shackles of special chips, truly tailor-made for your own products, you can flexibly change the design during the design process, and have field programmability, so it is especially suitable for applications that require continuous changes in physical operation logic, such as AI algorithm optimization, data center applications, etc. Architecture Throughput(int ops) Delay Flexibility CPU ~1T N/A Very High GPU ~10T ~1ms High FPGA(Stratix V) ~1T ~1us High FPGA(Stratix 10) ~10T ~1us High ASIC ~10T ~1us Low The FPGA is set up by the RAM stored on the chip to reset its working state, so the on-chip RAM needs to be programmed when working. Users can use different programming methods according to different configuration modes, which can be said to be very flexible and convenient. The FPGA has the following configuration modes:🔺Parallel Mode: Parallel PROM, Flash configures FPGA.🔺Master-Slave Mode: One PROM configures multiple FPGAs.🔺Serial Mode: Serial PROM configures FPGA.🔺Peripheral Mode: The FPGA is used as a peripheral of the microprocessor and programmed by the microprocessor. Computational performance compared with CPU: For example, Stratix series FPGAs perform integer multiplication operations, and their performance is equivalent to that of a 20-core CPU, and for floating-point multiplication operations, their performance is equivalent to an 8-core CPU.Computational performance compared with GPU: FPGA performs integer multiplication and floating-point multiplication operations. There is an order of magnitude difference in performance compared to GPU. The computing performance of GPU can be approached by configuring multipliers and floating-point operation components. Figure 4. CPU and GPU Architecture Diagram The core advantage of FPGA for performing computation-intensive tasks: tasks such as search engine sorting and image processing have strict requirements on the return time limit of results, and it is necessary to reduce the delay of computing steps. Under the traditional GPU acceleration scheme, the data packet size is large, and the delay can reach the millisecond level. Under the FPGA acceleration scheme, the PCIe latency can be reduced to the microsecond level. Driven by long-term technology, the data transmission delay between CPU and FPGA can be reduced to less than 100 nanoseconds.The FPGA can build the same number of pipelines (pipeline parallel structure) for the number of data packet steps, and the data packets can be output immediately after being processed by multiple pipelines. The GPU data parallel mode relies on different data units to process different data packets, and the data units need to be input and output consistently. For stream computing tasks, the FPGA pipeline parallel structure has a natural advantage in latency. FPGA is used to process communication-intensive tasks and is not limited by network cards. It outperforms CPU solutions in terms of packet throughput and delay, and has strong delay stability. Therefore, FPGAs have obvious advantages over CPUs when performing large data processing tasks with high repetition rates.By programming the FPGA, the user can change the internal connection structure of the chip at any time to realize any logic function. Especially in industries with immature technical standards or rapid development and change, FPGA can effectively help enterprises reduce investment risks and sunk costs, and is a functional and economical choice. Figure 5. Computer GPU With the evolution of intelligent market demand, highly customized chips (ASIC SoC) have led to a sharp increase in market risks due to the large scale of non-repetitive investment and long R&D cycle. Relatively speaking, FPGA has advantages in the field of parallel computing tasks, and can replace some ASICs in the field of high performance and multi-channel. The demand for multi-channel computing tasks in the field of artificial intelligence (AI) drives the evolution of FPGA technology to the mainstream. Figure 6. ASIC SoC Ⅱ Five Advantages of FPGA 2.1 Performance Taking advantage of hardware parallelism, FPGAs break the sequential execution model and complete more processing tasks per clock cycle, surpassing the computing power of digital signal processors (DSPs). BDTI(Big Data Test Infrastructure), a well-known analysis and benchmarking company, has published benchmarks that show that in some applications, FPGAs can handle many times more processing power per dollar than DSP solutions. Controlling input and output (I/O) at the hardware level provides faster response times and specialized functionality to meet application needs. 2.2 Time-to-Market Despite increasing time-to-market constraints, FPGA technology offers flexibility and the ability to rapidly prototype. Users can test an idea or concept and complete verification in hardware without going through the lengthy manufacturing process of custom ASIC design. This allows users to make incremental modifications and iterate FPGA designs in hours, saving weeks. Commercial off-the-shelf (COTS) hardware provides different types of I/O connected to user-programmable FPGA chips. The increasing popularity of high-level software tools reduces the learning curve and abstraction layers, and often provides useful IP cores (pre-built functions) for advanced control and signal processing. 2.3 Cost The non-recurring engineering (NRE) cost of custom ASIC design far exceeds the cost of FPGA-based hardware solutions. The huge initial investment in ASIC design shows that OEMs need to ship thousands of chips each year, but more end users need custom hardware capabilities that enable the development of tens to hundreds of systems. The nature of programmable chips means that users can save on manufacturing costs as well as long lead times for assembly. System requirements change from time to time, but the cost of changing the FPGA design is negligible compared to ASCI's huge expense. 2.4 Stability Software tools provide the programming environment, and FPGA circuits are the real "hard" implementation of programming. Processor-based systems often contain multiple layers of abstraction that can schedule tasks and share resources among multiple processes. The driver layer controls hardware resources, while the operating system manages memory and processor bandwidth. For any given processor core, only one instruction can be executed at a time, and processor-based systems face the risk of tightly time-bound tasks taking over each other at all times. FPGAs, on the other hand, do not use an operating system, and have true parallel execution and deterministic hardware that focuses on each task, reducing the chance of stability issues. 2.5 Long-Term Maintenance As mentioned above, FPGA chips are field-upgradable without the time and expense involved in redesigning ASICs. For example, digital communication protocols contain specifications that can change over time, and ASIC-based interfaces can create maintenance and forward compatibility difficulties. Reconfigurable FPGA chips can accommodate future modifications. As a product or system matures, users can enhance functionality without spending time redesigning hardware or modifying board layouts.   Ⅲ New Applications of FPGA At present, the FPGAs mainly produced by Xilinx and Altera with the highest market share, which are all based on SRAM technology, and need to be connected to an external memory to save the program when in use. When powered on, the FPGA reads the data in the external memory into the on-chip RAM, and after completing the configuration, it enters the working state. When power off, the FPGA returns to a white chip, and the internal logic disappears. In this way, the FPGA can not only be used repeatedly, but also does not require a special programmer, but only a general EPROM and PROM programmer. So Actel, QuickLogic and other companies also provide FPGAs with anti-fuse technology, which can only be downloaded once. They have the advantages of anti-radiation, high & low temperature resistance, low power consumption and fast speed. They are widely used in military and aerospace fields. FPGA cannot be erased and written repeatedly, which is troublesome and expensive in the early stage of development. Lattice is the inventor of ISP technology, which has certain characteristics in small-scale PLD applications. Early Xilinx products generally did not involve military and aerospace markets, but now a number of products such as Q Pro-R have entered such fields.In the industrial field, FPGA chips are widely used in the industrial field, and are widely used in video processing, image processing, CNC machine tools and other fields to realize signal control and operation acceleration functions. With the development of intelligence and automation technology, the industrial field is gradually shifting from human resources as the core element to intelligent unmanned factories with automation as the core element.Smart electric vehicles will be the mainstream development direction of the automotive industry in the future. At present, the application of FPGA in automotive cameras and sensors is relatively mature. In the artificial intelligence system of automatic/intelligent driving vehicles, the applicability of FPGA will be the most suitable for processing sophisticated ADAS and autonomous driving. Figure 7. FPGA for Auto In the field of automotive electronic system interface and control, FPGA chips are used to control and drive electric vehicle motor control systems, connect various in-vehicle equipment such as driving systems, instrument panels, radar, ultrasonic sensors, etc. control. In the field of video bridging and fusion, FPGA chips can be used to realize functions such as signal bridging of multiple image sensors, 3D surround view video fusion, reversing auxiliary video, and assisted driving video.In the field of communication, the number of 5G base stations has increased, and the FPGA usage of a single base station has increased, driving the increase in FPGA demand. According to estimates, the FPGA consumption of a 5G single base station is expected to increase from 1-3 blocks in the 4G period to 4-5 blocks in the 5G period. Figure 8. RFSoC FPGA Board Target 5G eFPGA technology is superior to traditional FPGA solutions in terms of performance, cost, power consumption, profitability, etc., and can provide flexible solutions for different application scenarios and different market segments. The economic trend of increasing design complexity and falling equipment costs has stimulated the market demand for eFPGA technology.   Ⅳ Development Trend of FPGA First of all, with the commercialization of the new generation of communication technology, the demand for products such as communication base stations, servers, and intelligent terminals will further expand, thereby driving the increase in the market demand for FPGA chips. At the same time, smart cities, smart factories, and consumer electronics pay more attention to the functionality of various smart IoT devices, which will drive the wide application of FPGA chips in smart IoT devices. With the development of the Internet of Vehicles technology, the scale of the use of FPGA chips in the automotive industry will increase day by day to build a more complete Internet of Vehicles and realize smarter autonomous driving functions. Therefore, with the rapid penetration of 5G, the vigorous development of AI and the increasing trend of automotive intelligence, it is expected that the demand for FPGAs in the three fields of communication, AI and automotive electronics will continue to increase in the future, which will also promote The FPGA industry continues to grow.   Ⅴ FAQ 1. What is FPGA and why it is used?The acronym FPGA stands for Field Programmable Gate Array. It is an integrated circuit that can be programmed by a user for a specific use after it has been manufactured. ... These blocks create a physical array of logic gates that can be customized to perform specific computing tasks. 2. Is FPGA faster than GPU?The difference between GPU and FPGA performance is not a static factor, but it does depend on the size of the data set. A study by Sanaullah and Herbordt [7] revealed that FPGA can compute small samples of 3D FFT tens of times faster than GPU. The difference is less clear when the data set gets bigger. 3. Is FPGA faster than CPU?A FPGA can hit the data cell faster and more often than a CPU can do it meaning the FPGA causes more results to occur during an attack. It all goes faster when an FPGA is used. And as a side benefit, no trace of all this is left on the CPU because it's never touched when an FPGA is used. 4. Are FPGAs efficient?Efficiency and Power: FPGAs are well-known for their power efficiency. A research project done by Microsoft on an image classification project showed that Arria 10 FPGA performs almost 10 times better in power consumption. 5. Is FPGA programming hard?FPGA vendors have touted their wares as ideal replacements for DSPs, CPUs, and GPUs – even for all of them in a single device – but they are notoriously difficult for software engineers to program as they are not anything like a conventional processor. 6. What can you do with FPGAs?Uses for FPGAs cover a wide range of areas—from equipment for video and imaging, to circuitry for computer, auto, aerospace, and military applications, in addition to electronics for specialized processing and more. 7. What is the difference between processor and FPGA?Microprocessor vs FPGA: A microprocessor is a simplified CPU or Central Processing Unit. ... An FPGA doesn't have any hardwired logic blocks because that would defeat the field programmable aspect of it. An FPGA is laid out like a net with each junction containing a switch that the user can make or break. 8. What language is used to program FPGA?VerilogTraditionally, FPGAs are programmed using pro-level hardware-description languages such as Verilog or VHDL. 9. How many times can you program an FPGA?There is effectively no limit to the number of times a device can be reconfigured; the configuration is stored in SRAM, which has no write limit. most Fpgas can be passively loaded from a processor, one word at a time. That processor can get the FPGA image from anywhere. 10. What are the advantages of FPGA?FPGA advantagesLong-term availabilityUpdating and adaptation at the customerVery short time-to-marketFast and efficient systemsAcceleration of softwareReal-time applicationsMassively parallel data processing 11. How do you make an FPGA?FPGA design checklistMake sure you have plenty of time to spare.Find a decent computer.If you can afford it, add a big display.Decide which operating system to use.Consider using a virtual machine (VM).Select an FPGA vendor.Pick out a suitable development board.Select an embedded processor to use. 12. What is FPGA for beginners?FPGA stands for Field Programmable Gate Array. As you may already know, FPGA essentially is a huge array of gates that can be programmed and reconfigured any time anywhere. Huge array of gates is an oversimplified description of FPGA. FPGA is indeed much more complex than a simple array of gates. 13. What is FPGA in Verilog?FPGAs are nothing, but reconfigurable logic blocks and interconnects can be programmed by Hardware Description Language like Verilog/ VHDL to perform a specific functionality. 14. Do we need to program the FPGA once powered off?If you have a SRAM-based FPGA, like the Spartan 3, then you have to program it each time it is powered up. The reason for this is that the SRAM which stores the configuration is volatile and loses the programmed configuration after power is switched off. 15. How is FPGA different from microcontroller?One of the main differences between a microcontroller and an FPGA is that an FPGA doesn't have a fixed hardware structure, while a microcontroller does. While FPGAs include fixed logic cells, these, along with the interconnects, can be programmed in parallel by using HDL coding language.
Ivy On 2022-01-26   1292
Power

Grounding Analysis in Electricity with Circuit Diagrams

Introduction The introduction of grounding technology was originally a protective way to prevent electrical or electronic equipment from being struck by lightning. At the same time, it is also an effective means to protect personal safety. When the phase line (such as poor wire insulation, aging, etc.)  touches the equipment shell for some reason, dangerous voltage will be generated on the equipment shell, thus the generated fault current will flow through the PE line to the ground, thus playing a protective role. With the development of electronic communication and other digital fields, only considering lightning protection and safety in the grounding system is far from meeting the requirements. Electrical Grounding Explained | Basic Concepts Catalog Introduction Ⅰ Basic: Q&A Related to Electrical Ground Ⅱ DC Power Supply Ground 2.1 Basic Overview 2.2 DC Power Supply Ground Analysis with Diagrams 2.3 Ground Bounce for Buck Converters 2.4 Ground Bounce for Boost Converters 2.5 Summery Ⅲ Useful Concepts for Grounding Analysis Ⅳ Conclusion Ⅴ FAQ Ⅰ Basic: Q&A Related to Electrical Ground The signal between each device needs a "ground" as the reference ground of the signal. Moreover, with the complexity of electronic equipment, the signal frequency is getting complicated. Therefore, in the grounding design, special attention must be paid to electromagnetic compatibility issues such as mutual interference between signals. Otherwise, improper grounding will seriously affect the reliability of system operation. Here the following are doubts that may arise in the power grounding. Q1: What is the definition of grounding?A: As for grounding concepts, to line engineers, the term usually means "reference point for line voltage". For system designers, it is often a cabinet or rack. For electrical engineers, it means green safety ground or connection to the earth. A more general definition is "A ground is a low impedance path for current to return to its source", and the key points are "low impedance" and "passage". Q2: What are the common grounding symbols in circuit?A: PE, PGND, FG-protective ground or chassisBGND or DC-RETURN-DC-48V (+24V) power supply (battery) returnGND: working groundDGND: digital groundAGND: analog groundLGND: lightning protection ground Q3: What is the appropriate grounding method?A: There are many ways to ground, including single-point grounding, multi-point grounding and mixed types of grounding. Among them, the single is divided into series single-point grounding and parallel single-point grounding. Generally speaking, single-point grounding is used for simple circuits, while grounding distinction between different functional modules, and multi-point grounding or multi-layer boards (complete ground plane layer) are used in low-frequency (f10MHz) circuits. Q4: Why should the analog ground and digital ground be separated?A: Both the analog signal and the digital signal return to the ground, the digital signal changes fast with large noise, while the analog signal needs a clean ground reference to work. If the analog and digital grounds are mixed, noise can affect the analog signal.According to the above mentioned, the analog ground and the digital ground should be processed separately, and then connected together through thin wires, or together at a single point. The general idea is to try to block the noise on the digital ground from flowing to the analog ground. Of course, this is not a very strict requirement that they must be separated, because it depends on the actual situation. Q5: How to ground the signal on the board?A: Under normal circumstances, it is best to use the nearest ground when designing, and after a complete multi-layer board design, it is very easy to ground common signals. The basic principle is to ensure the continuity of the traces and reduce number of vias, close to ground plane or power plane, etc. Q6: How to ground the interface devices of the board?A: Some single boards have external input and output interfaces, such as serial port connectors, network port connectors, etc, if they are not properly grounded, it will also affect normal work, such as network port interconnection errors, packet loss, etc., and will become an external source of electromagnetic interference, sending the noise inside the board to the outside. Generally speaking, an independent interface ground will be divided, and the connection with the signal ground will be connected by thin traces, and a o small resistance or 0ohm resistor can be connected in series. Thin traces can be used to block signal ground noise from passing to the interface ground. Similarly, the filtering of interface ground and interface power should also be carefully considered. Q7: How to ground the shielding layer in the cable with shielding layer?A: The layer of the shielded cable must be connected to the interface ground of the single board, not the signal ground. This is because there are various noises on the signal ground. If the shielding layer is connected to the signal ground, the noise voltage will drive the common mode current along the shielding. Therefore, cables with unreasonable design are generally the largest noise output source of electromagnetic interference.   Ⅱ DC Power Supply Ground 2.1 Basic Overview In power supply design, safety is often in the first place, and the same is true in switching power supplies. Grounding can protect the personal safety of users and ensure the normal operation of power equipment. So what is the appropriate grounding method in switching power supplies? What are the common ground symbols in circuits? This article will popularize the grounding basic in DC power supplies.DC-DC is a commonly used power supply circuit in electronic hardware design. It has high efficiency in realizing high input voltage and low output voltage. It is widely used, from power adapters, mobile phone chargers, and internal power conversion of electronic equipment to DC-DC circuits. Each semiconductor manufacturer has its own DC-DC chips, and also there are many optional chips. For a well-designed DC-DC circuit, not only the peripheral resistance, capacitance, but also the inductance parameters of the DC-DC circuit should be considered. There are also high requirements for the PCB layout design. This paper proposes a method to guide the grounding in the PCB layout from the perspective of the current flow in DC circuits. 2.2 DC Power Supply Ground Analysis with Diagrams Circuit grounding looks simple in a circuit schematic, but the actual characteristics of a circuit are determined by the layout of its PCB. And the analysis of the grounding point is very difficult, especially for the DC-DC converter circuit, the grounding point of the circuit will gather a large current that changes rapidly. When grounded nodes move, system performance suffers and the system radiates EMI. Here a good understanding of the physical nature of "ground" induced ground noise can provide an intuitive understanding of ground noise reduction problems.The change of the transmission current in the ground loop will generate a magnetic field in the loop. The magnetic field strength is proportional to the current, and the magnetic flux is proportional to the product of the loop area and the magnetic field strength, which is expressed by the formula: Figure 1. Right Hand Rule Suppose there is a sudden break in the current loop, as shown in Figure 2. When the switch is turned off, the magnetic flux disappears, which will generate a large transient voltage along the wire. If part of the wire is a grounding return pin, the voltage referenced to the ground level will have a spike, resulting in a false signal in any circuit that uses that pin as a ground reference. Figure 2. Function of Start Switch The traces on the PCB circuit board are not ideal wires and have resistance. 1 ounce (oz) copper has a resistance of 500 microohms/square, so a 1 amp change in current will only produce a bounce voltage of 500uV/square -- the problem only exists if you use long thin traces or daisy chain grounds or Precision electronic circuits.The best way to reduce ground bounce in a DC-DC switching circuit is to control the magnetic flux variation—minimizing current loop area and loop area variation. The principle of DC-DC circuit buck or boost is to use electronic switches to quickly switch to charge and discharge the energy storage element to achieve voltage conversion, and at the same time change the loop area of the current in the circuit, resulting in ground bounce and electromagnetic radiation.In some cases, as shown in Figure, the current remains constant, while the switching causes a change in the loop area and therefore a change in the magnetic flux. In switching state 1, an ideal voltage source is connected to an ideal current source through an ideal conductor. In addition, current flows in a loop that includes a ground return.In switch state 2, the same current flows in different paths when the switch changes position. The current source is DC and there is no change, but the loop area has changed. A change in the loop area means a change in the magnetic flux, so a voltage is generated. Because the ground loop is part of the change loop. Figure 3. Figure Loop Area In the case of switching changes, the loop area changes. Everywhere along the wire in the lower left, when the current I1 becomes 0, a voltage is generated where the magnetic field disappears. 2.3 Ground Bounce for Buck Converters The buck converter (step-down converter) circuit is very similar to the circuit structure in Figure 3 above, and the circuit of the step-down converter is simplified, as shown in Figure. Figure 4. Step-down Converter Circuit At high frequencies, a large capacitor such as the input capacitor Cin of the step-down converter can be regarded as a DC voltage source. Similarly, an inductor such as the output inductor LBuck can be regarded as a DC current source. These approximations help to visualize understanding and theoretical analysis.As shown in Figure 5, when the switch alternates between the two positions, the change in the path through which the current flows causes a change in the magnetic flux. The large inductor LBuck keeps the output current approximately constant. Similarly, the large capacitor Cin holds the voltage approximately equal to Vin. Since the voltage across the input lead inductance does not change, the input current also remains approximately constant. Figure 5. Effect of Switch on Loop Area Although the input current and output voltage are essentially constant, when the switch is switched from position 1 to position 2, the total loop area rapidly changes by half. Loop area changes imply rapid changes in magnetic flux, causing ground bounce along the loop circuit.In practice, a buck converter consists of a pair of semiconductor electronic switches, as shown in Figure 6. Although the complex procedure increases in each figure, the analysis method for ground bounce caused by changes in magnetic flux remains simple and intuitive. Figure 6. Magnetic Flux Changes Cause Ground Bounce The fact that changes in magnetic flux create voltages along the ground loop raises an interesting question: where is the real ground? Because ground bounce means that, to some ideal point called ground (that point needs to be defined), a bounce voltage is created on the ground return trace. In a power regulator circuit, the real ground should be connected to the low-voltage side of the load. After all, the purpose of a DC-DC converter is to provide a stable voltage and current to the load. All other points on the current loop are not true ground, but the part of ground loop.Since the low-voltage end of the load is grounded and the change in the loop area is the cause of the ground bounce, then reducing the ground bounce and electromagnetic radiation, and optimizing the grounding of the circuit are to minimize the current loop area in the DC-DC circuit. Here is a way to optimize the layout. For example, the location of the input capacitor, output capacitor, and energy storage inductor reduces the current loop area. Figure shows how to carefully place the input capacitor Cin to reduce the loop area and ground bounce. Figure 7. Reduce Ground Bounce Capacitor Cin in Figure bypasses the high-side switch on the top layer of the PCB directly to both ends of the bottom low-side switch, thereby reducing the variation in loop area and isolating it from the ground return. When the switch switches from one state to another, from the bottom of Vin to the bottom of the load, there is no loop area change or switch current change. Therefore no ground bounce occurs in the ground loop.Figure is an unreasonable PCB layout. When the high-side switch is turned on, the DC current flows along the red loop of the outer ring. When the low-side switch is turned on, the DC current flows along the blue loop. It can be seen that this circuit layout produces a large loop change when the switch changes, causing a change in the magnetic flux, resulting in ground bounce and electromagnetic radiation interference. Figure 8. Unreasonable Layout For the clarity, in single-layer PCB routing, even using a second-layer monolithic ground plane cannot solve the bounce caused by grounding. Figure 9 is a simple box to illustrate that the ground plane cannot solve the problem. Here we use a double layer PCB to add a bypass circuit at the top level power line vertical. Figure 9. Ground Floor In the Figure 9 (a), the ground plane is monolithic and uncut. The top layer print current flows through the capacitor, through the via, and to the ground plane. Because AC always flows along the path of least impedance, ground return current returns to the power source around the corners of its path. So when the amplitude or frequency of the current changes, the magnetic field of the current and its loop area change, thereby changing the magnetic flux. The regularity of current flow along the path of least impedance means that ground bounce can occur even with a monolithic ground plane - independent of its conduction.In the Figure 9 (b), a properly cut ground plane limits the return current to minimize loop area, thus greatly reducing ground bounce. Any residual ground bounce voltage developed within the cut return line is isolated from the common ground plane.The PCB layout in Figure 10 uses a double-layer PCB to mount the input capacitor and two switches on islands in the ground plane. This wiring doesn't have to be the best, but it works well and speaks to key points. It should be noted that the loop area surrounded by the red and blue currents is large, but the difference between the two loop areas is small. A small change in loop area means a small change in magnetic flux—small ground bounce. However, in general, keep the loop area small. Figure 10. is just to illustrate the importance of AC current path matching. Figure 10. Converter Layout   Additionally, ground bounce along any ground loop is limited by ground cutting within ground loop islands where magnetic fields and loop areas vary. Also, it may appear at first glance that the input capacitance Cin is not located between the top-level high-side switch and the lower-level low-side switch shown in Figure 10. Although physical proximity can be fine, what really works is the electronic proximity achieved by minimizing the loop area. 2.4 Ground Bounce for Boost Converters A boost converter (step-down converter) is actually a reflection of a buck converter, as shown in Figure 11, where the output capacitor must be placed between the top high-side switch and the bottom low-side switch to minimize loop area change. Figure 11. Changes in Loop Area In the same way that a buck converter places Cvin at a critical position, a boost converter places Cvout at a key position. 2.5 Summery The ground bounce voltage is mainly due to changes in the magnetic flux. In a DC-DC switching power supply, the magnetic flux variation is caused by switching the DC current at high speed between different current loop areas. But careful placement of the buck converter's input capacitors and the boost converter's output capacitors, and a good cut of the ground plane can isolate ground bounce. Pay attention to, it is important to be careful when cutting the ground plane to avoid increasing the loop area for other return currents in the circuit.Another reasonable layout should place the real ground on the bottom layer connecting the load, which will not cause changes in loop area or current. Any other point related to conduction can be called "ground", but it's just a point along the return path.   Ⅲ Useful Concepts for Grounding Analysis If you follow the basic concepts, you will have a clear idea of what will cause ground bounce. Figure 12. shows that two conductors that are perpendicular to each other are not subject to the mutual influence of the magnetic field. Figure 12. Two Conductors Perpendicular to Each Other   The magnetic field lines created around two parallel wires carrying equal currents in the same direction traditionally cancel each other out between the two wires, so the total energy stored by the two wires is less than the energy stored by one wire alone. Therefore, the inductance of PCB wide traces is smaller than that of narrow traces. Figure 13. Two Parallel Wires with Current Flowing in Same Directions   The magnetic field lines generated around two equal conductors carrying equal currents in opposite directions cancel each other out of the two conductors, and strengthen between the two conductors. If the inner loop area is reduced, so does 4the total magnetic flux. This phenomenon can explain why the return current of the AC ground plane always flows under the trace conductors on the top layer of the bath. Figure 14. Two Parallel Wires with Current Flowing in Opposite Directions Figure 15. shows why corners add inductance. A straight wire only sees its own magnetic field, but at the corners, the magnetic field of a vertical wire is also visible. Therefore, the corners store more magnetic field energy, and their inductance is greater than that of straight wires. Figure 15. Add Inductance at the Corners Figure 16. shows that cutting the ground plane under the transmission line conductor increases the loop area by diverting the loop current, thereby increasing the loop size and contributing to ground bounce. Figure 16. Return Current Flows Along the Path of Least Impedance   Figure 17. Effect of Component Orientation   Ⅳ Conclusion Ground bounce has always been a potential problem. For monitors or TVs, it means the image is noisy, for audio equipment it means the noise floor. In digital systems, ground bounce can cause calculation errors -or even system crashes. Careful estimation of parasitic elements and simulation are effective methods for predicting the magnitude of ground bounce.First, when designing the PCB, the low-voltage side of the load should be set to true ground. Then, replace the large inductors and capacitors with current and voltage sources to simplify the circuit dynamics. Observing the current loop under each switch combination, the loops should be made to overlap, and if this is not possible, an island should be carefully cut out in the ground plane to ensure that only islands of DC inflow and outflow are present.In most cases, good grounding performance can be obtained with these efforts. If that doesn't work, the resistance of the ground plane should be considered first, then the displacement currents flowing across all switches and parasitic capacitors entering the return path. In short, no matter what circuit, the principle is the same, that is, to reduce the loop area and its difference when the switch changes.   Ⅴ FAQ 1. Does power supply need to be grounded?While it will likely be fine (I've run many computers in old houses that had no grounding), it's not advised. A static charge will build up, and depending on where it discharges may cause damage to the electronics. 2. What is the purpose of a ground wire?The ground wire offers an additional path for the electrical circuit to flow into the earth so as to not endanger anyone working with the electricity nearby in the event of a short circuit. Without ground wire, your body could instead complete the ground path and may cause shock or electrocution. 3. Which wire is ground on power supply?In a DC circuit, the convention in most of the world is that black is the “ground” and any other color carries a signal or power rail of some sort, with red and yellow being popular for power wiring, but it can really be any color on any particular connector. For example, for a typical PC “ATX” power supply. 4. What is the purpose of a ground?Grounding gives electricity the most effective way to return to the ground via your electrical panel. A grounding wire gives an appliance or electrical device a safe way to discharge excess electricity. 5. Should you ground the negative of a DC power supply?As long as both the negative terminal of the LED and the negative terminal of the battery both have good enough connections to ground then the ground will carry enough current between the two connection to complete the circuit and light the LED. The same applies in the mains electricity supply. 6. How do I know if my power supply is grounded?Insert one probe of the circuit tester into the small slot and the other probe into the large probe. If the circuit tester lights up, you have power to the outlet. Now place one probe in the small slot and the other probe into the "U" shaped ground hole. The indicator should light up if the outlet is grounded. 7. Can you ground yourself by touching PSU?It looks pretty, but it's impossible to ground yourself to a case that has no bare metal. Instead, I just installed my power supply and touched the ground prong every now and then. All that said, if all you're doing is touching a metal part on the computer, you aren't really grounding yourself. 8. Can I tie the neutral and ground together?No, the neutral and ground should never be wired together. This is wrong, and potentially dangerous. When you plug in something in the outlet, the neutral will be live, as it closes the circuit. If the ground is wired to the neutral, the ground of the applicance will also be live. 9. What is ground in DC circuit?Traditionally, "ground" is the lowest potential in a circuit, e.g. the minus side of a battery or DC supply. 10. What happens when electricity goes to ground?The majority of the energy of the lightning discharge is dissipated in the air as it travels from the clouds to the ground through the air. The remainder is dissipated in the ground in the area surrounding the location of the strike, over a fairly short distance. 11. What is difference between earthing and grounding?Earthing and grounding are similar terms. ... The main difference between earthing and grounding is that the earthing refers that the circuit is physically connected to the ground with Zero Volt Potential. But, grounding refers that the circuit is not physically connected to ground, but still has zero potential. 12. Does a DC power supply need a ground?The answer comes from the NEC section 250.162, referring to the grounding of two-wire DC systems, which includes the 5V and 24V outputs, depending on your case. ... So, the short answer for a 24V DC system is no, the output is not required to be connected to ground. 13. How do you ground a DC power supply?You ground the device by connecting a grounding cable to earth ground and then attaching it to the grounding point on the DC power supply. You must provide the grounding cables. The cable lug used on the grounding cable should have a #10 stud hole and accommodate a minimum of 12-AWG wire.
Ivy On 2022-01-21   874
Resistors

What You Need to Know about the Hot Swap PCB

CatalogIntroductionⅠ What is a Hot Swap PCB?Ⅱ Custom Keyboard - Hotswap vs. Solderable PCB    2.1 Advantages of Hotswap PCB    2.2 Disadvantages of Hotswap PCB    2.3 Advantages of Solderable PCB    2.4 Disadvantages of Solderable PCBⅢ What Is a Hotswap Mechanical Keyboard?Ⅳ Why are so few hotswap keyboards available?Ⅴ How to Make Hot-Swappable Mechanical keyboard PCB?Ⅵ Relevant Information about "Hot Swap PCB"IntroductionWhen building a custom mechanical keyboard, one of the most contentious decisions is whether to use a hotswap PCB or a solderable PCB. Is one superior to the other? This article will go over the specifics of the hot swap PCB.Ⅰ What is a Hot Swap PCB?The need to solder on switches is one of the most intimidating obstacles for people looking to build a mechanical keyboard. Hot swap PCBs, on the other hand, come to the rescue! A printed circuit board, or PCB, is the brain of your keyboard.There are two ways to connect your mechanical switches to the PCB to register inputs.1.SOLDER PCBSoldering necessitates the use of a soldering tool and solder, a low-melting metal alloy. This method entails inserting the pins of a switch through holes in your PCB and then melting the solder to connect the two. This secures the switch and creates a connection between the PCB and the switch's metal pins. When you press the switch, the signal can now transfer, register as an input, and eventually, trigger an action on your computer.Before attempting to complete this process properly, some research is required. You risk burning the solder, destroying the socket on your PCB, or messing up the switch's pins. Soldering may appear intimidating, but observing video tutorials and practicing with other objects will teach you how to do it correctly and safely.2. HOT SWAP PCBThe second, and far more straightforward method, is to install your switches using a hot swap PCB. You push your switch's pins into pre-installed sockets rather than using a soldering tool and solder. Hot swapping is similar to installing PC components  or Legos; you simply plug and play. It is quick, requires no training, and allows you to easily swap out switches.Glorious Modular Mechanical Keyboards (GMMK) all use hot swap PCBs.  making them the ideal choice for those looking for a simple, intuitive, and customizable keyboard experience.When installing switches into a hot-swap PCB, a softer surface to push against is recommended. Lining up your switch with the socket requires precision, so a softer surface reduces the possibility of bent pins. Furthermore, when removing switches, you should be gentle on the board. Ripping out a switch could result in catastrophic harm to the hot-swap socket.Note: A solder PCB  can be converted to a hot-swap PCB, but this still necessitates the use of a soldering tool. Furthermore, it is not a simple procedure that we recommend for beginners. Ⅱ Custom Keyboard  - Hotswap vs. Solderable PCB  When building a custom mechanical keyboard, one of the most contentious decisions is whether to use a hot swap PCB or a solderable PCB. Is one superior to the other?To that end, we will discuss the benefits and drawbacks of the two PCB options. The short answer is that there is no "better" PCB – it all comes down to personal preference, which is what defines the custom keyboard hobby.2.1 Advantages of Hotswap PCB  The most significant advantage of using a hotswap PCB  is the ease of switch installation, making it ideal for beginners. Simply ensure that the two pins of a switch are straight, install it to the PCB, and you're ready to go! You are not required to solder each individual switch to the PCB.Another reason why a hotswap PCB  is ideal for newcomers to the pastime is that it allows them to experiment with different switches in real-time. When you're new to the hobby, it's essential to figure out what kind of switch you like and don't like, and a hotswap PCB  makes this stage of...discovery easier.Aside from that, a hotswap PCB  simplifies keyboard tuning and maintenance. Assume you've been using your keyboard for a couple of years and you need to re-lube your switches – yes, you do need to re-lube your switches after some time.With a hotswap PCB.  you can simply remove the switches from your keyboard without having to desolder them.Tuning your stabilizers with a hotswap PCB is also not as difficult, assuming you use screw-in stabilizers. The issue is that you usually have to completely disassemble your keyboard to get to the screw-in stabilizers. Every component attached to the PCB, including the switches and plate, must be removed.While you may have fine-tuned your stabilizers during assembly, they may begin to tick later on. To be sure, you can inject lube directly into the stabilizer housing to try to solve the problem, but this doesn't always work – in my experience, it usually doesn't.2.2 Disadvantages of Hotswap PCB  You're stuck with only one layout if you use a hotswap PCB right away. Of course, some keyboards, such as the Ikki68 Aurora, provide slightly more layout options, but they still fall short of the sheer flexibility of a solderable PCB in this regard. Furthermore, you cannot use a hotswap PCB for half-plate builds. Because the switches are not as "attached" to the PCB as soldered switches are, using a half plate with a hotswap  PCB is not recommended.A half plate, as the name implies, does not cover the alphas on a keyboard. If you use a hotswap PCB with such a plate, the switches in the alphas portion are basically "suspended" without any support from the plate – this can damage a hotswap PCB,  2.3 Advantages of Solderable PCBAs previously stated, a solderable PCB allows you to design your own layout with almost no restrictions. Do you prefer a longer 7u spacebar over a 6.25u spacebar? That's fine. Would you rather have a split backspace than a full backspace? Done.A half plate with a solderable PCB, on the other hand, will provide a softer typing experience. You are typing directly on the PCB because the alphas portion of a half plate is exposed. You'll get a softer, less harsh typing experience if the PCB has flex cuts – a hotswap PCB doesn't have this kind of flexibility.Aside from that, a solderable PCB is less expensive than a hotswap PCB. The price difference isn't particularly significant – about $10 more in most cases – but it's worth noting. However, that is not the entire picture; I'll discuss this further in the following section.2.4 Disadvantages of Solderable PCBEven though a solderable PCB is less expensive than a hotswap PCB. It requires more tools to assemble, such as a soldering iron and desoldering tools. Depending on whether you already have such items, these do increase the "cost of ownership" of a solderable PCB.Assembling a keyboard with a solderable PCB requires more work because each individual switch must be soldered to the PCB. You may even damage the PCB during the assembly process if you are inexperienced with a soldering iron.The inability to easily swap out switches is, in my opinion, the most significant disadvantage of a solderable PCB. This makes a variety of keyboard maintenance tasks more difficult, such as stabilizer tuning, switch relubrication, and troubleshooting any keyboard problems.That's it. You may prefer a hotswap or solderable PCB depending on your preferences. Personally, I always use a hotswap PCB for ease of installation, even if it means I can only do a single layout or a half plate build.In addition, I review keyboard switches  on a regular basis; having a hotswap PCB makes this process much easier.Ⅲ What Is a Hotswap Mechanical Keyboard  ?Hotswap = changing switches without solderingHotswap (also known as hot-swap or hot swap) is a popular feature that Kono Store and Input Club were early adopters of. It refers to keyboards that allow for switch replacement without the use of solder. Kaihua (Kailh), a leading switch manufacturer in China, developed the market-leading hotswap  socket design shown below.How can that get confusing?Many websites state that hotswap keyboards have "hotswap switches," which is rarely the case and can lead to minor confusion. Cherry MX-style hotswap keyboard switches can be used in keyboards with the same hotswap socket pinout/plate design, but they were not designed for hotswap use. These switches can even be soldered into a conventional keyboard. The true innovation is found on the PCB (Printed Circuit Board) or, in the case of actual hotswap switches such as our contactless SILO / Keystone line, in the underlying technology.Ⅳ Why are so few hotswap keyboards available?The most significant reason is a reduction in profit — both long and short term. Hotswap sockets are slightly more expensive per keyboard. Most mass-market keyboards are generated in batches of several thousand or more, so manufacturers don't like the extra cost eating into their profit. They also make repairs very simple; when switches wear out, people are much less likely to purchase a new keyboard rather than repairing it themselves.Implementing hotswap sockets also necessitates some engineering expertise. They take up extra space on the PCB, requiring precise component placement and routing. This limits international layout support at the PCB level, which is especially important if a keyboard includes LEDs. Separate PCB designs are usually required if you want a European enter key or a split space bar in a hotswap keyboard. By reducing LED functionality, keyboards such as the Minivan, which is no longer accessible, achieve partial all-in-one success.Ⅴ How to Make Hot-Swappable Mechanical keyboard PCB  ?Hot-Swappable Sockets for DIY Mechanical Keyboard  With a hot-swappable mechanical keyboard, you can replace switches and LEDs on the fly without soldering or even turning off the keyboard. In this short video tutorial, I demonstrate how to make any printed circuit board for a mechanical keyboard hot-swappable by including footprints for Cherry MX plate switches. Other manufacturers' switches, such as Gateron and Kaihl, are compatible with the Cherry MX switches, making this a universal solution.Required HardwareSuitable printed circuit board (for example for ANAVI Macro Pad 8 maker kit)Switches made of metal3mm LEDs are optional, depending on the type of PCB and switches.KeycapsTE Connectivity / AMP 8134-HC-8P2 Holtite sockets for mechanical switches and TE Connectivity / AMP 8134-HC-5P2 Holtite sockets for 3mm LEDsTweezers, cutters and soldering irons are required tools.Holtite sockets for hot-swap  Step 1Insert the holtite sockets  into the PCB with tweezers . Because the sockets are small, take care not to lose any of them. Switch on the soldering iron. Warm each socket and push it gently. So we're using a soldering iron, but not for soldering. We're just using its heat to mount the sockets.It appears to be simpler than it is. It took some time for me to do it for all of the switches and LEDs. Each key has two holes for the switch and two holes for the LED, so you'll need four sockets of the appropriate size for each key.Step 2The following step is optional and only applies to the ANAVI Macro Pad 8 . The maker kit includes a WS2812B addressable LED strip that should be soldered to the back of the keyboard's side. Please take note of the arrow indicating the direction of the LED strip and ensure you place it correctly as shown in the video.Step 3Cut the legs of the 3mm LEDs  to ensure a good fit in the hot-swappable holtite sockets we've already installed.Step 4Put the switches, LEDs, and keycaps together. After you've completed step 1, this is a simple process since you already get a hot-swappable printed circuit board  for the mechanical keyboard.ANAVI Macro Pad 8 customized with blue Cherry MX switches and green 3mm LEDs for backlightingThe Gateron red switches, red LEDs, and white translucent keycaps that come standard with the ANAVI Macro Pad 8 are standard. In this case, however, I'm experimenting with blue Cherry MX switches, green LEDs, and dark translucent keycaps in the hot-swappable version. I bought a variety of mechanical switches, including Gateron Red, Cherry MX Blue , and Cherry MX Brown. Please keep in mind that the 3mm LED slots on the Cherry MX brown switches in the video are not present.The same method of using holtite sockets can be used on any other mechanical keyboard PCB  with a footprint for Cherry MX switches.Ⅵ Relevant Information about "Hot Swap PCB"1. Are hot-swappable PCBS good?If you're new to mechanical keyboards and not looking to learn how to solder, we recommend a PCB with hot-swap sockets as they are the most beginner friendly.2. Are solder switches hard?Soldering isn't difficult, especially with good tools, but it's still a skill which must be learned and it just doesn't make sense to risk a prized keyboard while you're learning. There are many posts here from folks who have damaged a keyboard with their first soldering attempt and looking for advice on how to fix it.3. What does a soldered PCB mean?PCB soldering is another term for the process of soldering electrical circuit boards. ... As the soldering iron melts this metal, it is then used a bit like glue to stick to pieces together. As the solder metal cools, it will re-harden into one large shape that connects the two parts.4. Can you put 3 pin switches in a 5 pin PCB?There are holes for 5-pin (PCB mount) switches, but 3-pin switches work just fine here since the plate is fastened to the PCB - alignment and stability won't be an issue. This PCB uses good quality Kailh hotswap sockets.5. Does PCB affect sound keyboard?Re: How does the PCB affect the sound of the keyboard? PCB will have minimal effect, despite being connected, it's a soft material and the plate tends to take the actual impact regardless of mount. The plate will change the sound of the ping, but more importantly it can and usually does amplify it.6. What temperature should I solder PCB?600°- 650°F (316°- 343°C) is a good place to start for lead-based solder and 650°- 700°F (343°- 371°C) for lead-free solder. You want the tip hot enough to melt the solder efficiency, but excess heat can damage components as the heat travels along the leads, and it will reduce the lifespan of the soldering tip.7. What are types of PCB?Common Types of Printed Circuit BoardsSingle Layer PCB. Single layer printed circuit boards are among some of the simplest to design and manufacture. ...Double Layer PCB. ...Multi-Layer PCB. ...High Density Interconnect (HDI) PCB. ...High Frequency PCB.8. Is Ducky hot-swappable?All standard Ducky One 3 mechanical keyboards are hot-swappable and feature Kailh's hot-swap sockets. Colored in a vibrant yellow, Kailh sockets are chosen for their impressive reliability.9. Do hot swap keyboards need soldering?All you need to do is just ensure that the two pins of a switch are straight, install it to the PCB, and…you're good to go! You don't have to go through the trouble of soldering each individual switch to the PCB. ... Other than that, a hotswap PCB makes keyboard tuning and maintenance much, much easier as well. 
kynix On 2022-01-18   5770
LED

LCD Interface Types Explained with Details

Introduction There are many kinds of LCD interfaces, with wide range of applications. The classification criteria mainly depends on the driving mode and control mode of the LCD. At present, there are generally several connection modes for color LCDs on mobile phones: MCU mode, RGB mode, SPI mode, VSYNC mode, MDDI mode, DSI mode, etc. and only the TFT module has RGB interface. Basics of LCD Interfacing Catalog Introduction Ⅰ LCD Interface Modes 1.1 MCU Mode 1.2 VSYNC Mode 1.3 M6800 Mode 1.4 Intel 8080 Mode 1.5 RGB Mode 1.6 SPI (Serial Peripheral Interface) Mode 1.7 MDDI (Mobile Display Digital Interface) Mode 1.8 DSI (Display Serial Interface) Mode Ⅱ MCU Mode vs RGB Mode Ⅲ TFT-LCD Interface Explained 3.1 TTL Interface 3.2 LVDS 3.3 EDP (Embedded Display Port) 3.4 MIPI Interface Ⅳ FAQ Ⅰ LCD Interface Modes The following is a detailed explanation of the different interface modes: 1.1 MCU Mode It is mainly used in the field of single-chip microcomputers. Later, it is widely used in low-end mobile phones, and its main feature is that it is cheap. The standard term for the MCU-LCD interface is the 8080 bus standard proposed by Intel. Figure 1. Intel 8080 Therefore, 8080 is used to refer to the MCU-LCD screen in many documents. It can be mainly divided into 8080 mode and 6800 mode, and the difference between the two is mainly the timing. There are 8 bits, 9 bits, 16 bits, 18 bits, and 24 bits for data bit transfer. Connections are divided into: CS/, RS (register selection), RD/, WR/, and data lines. The advantages are: the control is simple and convenient, no clock and synchronization signals are required. The disadvantage is: it consumes GRAM, so it is difficult to achieve a large screen (above 3.8). For LCM with MCU interface, the internal chip is called LCD driver. The main function is to transform the data/command sent by the host into the RGB data of each pixel, so that it can be displayed on the screen. This process does not require point, line, frame clocks.The LCD Driver IC of the MCU interface is equipped with GRAM. As a co-processor of the MCU, it accepts the Command/Data sent by the MCU and can work relatively independently. Pay attention to, the internal chip of LCD Module (LCM) is called the LCD driver. The main function is to transform the data/commands sent by the host computer into the RGB data of each pixel, so that it can be displayed on the screen. This process also does not require point, line, frame clocks. 1.2 VSYNC Mode In fact, this mode is to add a VSYNC signal to the MCU mode and applied to the update of the moving picture, which is very different from the above interface. This mode supports the function of direct animation display. It provides a solution for animation display with minimal changes to the MCU interface. In this mode, the internal display operation is synchronized with the external VSYNC signal. Animation display at a higher rate than internal operations can be achieved. However, due to the difference in its operation mode, this mode has a limit on the speed, that is, the write speed to the internal SRAM must be greater than the speed of the display read internal SRAM. 1.3 M6800 Mode The M6800 mode supports selectable bus widths of 8/9/16/18-bit (the default is 8 bits). The actual design idea is the same as that of Intel 8080. The main difference is the bus control read and write signals in this mode. Combined on one pin (with a latch signal (E) data bit transmission has 8, 9, 16 and 18 bits). Figure 2. M6800 Mode 1.4 Intel 8080 Mode Intel 8080 LCD interface is divided into: CS/, RS (register selection), RD/, WR/, and the data line. Advantage: Simple and convenient control, no clock and synchronization signals are required. Disadvantage: It consumes GRAM, so it is difficult to achieve a large screen (above QVGA). Figure 3. Intel 8080 Mode 1.5 RGB Mode The large screen adopts more modes, and the data bit transmission also has the 6-, 16- and 18-, 24-bit. The connections are generally: VSYNC, HSYNC, DOTCLK, CS, RESET, some also need RS, and the rest is the data line. Its advantages and disadvantages are just the opposite of MCU mode. The main difference between the MCU-LCD screen and the RGB-LCD screen is the location of the video memory. The video memory of RGB-LCD is acted by system memory, so its size is only limited by the size of system memory. Where RGB-LCD can be made larger, such as 4.3" can only be regarded as entry-level, and 7" in MID, 10" screens have begun to be widely used. At the beginning of the design of MCU-LCD, it was only necessary to consider that the memory of the single-chip microcomputer was small, so the video memory was built into the LCD module, and then the software updated the video memory through special display commands with small MCU screen. At the same time, the display update speed is slower than RGB-LCD. The display data transmission mode is also different. RGB screen only needs to organize the data in the video memory. After starting the display, the LCD-DMA will automatically transfer the data in the video memory through the RGB interface to the LCM, while the MCU screen needs to send a drawing command to modify the internal RAM of the MCU (that is, the RAM of the MCU screen cannot be directly written).Therefore, the RGB display speed is significantly faster than that of the MCU, and the MCU-LCD is also slower in terms of video playback. For the LCM of the RGB interface, the host directly outputs the RGB data of each pixel without conversion (except for GAMMA correction, etc.). For this interface, an LCD controller is required in the host part to generate RGB data and sync signals. Figure 4. RGB Mode Here gives a note. The color TFT LCD screen mainly has 2 kinds of interfaces: TTL interface (RGB color interface), and LVDS interface (differential signal transmission). The TTL interface is mainly used for small-sized TFT screens below 12.1 inches, and the LVDS interface is mainly used for large-sized TFT screens above 8 inches. The TTL interface has many lines and the transmission distance is short, while the LVDS interface has a long transmission distance and a small number of lines. The large screen adopts more modes, the control pins are VSYNC, HSYNC, VDEN, VCLK, S3C2440 supports up to 24 data pins, and the data pin is VD[23-0].The image data sent by the CPU or graphics card is a TTL signal (0-5V, 0-3.3V, 0-2.5V, or 0-1.8V), and the LCD itself also receives a TTL signal, which is transmitted at a high rate over long distances. However, its performance is poor, and the anti-interference ability is relatively poor. With the time goes by, a variety of transmission modes were proposed, such as LVDS, TDMS, GVIF, P&D, DVI and DFP. They actually just encode the TTL signal sent by the CPU or graphics card into various signals for transmission, and decode the received signal on the LCD side to obtain the TTL signal. No matter what transmission mode is used, the essential TTL signal is the same. Note: TTL/LVDS are two signal transmission modes: TTL is a mode in which high level means 1, and low level means 0; LVDS is the difference of a positive and negative corresponding waveform used to indicate the 1 or 0. 1.6 SPI (Serial Peripheral Interface) Mode It is less used. There are 3-wire and 4-wire, the connection is CS/, SLK, SDI, and SDO, and the software control is more complicated. 1.7 MDDI (Mobile Display Digital Interface) Mode  Qualcomm's MDDI, which can improve the reliability of mobile phones and reduce power consumption by reducing wiring. It will replace SPI mode as a high-speed serial interface in the mobile field. The main connection is host_data, host_strobe, client_data, client_strobe, power, and GND. 1.8 DSI (Display Serial Interface) Mode This mode is a serial bidirectional high-speed command transmission mode, with D0P, D0N, D1P, D1N, CLKP, CLKN connected.   Ⅱ MCU Mode vs RGB Mode Among them, there are more applications in MCU mode and RGB mode. The differences are as follows:1) MCU interface: it will decode commands, generate timing signals by timing generator, and drive COM and SEG.RGB interface: When writing LCD register setting, it is no different from MCU interface. The difference is only in how the image is written.2) When using the MCU mode, since the data can be stored in the IC's internal GRAM first and then written to the screen, the LCD in this mode can be directly connected to the memory bus. It is different when using RGB mode, and has no internal RAM, HSYNC, VSYNC, ENABLE, CS, RESET, RS can be directly connected to the GPIO port of memory, and use the GPIO port to simulate waveforms.3) MCU Interface vs RGB InterfaceThe main differences between the MCU interface and the RGB interface are:MCU interface mode: display data is written into DDRAM, often used for still picture display.RGB interface mode: The display data is not written into DDRAM, but directly written to the screen, which is fast and often used to display video or animation.   Ⅲ TFT-LCD Interface Explained The commonly used interfaces of TFT-LCD, including TTL (RGB), LVDS, EDP, and MIPI. Here roughly talk about the basic principles of the signal composition of these interfaces. Figure 5. TTL (Transistor-Transistor Logic) Schematic 3.1 TTL Interface 🔺Interface OverviewTTL is transistor-transistor logic, and TTL level signals are generated by TTL devices. TTL devices are a large category of digital integrated circuits. They are manufactured by bipolar technology and have the characteristics of high speed, low power consumption and many varieties.The TTL interface is an interface for transmitting data in parallel. When using it, it is not necessary to use a dedicated interface circuit at the driver board end and the LCD panel end of the liquid crystal display, but the TTL data signal output by the main control chip of the driver board is transmitted through the cable. It is directly transmitted to the input interface of the LCD panel. Due to the high signal voltage, many connections and long transmission cables of the TTL interface, the anti-interference ability of the circuit is relatively poor, and it is easy to generate electromagnetic interference (EMI). In practical applications, TTL interface circuits are mostly used to drive small-size (below 15in) or low-resolution LCD panels. The highest pixel clock of TTL is only 28MHz.TTL is the only signal that TFT-LCD can recognize. Early digital processing chips are all TTL, that is, RGB is directly output to TFT-LCD.🔺Signal TypesThe TTL output interface of the driver board generally includes three types of signals: RGB data signal, clock signal and control signal. As shown below:(1) RGB Data-Signala. Single Channel6-BitAs for it, there are 18 RGB data lines in total, including 6 R0~R5 red primary color data lines, 6 G0~G5 green primary color data lines, 6 B0~B5 blue primary color data lines, a total of 18 strips. Since the primary color RGB data is 18bit, it is also called 18-bitTTL interface.8-BitFor it, there are a total of 24 RGB data lines, including 8 R0~R7 red primary color data lines, 8 B0~B7 green primary color data lines, 8 BO~B7 blue primary color data lines, a total of 24 strips. Since the primary color RGB data is 24-bit, it is also called 24-bit TTL interface.b. Dual ChannelDual channels, that is, two sets of RGB data, which are divided into odd channels and even channels. Some clocks are also divided into OCLK/ECLK, and some share one. The following figure has two, as shown below:6-BitIt has 36 RGB data lines in total, including 18 odd RGB data lines, 18 even RGB data lines. Since the primary color ROB data is 36-bit, it is also called 36-bitTTL interface.8-BitIt has 48 RGB data lines, including 24 odd RGB data lines and 24 even RGB data lines. Since the primary color RGB data is 48bit, it is also called 48-bit TTL interface.(2) Clock SignalIt refers to the pixel clock signal, which is the benchmark for transmitting data and reading the data signal. When using odd/even pixel dual way to transmit RGB data, different output interfaces use different methods of pixel clock. Some output interface odd/even pixel dual data share a pixel clock signal, and the others set odd pixel data clock and even pixel two clock signals to meet the needs of different LCD panels.(3) Control SignalThe control signals include a data enable signal (or an effective display data strobe signal) DE, a horizontal sync signal HS, and a vertical sync signal VS. 3.2 LVDS 🔺Overview of LVDS InterfaceLVDS is a low-voltage differential signaling technology interface. A digital video signal transmission method developed to overcome the shortcomings of large power consumption and large EMI electromagnetic interference when transmitting broadband high bit rate data in TTL level mode. The LVDS output interface uses a very low voltage swing (about 350mV) to transmit data differentially on two PCB traces or a pair of balanced cables, that is, low-voltage differential signaling. Using the LVDS output interface, the signal can be transmitted at a rate of several hundred Mbit/s on the differential PCB line or balanced cable. Due to the low-voltage and low-current driving method, low noise and low power consumption are achieved.🔺Composition of LVDS Interface CircuitIn a liquid crystal display, the LVDS interface circuit includes two parts, the LVDS output interface circuit (LVDS transmitter) on the motherboard side and the LVDS input interface circuit (LVDS receiver) on the LCD panel side. The LVDS emitter converts the TTL signal into an LVDS signal, and then transmits the signal to the LVDS decoding IC on the receiving end through the flexible cable (line) between the driver board and the LCD panel, and the LVDS receiver then serializes the serial signal which is converted into a parallel signal of TTL level, and sent to the LCD screen timing control and row and column drive circuit. In other words, TFT only recognizes TTL (RGB) signals.🔺Signal type of LVDS interfaceLVDS signals are composed of data differential and clock differential signals. As shown below:(1) Single Channel6-Bit DataThere are 4 sets of differential lines, 3 sets of signal lines, and one set of clock lines, including Y0M, Y0P, Y1M, Y1P, Y2M, Y2P, CLKOUT_M, CLKOUT_P.8-Bit DataThere are 5 groups of differential lines, 4 groups of signal lines, and a group of clock lines. They are Y0M, Y0P, Y1M, Y1P, Y2M, Y2P, CLKOUT_M, CLKOUT_P.(2) Dual ChannelWhen LVDS transmits data with higher resolution, the anti-interference ability is relatively strong. But when the resolution is higher than 1920×1080, the single channel is overwhelmed, so there is a dual interface. Its purpose is very simple, speed up and enhance anti-interference ability.6-Bit DataIt is exactly twice as long as the single channel, and the clock is also two channels. The red part: the two sets of signals: Y3M, Y3P, Y3M1, and Y3M1 are not connected.8-Bit DataSimilar to the previous comparison. 3.3 EDP (Embedded Display Port) EDP is a communication interface of the computer display screen. The resolution of the computer using the EDP display interface will be higher than that of the LVDS interface. Generally, high-definition screens use this communication interface. It is a fully digital interface based on the DisplayPort architecture and protocol. It can transmit high-resolution signals with simpler connectors and fewer pins, and can achieve simultaneous transmission of multiple data, so the transmission rate is much higher than LVDS. 3.4 MIPI Interface Compared with the LVDS interface, the MIPI interface is rare, but in fact, it has many advantages. The MIPI interface module has the advantages of high speed, large amount of data transmission, low power consumption, and good anti-interference when compared with the parallel port. It is more and more favored by customers and is growing rapidly. For example, an 8M module with both MIPI and parallel port transmission requires at least 11 transmission lines and an output clock of up to 96M to achieve a full pixel output of 12FPS when using an 8-bit parallel port. Channel 6 transmission lines can achieve a frame rate of 12FPS at full pixels, and the current consumption will be about 20MA lower than that of parallel port transmission. Since MIPI uses differential signal transmission, the design needs to be strictly designed according to the general rules of differential design. The key is to achieve differential impedance matching. The MIPI protocol stipulates that the differential impedance of the transmission line is 80-125 ohms.   Ⅳ FAQ 1. What is LCD interface?16x2 LCD means that there are two rows in which 16 characters can be displayed per line, and each character takes 5X7 matrix space on LCD. ... In this tutorial we are going to connect 16X2 LCD module to the 8051 microcontroller (AT89S52). 2. What is LCD parallel interface?LCD Displays that use a parallel interface include Character, Graphic and TFT. ... The initial step is to energize the LCD. Reads and Writes are sent via 8 data lines and 3 control lines. These control lines are Read/Write (R/W), Enable (E) and Register Select (RS). 3. What is TFT interface?A TFT LCD display module consists of a TFT LCD panel, one or more COG (chip-on-glass) or COB (chip-on-board) driver ICs, a backlight, and an interface. Several TFT display interface technologies exist today. Picking the right interface depends on specific end-product concerns. 4. What are the different types of LCDs?Different Types of LCD PanelsTwisted Nematic (TN) Twisted Nematic LCDs are the most commonly manufactured and used types of monitors across a wide range of industries. ...IPS Panel TechnologyVA PanelAdvanced Fringe Field Switching 5. What is MCU interface?The MCU interface has two standard types, the Intel-8080 and Motorolla-6800 series. These interfaces communicate through read, write and chip-select signals to address registers or display RAM. The slight difference between the two pertains to the direction and separation of the write and read signals. 6. What is MCU interface LCD?These interfaces communicate through read, write and chip-select signals to address registers or display RAM. Depending on color depth (8, 9, 16 or 18-bit), MCU sends RGB signals directly to LCM's display memory. 7. Is TFT an LCD?TFT is a kind of LCD. The TFT(Thin Film Field-effect Transistor) is a video in which every single pixel in the liquid crystal display is actuated by a Thin Film Transistor embedded in the rear. Thus can achieve high speed, high brightness, high contrast display screen information.
kynix On 2022-01-18   2927
General electronic semiconductor

Three-state Buffer Basic and Verilog HDL Simulation

Introduction In the computer field, a buffer refers to a buffer register, which is divided into two types: input buffer and output buffer. The function of the former is to temporarily store the data sent by the peripheral so that the processor can take it away; the latter is to temporarily store the data sent by the processor to the peripheral. With the numerical control buffer, the high-speed CPU and the slow-speed peripherals can coordinate and buffer to realize the synchronization of data transmission. Since the buffer is connected to the data bus, it must have a three-state output function. Catalog Introduction Ⅰ Three-State Buffer Meaning Ⅱ Buffers in the Java Language 2.1 Buffer 2.2 Data Transmission 2.3 Mark and Reset 2.4 Invariants 2.5 Clear Reverse Rewind 2.6 Read-Only Buffer 2.7 Thread Safety 2.8 Call Chain Ⅲ EDA Code Ⅳ Verilog HDL Model and Simulation of Tri-state Buffer 4.1 Tri-state Buffer IC 4.2 Application Example of 74LS541 as Input Port 4.3 Multiplexer (MUX) Ⅴ FAQ Ⅰ Three-State Buffer Meaning Three-state buffer (tri-state buffer), also known as three-state driver, its three-state output is controlled by the enable output terminal. When the enable output is valid, the device realizes normal logic state output (logic 0, logic 1); when the enable input is invalid, the output is in a high-impedance state, which is equivalent to disconnecting from the connected circuit. Figure 1. Tristate Buffers A buffer is one of the digital components, it does not perform any operation on the input value, and its output value is the same as the input value. It plays an important role in the design of the computer. There are two types of buffers. In addition to tri-state buffers, there are also conventional buffers (regular buffers).Conventional buffers always output the value directly, which is used to output current to higher-level circuitry. The tri-state buffer has an optional card input, denoted by E, in addition to the functions of a conventional buffer. E=0 and E=1 have different output values. Figure 2. Tristate Buffer Symbols When E=1, it is gated, and its input is directly sent to the output.If E=0, the buffer is blocked. No matter what value is input, the output is always high impedance. The high-impedance state can drop the current low enough that the buffer-like output is not connected to anything.In the design of the CPU, the DC load capacity of the general output line can drive a TTL load, and in the connection, an address line or data line of the CPU may be connected to multiple memory chips, but the memory chips are all MOS circuits. It is a capacitive load, and the DC load is much smaller than the TTL load. Therefore, in a small system, the CPU can be directly connected to the memory, but a buffer needs to be added in a large system.In order to reduce the number of information transmission lines, the information transmission lines in most computers are in the form of buses, that is, all the same type of information to be transmitted goes through the same group of transmission lines, and the information is transmitted in time-sharing. There are generally three groups of buses in the computer, namely the data bus, the address bus and the control bus. In order to prevent information from interfering with each other, it is required that any register or memory hung on the bus, etc., its transmission end can not only show two information states of 0 and 1, but also should be able to show a third state-high impedance state. That is, it seems that their outputs are disconnected at this time, which has no effect on the bus state, and the bus can be occupied by other devices at this time. The above functions can be realized. In addition to the input and output terminals, it also has a control terminal, please see the figure below. Figure 3. Three-state Output Buffer Register When E=1, the output=input, the bus is driven by the device at this time, and the data on the bus is determined by the input data.When E=0, the output terminal is in a high-impedance state, and the device has no effect on the bus. When the output terminal of the register is connected to the three-state gate, and then the output terminal of the three-state gate is connected with the bus, the stage-rush register of the three-state output is formed. Since the one-way tri-state gate is used here, the data can only be output from the register to the data bus. If you want to achieve bidirectional transmission, you will use a bidirectional tri-state gate. Figure 4. Three-state Gate Ⅱ Buffers in the Java Language 2.1 Buffer Directly known subclasses of java.nio.Buffer: ByteBuffer, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer, ShortBuffer public abstract classBufferextendsObject. A container for data of a specific basic type.A buffer is a linear finite sequence of elements of a particular primitive type. In addition to content, the basic properties of a buffer include capacity, limitation, and location.1) The capacity of a buffer is the number of elements it contains. The capacity of the buffer cannot be negative and cannot be changed.2) The limit of the buffer is the index of the first element that should not be read or written. A buffer's limit cannot be negative and cannot be larger than its capacity.3) The position of the buffer is the index of the next element to be read or written. The buffer's position cannot be negative and cannot be larger than its limit. This class has a subclass for each non-boolean primitive type. 2.2 Data Transmission Each subclass of this class defines two get and put operations:A relative operation reads or writes one or more elements, starting at the current position and incrementing the position by the number of elements transferred. If the requested transfer exceeds the limit, a relative get operation will throw a BufferUnderflowException, and a relative put operation will throw a BufferOverflowException. In both cases, no data is transferred.Absolute operations take explicit element indices, which do not affect position. Absolute get and put operations will throw IndexOutOfBoundsException if the index parameter exceeds the limit. Of course, I/O operations through the appropriate channel (usually related to the current position) can also transfer data to and from the buffer. 2.3 Mark and Reset The mark is an index to which the buffer's position is reset when the reset method is called. It is not always necessary to define a marker, but when defining a marker, you cannot define it as a negative number, and you cannot make it larger than the position. If a marker is defined, it will be discarded when the position or limit is adjusted to a value less than the marker. Calling the reset method will cause an InvalidMarkException to be thrown if the mark is not defined. 2.4 Invariants Mark, position, limit, and capacity values obey the following invariants:0<=mark<=position<=limit<=capacity, newly created buffers always have a 0 position and an undefined mark. The initial limit can be 0 or some other value, depending on the buffer type and how it is built. In general, the initial contents of the buffer are undefined. 2.5 Clear Reverse Rewind In addition to methods for accessing position, limitation, capacity values, and methods for marking and resetting, this class defines the following operations that can be performed on buffers.clear() prepares the buffer for a series of new channel reads or relative put operations. It sets the limit to the capacity size and the position to 0.flip() prepares the buffer for a series of new channel write or relative get operations. It sets the limit to the current position, then the position to 0.rewind() prepares the buffer for rereading already contained data. It leaves the limit unchanged, setting the position to 0. 2.6 Read-Only Buffer Every buffer is readable, but not every buffer is writable. The mutate method of each buffer class is designated as an optional operation and will throw a ReadOnlyBufferException when called on a read-only buffer. A read-only buffer does not allow changes to its contents, but its tag, position, and limit values are mutable. Its isReadOnly method can be called to determine whether the buffer is read-only. 2.7 Thread Safety It is not safe for multiple current threads to use the buffer. If it is used by more than one thread, access to that buffer should be controlled through appropriate synchronization. 2.8 Call Chain Specifies that methods in this class return the buffer on which they were called (otherwise they would return no value). This operation allows method calls to be formed into a chain, like a sequence of statementsb.flip(); b.position(23); b.limit(42); can be replaced by the following short statement b.flip().position(23).limit(42);   Ⅲ EDA Code library ieee;use IEEE.STD_LOGIC_1164.all;ENTITY BUF3S ISPORT (INPUT:IN STD_LOGIC;ENABLE:IN STD_LOGIC;OUTPUT:OUT STD_LOGIC);END BUF3S;ARCHITECTURE BHV OF BUF3S ISBEGINPROCESS(ENABLE,INPUT)BEGINIF ENABLE='1'THEN OUTPUT<=INPUT;ELSE OUTPUT<='Z';END IF;END PROCESS;END BHV;   Ⅳ Verilog HDL Model and Simulation of Tri-state Buffer Figure 5. Verilog HDL Model and Simulation of Tristate Buffer 4.1 Tri-state Buffer IC Tristate buffers are often used for multiple data sources to share a (group) common line (bus). Figure 6. For Multiple Data Sources When all enable terminals of the decoder are valid, the combination of SS2~SS0 makes only one of /SELP~/SELW valid at the same time, so that one of the 8 data sources P~W drives SDATA. When the enable terminal is invalid, then none of the three-state gates are enabled, and the outputs are all high impedance.The MSI device 74LS541 contains 8 independent tri-state gates and shares two enable inputs. The logic diagram and logic symbols are as follows: Figure 7. 74LS541 Logic Diagram and Logic Symbol 4.2 Application Example of 74LS541 as Input Port Figure 8. Application Example of 74LS541 as Input Port The MSI device 74LS245 is an 8-bit tri-state bus transceiver with an enable output G and a direction selection input DIR to determine the transmission direction: when DIR=1, data is transmitted from A to B; when DIR=0, data is transmitted from B passed to A. The logic diagram and logic symbols are as follows: Figure 9. 74LS245 Logic Diagram and Logic Symbol   Figure 10. Bus   Figure 11. Verilog HDL Model of 8-bit Tri-state Bus Transceiver 4.3 Multiplexer (MUX) Multiplexers are also called data selectors, and are often abbreviated as MUX. It is a combinational logic circuit with multiple inputs and single outputs, denoted as n/1 or n-1.Logic function: Since the enable terminal EN is valid., when selecting the control variable, select one of the multiple input data to the output terminal. Figure 12. MUX Each value group of the n selection control variables corresponds to select one of the m=2n input data and then send it to the output terminal.Design of Commonly Used Multiplexers🔺8 to 1 Multiplexer Figure 13. 8 to 1 Multiplexer Function Description   Figure 14. 8 to 1 Logic Circuit Diagram Circuit package, Logic symbol Figure 15. Circuit Package   Figure 16. Logic Symbol 1 Out of 8 Verilog HDL Models Figure 17. 1 Out of 8 Verilog HDL Model   Figure 18. 8 Out of 1 Functional Simulation 🔺8 Out of 1 Multiplexer with Tri--state Output Figure 19. Function Description   Figure 20. 8 to 1 Logic Circuit Diagramof Three-state Output Circuit Package, Logical Symbol Figure 21. 74LS251 Circuit Package and Logical Symbol 1 Out of 8 Verilog HDL Model for Tri-state Output Figure 22. Verilog HDL Model Ⅴ FAQ 1. What is a buffer software?A reserved segment of memory within a program that is used to hold the data being processed. Buffers are set up in every program to hold data coming in and going out. In a video streaming application, the program uses buffers to store an advance supply of video data to compensate for momentary delays. 2. Is buffer safe to use?Buffer is a reliable, fast way to manage multiple social media accounts, from a user-friendly dashboard. 3. Why do we need buffering in OS?Computers have many different devices that operate at varying speeds, and a buffer is needed to act as a temporary placeholder for everything interacting. This is done to keep everything running efficiently and without issues between all the devices, programs, and processes running at that time. 4. Is a buffer hardware or software?A buffer is a data area shared by hardware devices or program processes that operate at different speeds or with different sets of priorities. The buffer allows each device or process to operate without being held up by the other. This term is used both in programming and in hardware. 5. What is tri-state buffer?A tri-state buffer is a logic inverter or a non-inverting buffer with a tri-state output stage. ... When the enable line is not activated the buffer output stage has a high output impedance (i.e., the Z state, as described above in section 10.15) and transmission of data is prevented. 6. What is the difference between buffer and tri-state buffer?A tri-state buffer is similar to a buffer, but it adds an additional "enable" input that controls whether the primary input is passed to its output or not. If the "enable" inputs signal is true, the tri-state buffer behaves like a normal buffer. 7. What is meant by tri-state buffer how it helps in reading and writing data from a register?Definition: A three-state bus buffer is an integrated circuit that connects multiple data sources to a single bus. The open drivers can be selected to be either a logical high, a logical low, or high impedance which allows other buffers to drive the bus. 8. What is tri-state TTL?Tri-state gates have additional circuitry via which the gate outputs can be enabled or disabled. This is very useful in digital systems where devices communicate via common wires called busses. Only one device can talk at a time; the others are disabled. 9. Which of the following is also known as tri-state?Explanation: The progression in the parallel ports provides a third register or an individual control bit which can make the pin in a high impedance state. An output port which can do this is also known as tri-state, that is, logic high, logic low and a high impedance state. 10. What is tri-state in microprocessor?Tristate means three states viz. Logic 0, Logic 1 and high impedance states. In high impedance state, the pin neither connected to supply nor to ground. Hence impedance at this pin is very high with respect to suppy as well as ground. Some pins of 8085 have three states. 11. How many buffer may active at any given time?At any one time, one buffer is actively being displayed by the monitor, while the other, background buffer is being drawn. 12. What is tri-state circuit?Tristate means a digital circuit output that can have 3 states: 0, 1 and High-Z or high impedance which is the circuit equivalent of “disconnected”. There are times when you want to have multiple digital circuits connected on a bus but not interfering with each other.
kynix On 2022-01-13   3407
Resistors

Popularization of Science - MCU

CatalogIntroductionⅠ What is a Microcontroller(MCU)?Ⅱ The History of the Microcontroller (MCU)Ⅲ The Classification and Application of MCUⅣ China MCU Technology and Well-known ManufacturersⅤ  The Basic Functions of MCUⅥ Learning Methods - Using MCUⅦ Six Main Dimensions of MCU Products for Future ImprovementⅧ Programming of MCUⅨ Summary of the MCU Programming EngineerⅩ How to Develop MCU Ⅺ 5 Tips to Solve the Questions About the MCU CrystalⅫ Summary of Chip OperationFAQIntroductionA microcontroller (MCU) is a small computer built on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip. A microcontroller is made up of a CPU  (processor core), memory, and programmable input/output peripherals. On chip, a small amount of RAM, as well as ferroelectric RAM, NOR flash, or OTP ROM , is commonly included. Microcontrollers  , in contrast to microprocessors  used in personal computers  or other general-purpose applications, are designed for embedded applications and are made up of a number of discrete chips. This article will delve deeper into the MCU.Ⅰ What is a Microcontroller(MCU)? Microcontroller UnitThe microcontroller unit (MCU) appropriately reduces the frequency and specifications of the CPU  and integrates peripheral interfaces such as memory, counter, USB, A/D conversion, UART, PLC, and DMA. At the same time, even the LCD driver circuit is integrated on a single chip to form a chip-level computer, which can be controlled in different combinations for different applications, such as mobile phones, PC peripherals, remote controls, automotive electronics, industrial stepping motors, machines The control of the arm, etc., can be seen in the MCU.Figure 1 MCU componentsⅡ The History of the Microcontroller (MCU)Microcontroller Unit has a short history, but it has evolved quickly. Its generation and development are roughly synchronized with that of microprocessors  (CPUs). Since Intel Corporation of the United States first introduced 4-bit microprocessors  in 1971, its evolution can be roughly divided into five stages. The following is an overview of the development of Intel's MCU.1971-1976  The initial stage of MCU developmentIn November 1971, Intel introduced the Intel 4004, a 4-bit microprocessor with an integration level of 2000 transistors/chips and equipped with RAM, ROM, and shift registers, which served as the first MCS-4 microprocessor. The Intel 8008 8-bit microprocessor was introduced, followed by other 8-bit microprocessors  from various companies.1976-1980  Low-performance MCU stageThe MCS-48 series, introduced by Intel Corporation in 1976, has a monolithic structure that integrates an 8-bit CPU.  an 8-bit parallel I/O interface, an 8-bit timer/counter, RAM, and ROM on a semiconductor chip. Its addressing range is limited (no more than 4 KB), there is no serial I/O, the RAM and ROM capacity is limited, and the interrupt system is simple, but its functions can meet the needs of general industrial control and intelligent instruments and meters.1980~1983  High-performance MCU stageHigh-performance 8-bit microcontrollers introduced at this stage typically include serial ports, multi-level interrupt processing systems, and multiple 16-bit timers/counters. The capacity of the on-chip RAM and ROM  is increased, and the addressing range can reach 64 KB. A/D conversion interfaces are also available on individual chips. 1983~late 1980s  16-bit microcontroller stage.In 1983, Intel introduced a high-performance 16-bit microcontroller MCS-96  series. The chip integration level was as high as 120,000 transistors/chips due to the use of the most recent manufacturing process.1990sCPUs are developing to a higher level in all directions, such as integration, function, speed, reliability, and application fields. Ⅲ The Classification and Application of MCUMCUs are classified into two types based on their memory type: those with no on-chip ROM  and those with on-chip ROM,  The chip without on-chip ROM  must be used externally with EPROM (typically 8031); the chip with on-chip ROM  is classified as on-chip EPROM (typically 87C51), MASK on-chip mask ROM  (typically 8051), on-chip Flash (typically 89C51), and other types.MCUs are classified into two types based on their intended use: general-purpose and special-purpose. It is classified into4, 8, 16, and 32-bit MCUs based on the width of the data bus and the number of data bytes that can be processed at the same time.Figure 2 MCU product category At present, the most widely used MCU market in China is in the consumer electronics  field, followed by the industrial field and the automotive electronics  market. Consumer electronics  include home appliances, televisions, game consoles, and audio and video systems. Industrial fields include smart homes, automation, medical applications, and new energy generation and distribution. The automotive field includes automotive powertrains and safety control systems. Industrial MCU Industrial MCU products  are primarily used for motor control operation, data acquisition control, and other functions in motor control, instrumentation, low-voltage power distribution, power tools, industrial robots, and other application scenarios.Figure 3 Electric-Vehicle-ChargerThe number of MCU devices is increasing as the complexity of industrial equipment increases. Consider industrial robots: at least ten MCU products  are used in a single industrial robot.Home Appliance MCU MCU is widely used in household appliances, mainly used to realize system control, motor control, panel display control, and other functions.The home appliance market is mainly divided into small household appliances and everyone electricity, small household appliances including kitchen appliances (microwave oven, induction cooker, soybean milk machine, etc.), household appliances (vacuum cleaner, electric fan, electric heater, etc.), personal life small household appliances (electric toothbrush, hairdryer, etc.), everyone electricity mainly for air conditioning, refrigerator, washing machine, and other white appliances.Figure 4 Induction-heating-cooker-app-block-diagramAt the moment, 32-bit MCUs have become the market's mainstream due to their higher specifications and performance, as well as their constantly decreasing cost, and are widely used in automotive electronics.  industrial control/medical, and other fields; however, there are still a large number of application scenarios requiring simple control, and low-value MCUs have cost advantages, so they continue to occupy a large market.BitApplication4Calculator, auto instrument, auto anti-theft device, pager, wireless phone, CD player, LCD dynamic controller, children's toys, scales, chargers, Tire gauge, thermometer, remote control, etc8Electrical appliances, ammeter, motor controller, electric toy machine, pager, fax machine, telephonograph, keyboard and USB, etc16Mobile phones, digital cameras and video recorders, etc32Smart home, IoT, motor and frequency conversion control, security monitoring, fingerprint identification, touch keys, Modem, GPS, STB, Workstation, ISDN telephone, laser printer and color fax machine, etc64Advanced workstation, multimedia interactive system, advanced TV game instrument, advanced terminal, etc.According to IC Insights, the global MCU market is about 16.4 billion dollars in 2019 and could reach about 20 billion dollars by 2023.The scale of China's MCU market was about 25.6 billion yuan in 2019, accounting for about 26% of the global market, with a compound growth rate of 9% from 2015 to 2019.In terms of the global market, the auto circuit accounts for 33% of the global MCU market. According to IC Insights data, the automotive MCU market space will reach $8.1 billion in 2023, the overall growth rate is considerable; At the moment, 32-bit MCUs have become the market's mainstream due to their higher specifications and performance, as well as their constantly decreasing cost, and are widely used in automotive electronics.  industrial control/medical, and other fields; however, there are still a large number of application scenarios requiring simple control, and low-value MCUs have cost advantages, so they continue to occupy a large market.Figure 5  MCU Market StructureFrom the perspective of pattern, the top five global automotive MCU market shares in 2020 were Renesas, NXP, Infineon, Texas Instruments and Microchip, accounting for 87% in total.Ⅳ China MCU Technology and Well-known ManufacturersMCU market is still dominated by overseas leaders, and Chinese high-quality manufacturers are gradually making breakthroughs in the segmented fields, and their share is expected to increase rapidly under the background of accelerated localization in China.The global MCU market is expected to grow further, with the global MCU market size reaching $16.4 billion in 2019 and $20 billion in 2023.On the demand side, improvements in automotive electrification, accelerated IoT  penetration, increased demand for intelligent frequency conversion in home appliances, rapid iteration of wearable devices, and steady growth in industrial control continue to drive the rapid growth of the MCU industry. (Using MCU as an example, the global market compound growth rate from 2020 to 2023 is 7.7 percent, and the market space is expected to be 8.1 billion dollars by 2023)On the supply side, the MCU industry is experiencing a continuous shortage due to the epidemic in 2020. Infineon, NXP.  and ST  , as well as other overseas MCU large factories, have appeared several times to dozens of times the price, with delivery times of more than 50 weeks; persistent shortages are expected to last at least through the end of 2021 and the first quarter of 2022.In terms of circuit barriers, the requirements of automobile circuits in the MCU downstream field are the highest, followed by industrial and home appliance circuits, and the relative requirements of consumer electronics  are slightly lower, according to MCU product environmental temperature, yield, and service life, and other parameters.According to the industry competition pattern, Chinese MCU manufacturers have a low market share, benefit from accelerated replacement due to stock shortages in the short term, and have ample room for improvement in the long term:The global MCU market is more concentrated, with a microchip, ST  MICROELECTRONICS, Renesas, TI, NXP  , Infineon, and other manufacturers occupying more than 80% of the market share; China's MCU market is approximately 25 billion yuan, and the total market share of domestic MCU manufacturers is less than 12%, primarily concentrated in the consumer market, which has ample room for expansion.The shortage of goods leads to the acceleration of the pace of China's MCU manufacturers, in the automotive, industrial, and consumer circuit, the pace of China's MCU certification continues to accelerate. Renesas Electronics - the world's first automotive MCU manufacturer Renesas was founded in 2003 by the merger of Hitachi Semiconductor division and Mitsubishi Electric Semiconductor division. Its main business covers automotive, industrial, communications, and other fields. Renesas is the world's first automotive MCU manufacturer, accounting for 30% of the automotive MCU market in 2020.Renesas MCU has a complete product line covering EV/HEV, powertrain, electric vehicle, vehicle dashboard, vehicle network, chassis control, ADAS, and other application fields.Microchip technology -8 bit MCU main features, acquisition of Atmel to supplement the strength of 32 bit MCUMicrochip Technology Corporation (Microchip) was founded in 1989, Microchip technology is the world's leading supplier of single-chip and analog semiconductors. The company's main business is the microcontroller, memory products, analog interface, and mixed information products, technology licensing, and so on.The products are mainly used in embedded control systems and IoT-related industries, including data processing, Medical Internet + (IoT), smart city, Industry 4.0, intelligent healthcare, etc. Major customers include Intel, Dell, Lockheed Martin, HP, Boeing, etc. STST -ARM architecture MCU king ST was founded in 1987, its products are mainly used in automotive products, computer peripherals, communication systems, consumer products, industrial automation control systems, and other aspects. Its major customers include Apple, blackberry, Bosch, Cisco, Conti, HP, Nokia, Obata, Samsung, and Western Digital.MCU vehicle grade products accounted for 32.13% of the company's revenue. St holds 8.5% of the current MCU market and is the leader in the segmented 32bitMCU  market.ST has been deeply engaged in the automotive semiconductor field for many years, and the company has a complete industrial chain, its products have a very high-cost performance ratio, and occupy a dominant position in the MCU of vehicle regulation level. Its customers include Nissan, Audi, SAIC, Tesla, and many other companies. NXP - the world's leading automotive MCU manufacturer NXP Semiconductor was founded in 2006. It was formerly the semiconductor division of Philips. NXP's main business is MCU, MPU, and other products, which can be widely used in automotive electronics  , industrial control, smart city, smart home, and wearable products. Its MCU/MPU based on the S32 automotive platform has obvious advantages in safety and efficiency and has been adopted by mainstream OEMs around the world.The industry's first crossover MCU was independently developed by NXP: I. MX RT series. Such products have been recognized by many Internet platforms (such as Amazon) for their high integration, cost performance, and security.NXP's acquisition of Freescale (founded by MOTOROLA) in 2015 gives it a deeper presence in the automotive industry. In 2020, 47% of its revenue came from vehicle MCU. At present, the company accounts for 27.8% of the global automotive MCU industry, ranking second in the world. NXP  provides complete semiconductor solutions for intelligent vehicles including automotive entertainment systems, Advanced Driver Assistance Systems (ADAS). Sino Wealth Electronics - China's largest home appliance MCU manufacturer Sino Wealth Electronic Ltd. is an MCU integrated circuit design company, the main products include 8-bit Flash MCU, 8-bit OTP/Mask MCU, 16-bit  DSP , 4-bit OTP/Mask MCU, widely used in household appliances, automotive, industrial control, security, and other fields;In the field of small household appliances, the company's competitors are mainly ABOV from Korea and Holtek from Taiwan. In the field of white household appliances, the company's competitors are mainly from Europe and America, including Renesas, NEC, TI, STM, and so on. Ⅴ The Basic Functions of MCUInternal-function diagramFor most MCUs, the following functions are the most common and basic. The description methods for different MCUs may differ, but the essence is essentially the same.1. Timer: Although there are many different types of Timers, they can be divided into two categories. The first is a Timer with a fixed time interval, which means that its timing is set by the system and cannot be controlled by the user program. The system only provides a few different types of Timers. The user program is given a fixed time interval, such as 32Hz, 16Hz, 8Hz, and so on. Because Timers of this type are relatively common in 4-bit MCUs,they can be used to implement clock, timing, and other related functions.The other type is Programmable Timer. The timing of this type of Timer can be controlled by the user's program. The control methods include the selection of the clock source, the selection of the prescale number, and the setting of the preset number, etc. There are Most MCUs have all three at the same time, and some may have one or both of them. This kind of Timer application is very flexible, and the actual use is also ever-changing. One of the most common applications is to use it to achieve PWM  output.Since the clock source can be freely selected, such Timers are generally combined with the Event Counter.2. IO port: Any MCU has a certain number of IO ports. Without IO ports, the MCU will lose the channel of communication with the outside world. According to the configurable situation of the IO port, it can be divided into the following types:Pure input or pure output : This type of IO port is determined by the MCU hardware design, and can only be input or output, and cannot be set in real-time by software.3. Directly read and write IO port: For example, the IO port of MCS-51 belongs to this type of IO port. When the read IO port command is executed, it is an input port; when the write IO port command is executed, it is automatically an output port.Program programming to set the direction of input and output: the input or output of this type of IO port is set by the program according to the actual needs, the application is more flexible, and can realize some bus-level applications, such as12C bus, various LCD, LED Driver control bus, etc.When using the IO port, this point must be kept in mind: for the input port, there must be a clear level signal to ensure that it cannot be floated (this can be achieved by adding a pull-up or pull-down resistor); and for the output port, the output state level must be Considering its external connection, it should be ensured that there is no source current or sink current in Standby or static state.External interrupts: External interrupts are a basic function of most MCUs. They are commonly used for real-time signal generation, data sampling, and state detection. Rising edge, falling edge, and level triggering are all interrupting methods. In most cases, the external interrupt is handled via the input port. If it is an IO port, the interrupt function will only be enabled when it is set as an input port; if it is set as an output port, the external interrupt function will be automatically closed (with some exceptions in ATMEL's ATiny series, where the output port can also trigger the interrupt function). The application of external interrupt is as follows:Detection of external trigger signals: One is based on real-time requirements, such as thyristor control, detection of sudden signals, and so on, while the other is based on power savings.Measurement of signal frequency:: To ensure that the signal is not missed, an external interrupt is the best option.Decoding data: To reduce design costs in the field of remote control applications, it is frequently necessary to use software to decode various encoded data, such as Manchester and PWM encoding.Button detection and system wake-up: In order for the MCU to enter the Sleep state, it must be woken up via an external interrupt. The most basic form is a button, and the level change is caused by the button's action.4. Communication interface: The communication interface provided by MCU generally includes SPI interface, UART. I2C interface, etc., which are described as follows:SPI interface: This type of interface is the most basic communication method provided by most MCUs. Its data transmission is controlled by a synchronous clock. The signals include SDI (serial data input), SDO (serial data output), SCLK (serial clock), and Ready signal; in some cases, there may be no Ready signal; this type of interface can work in Master mode or Slave mode, the popular saying is to see who provides the clock signal, the party providing the clock is the Master, and the opposite party It is Slaver.UART(Universal Asynchronous Receive Transmit):It belongs to the most basic asynchronous transmission interface. Its signal lines only have two Rx and Tx lines. The basic data format is: Start Bit + Data Bit(7-bits/8-bits) + Parity Bit(Even, Odd or None) + Stop Bit(1~2Bit). The time occupied by one bit of data is called Baud Rate .For most MCUs, the length of data bits, data check mode (odd check, even check or no check), Stop Bit length and Baud Rate can be flexibly set through program programming. Certainly. The most common way of this type of interface is to communicate with the serial port of the PC.I2C interface: I2C  is a data transmission protocol developed by Philips. It also uses two signals to implement: SDAT (serial data input and output) and SCLK (serial clock). The biggest advantage is that multiple devices can be attached to this bus, and they can be identified and accessed through addresses; one of the biggest advantages of the I2C  bus is that it is very convenient to use software to implement through the IO port, and the data rate of its transmission is completely controlled by SCLK. To control, it can be fast or slow, unlike the UART  interface, which has strict rate requirements.5. Watchdog: Watchdoga basic configuration of most MCUs, can only allow the program to reset it but not close it (some are set when the program is burned in, such as Microchip PIC  series MCUs), while some MCUs are It is determined by a specific method whether it is turned on or not. For example, in Samsung's KS57 series, as long as the program accesses the Watchdog  register, it is automatically turned on and cannot be turned off again. Generally speaking, the reset time of the watchdog can be set by the program. The most basic application of Watchdog  is to provide a self-recovery ability for the MCU to crash due to unexpected failure.Ⅵ Learning Methods - Using MCUThe basic principles and functions of any MCU are similar. The only difference is the configuration and quantity of its peripheral function modules and the instruction system.For the instruction system, although it seems to be different in form, it is only a difference in symbols, and the meanings it represents, the functions to be completed, and the addressing modes are similar.To learn about an MCU, the first thing you need to know is its ROM space, RAM space, number of IO ports, number of timers and timing methods, peripheral function modules (Peripheral Circuit) provided, interrupt sources, operating voltage, and power consumption, etc.After understanding these MCU Features, the next step is to compare the functions of the selected MCU with the required functions of the actual project development and clarify which resources are currently required and which are not used in this project.For the functions that need to be used in the project but are not provided by the selected MCU, it is necessary to carefully understand the relevant information of the MCU, to use an indirect method to achieve it. For example, the developed project needs to communicate with the COM port of the PC, and If the selected MCU does not provide a UART  port, it can be implemented through external interrupts.For the resources needed for project development, you need to carefully understand and read the Manua*, while for the unneeded function modules, you can ignore or browse. For MCU learning, the application is the key and the main purpose.For beginners or designers who use this MCU for the first time, they may encounter a lot of ambiguous descriptions of the functions of the MCU. For this kind of problem, there are two ways to solve it, one is to write a special verification program to understand the functions described in the data; the other can be ignored for the time being. Leave it to modify and improve when debugging. The former method is suitable for projects with loose time and beginners, while the latter method is suitable for those who have some experience in single-chip development or when the project schedule is more urgent.Don't take the time to learn the command system in particular. The instruction system is simply a logical description symbol. During programming, you can only check the relevant instructions in accordance with the logic requirements of the program. As your programming skills improve, you will become more proficient in the instruction system.Ⅶ Six Main Dimensions of MCU Products for Future ImprovementStronger computing performance: MCU towards 500Mhz main frequency, MPU increase more processor cores;Additional wireless connection functions: More RF modules have been integrated.Low power consumption, high energy efficiency ratio: integrated analog chip, and low power analog peripheralsContinued support for hardware accelerators: high integration of algorithms and toolsSafety: improve anti-interference ability and safetyCost-effective: reduce costⅧ Programming of MCUThe programming of MCUs and PCs differ significantly. Although C-based MCU development tools are becoming more popular, assembly language remains the most concise and efficient programming language for designers who are efficient program code and like to use assembly.Circuit diagram to build your own microcontroller programmerThe basic framework for MCU programming is roughly the same, divided into the initialization part (the biggest difference between MCU programming and PC programming), the main program loop body, and the interrupt handler. as shown below:1.Initialization: The most basic and important step in the design of all MCU programs is an initialization, which generally includes the following:Mask all interrupts and set the stack pointer to In general, the initialization section does not want any interruptions to occur.Clearing the system's RAM and displaying the Memory: Although it is not always necessary, it is recommended to develop good programming habits for the sake of reliability and consistency, particularly to avoid accidental errors.IO port initialization: Set the input and output modes of the relevant IO port based on the project's application requirements. Set the pull-up or pull-down resistance for the input port, and the initial resistance for the output port.Interrupt setup: Enable and set interrupt trigger conditions for all interrupt sources required by the project, and close unnecessary interrupts that are not used.Initialization of other functional modules: For all peripheral functional modules of MCU that need to be used, corresponding Settings must be carried out according to the application requirements of the project. For example, Baud Rate, data length, verification mode and Stop Bit length should be set for communication of UART  , and clock source should be set for Programmer Timer. Frequency and Reload Data, etc.Initialization of parameters: after completing the initialization of MCU hardware and resources, the following is the initialization of some variables and data used in the program. This part of initialization needs to be designed according to the specific project and the overall arrangement of the program. For some applications that use EEPROM to store the number of prefab items, it is recommended to copy the relevant data to THE RAM of MCU during initialization to improve the speed of data access and reduce the power consumption of the system (in principle, access to the external EEPROM will increase the power consumption of the power supply).2.Main program loop body: Most MCUs run continuously for a long time, so their main program bodies are basically designed in a looping manner. For applications with multiple working modes, there may be many Each loop body is converted between each other through state flags. For the main program body, the following modules are generally arranged:Calculation procedures: Calculation procedures are generally time-consuming, so it is strongly opposed to processing in any interrupt, especially multiplication and division operations.Processing programs with low or no real-time requirements;Display transfer program: mainly for applications with external LED and LCD Driver.3. Interrupt handler: The interrupt program is mainly used to handle tasks and events with high real-time requirements, such as detection of external sudden signals, detection, and processing of buttons, timing counting, LED display scanning, etc.Under normal circumstances, the interrupt program should keep the code as concise as possible. For functions that do not need to be processed in real-time, the trigger flag can be set in the interrupt, and then the main program executes the specific transaction - this is very important, especially for low-power, low-speed MCUs, is necessary to ensure timely responses to all interrupts.4. There are various MCU processing methods for various task bodies.For example, for low-speed, low-power MCU (Fosc=32768Hz) applications, considering that such projects are handheld devices and use ordinary LCD, the response to buttons and display response requires high real-time performance, so generally Timed interrupts are used to process button actions and data display; for high-speed MCUs, such as Fosc>1MHz applications, since the MCU has enough time to execute the main program loop body at this time, it can only be interrupted at the corresponding Various trigger flags are set in the program, and all tasks are executed in the main program body.5. In MCU programming, special attention should be paid to:Avoid situations where the same variable or data is accessed or set in both the interrupt and the main body. The effective prevention method is to arrange the processing of such data in a module, and decide whether to execute the relevant operation of the data by judging the trigger flag; In other bodies (mainly interrupts), only the trigger flag is set where the processing of the data is required. This ensures that data execution is predictable and unique.Ⅸ Summary of the MCU Programming EngineerTo develop a good habit of summarizing, summarizing is not only a summary of their learning, but also a review and deepening of the learning process, but also to avoid the second error.Before writing the program, we should have a solid understanding of the project so that we can start with a solid idea and a general framework. It is critical to consider the layout and what makes the most sense. To determine which module should be completed first, specific steps for the module, how to name each function, and the relationship with other modules. Take a piece of paper and scribble down significant progress.For C language modular programming, we should first divide each module, a module programming, determine a sequence, and then write the next module based on the success of the previous one. When it comes to header files, write the module's header file after you've finished writing the module.Do not ignore the fact that the program must be unreasonable to comprehend its origins and find a solution. When looking for a source, it should be pertinent; you can search for relevant data on the Internet or consult with others. For example, the primary function of another project was incorporated into this project. Some functions are named multiple times. Step by step analysis of the cause, also according to the experimental phenomenon. When defining the port, the incorrect interface was selected. When you can't solve a problem, it's sometimes good to take a break. Things can go wrong no matter how simple they seemThe problems of code utilization efficiency, anti-interference, and MCU reliability continue to plague MCU application development. Ⅹ How to Develop MCU 1How to reduce program bugsThe following are the over-arching management parameters that should be considered during system operation in order to reduce program bugs.Physical parameters: These are primarily system input parameters that include excitation parameters, acquisition and processing operating parameters, and result parameters at the end of processing.Resource parameters: These are primarily the resources of the system's circuits, devices, and functional units, such as memory capacity, storage unit length, and stacking depth.These application parameters are frequently expressed as the application conditions of some single-chip microcomputers and functional units. The term "process parameter" refers to a parameter that changes in an orderly manner during the system's operation.2How to improve the efficiency of C language programming codeIt is an inevitable trend of the development and application of MCU to use C language to design MCU. If you are programming in C, it is best to be familiar with the C compiler you are using to achieve maximum efficiency. First test the number of statement lines in the assembly language corresponding to each C language compilation, so that you can clearly know the efficiency. When programming in the future, use the statement with the highest compilation efficiency. Each C compiler will have certain differences, so the compilation efficiency will also be different. The code length and execution time of an excellent embedded system C compiler is only 5-20% longer than the same functional degree written in assembly language.C language can be used for complex and time-critical projects, but the premise is that you are very familiar with the C language and C compiler of the MCU system and that you pay special attention to the data types and algorithms that the C compiler system can support. Although C is the most commonly used high-level language, the C language compilation system varies due to MCU manufacturer differences, particularly in the operation of some special function modules. As a result, if you don't understand these features, you'll have a lot of trouble debugging, which will result in lower execution efficiency than assembly language.3 How to Solve the MCU Anti-Interference ProblemThe most effective way to prevent interference is to remove interference sources and cut off interference paths, but this is often difficult to do, so we can only conclude that MCU's anti-interference ability is insufficient. While improving the anti-interference capability of hardware systems, software anti-interference has received increasing attention due to its flexible design, ability to save hardware resources, and high reliability.As for the program run fly, in fact, can also use software trap and watchdog to pull the program back to reset state, so the MCU software anti-interference is the most important to deal with the reset state.In most cases, MCU will have some sign registers that can be used to determine the reason for the reset; alternatively, you can bury some tokens in RAM yourself. Different reset causes can be determined in each program reset by judging these signs. You can also use different flags to jump directly to the corresponding program. In this manner, the program will run indefinitely, and the user will be unaware that it has been reset.4How to test the reliability of the MCU systemWhen a MCU system design is completed, there will be different test items and methods for different MCU system products, but some must be tested:lTest the completeness of the software functions of the MCUlPower-on and power-off testlAging testlTests such as ESD and EFT Sometimes, we can also simulate the damage that may occur in human use. For example, the contact port of the MCU system is intentionally rubbed with the human body or clothing fabric, thereby testing the antistatic ability. Use a high-power electric drill to work close to the MCU system to test the anti-electromagnetic interference ability.To sum up, the MCU has become an important aspect of the development and application of the computer.Most of the functions that must be realized by analog circuits or digital circuits in the past can now be realized by software methods using a single-chip microcomputer. This control technology in which software replaces hardware is also called micro-control technology, which is a revolution of traditional control technology.In addition, in the process of development and application, we must master the skills and improve the efficiency, so as to facilitate its wider use.Ⅺ 5 Tips to Solve the Questions About the MCU CrystalCrystal oscillator for MCUCommon causes of the crystal can not vibratePCB wiring error;Microcontroller quality issues;Crystal vibration quality issues;The load capacitance or matching capacitance does not match the crystal oscillator or the capacitor quality is incorrect;PCB board damp, resulting in impedance mismatch and inability to vibrate;The crystal oscillator circuit is too long;There is a line between the feet of crystal;Influence of peripheral circuit.You are advised to rectify faults one by one as follows: 1Remove the possibility of circuit error so that you can compare the recommended circuit of the corresponding type of microcontroller.2 Rule out the possibility of poor peripheral components; because peripheral components are nothing more than resistance and capacitance.3Rule out the possibility of using a crystal oscillator as a stop oscillator because you will not be experimenting with just one or two crystal oscillators.4Try changing the capacitor at both ends of the crystal; perhaps the crystal oscillator will begin to vibrate; please refer to the crystal oscillator capacitor size instructions.5In PC  B wiring, crystal oscillator circuit wiring should be as short as possible and as close to IC as possible, not between crystal oscillator feet. Ⅻ Summary of Chip OperationThe operation of the chip is mainly the operation of the registers in the chip. The registers in the chip have their unique address mapped on the memory, which is the operation of the corresponding address. To learn the chip, first look at the sequence diagram, then understand the corresponding registers, understand how to operate, define the required port (the program can recognize), write and read the operation program.Cross-sectional-views-of-chip-operationHow data is written to the chip, how it is read out, and through which port it is input or read.When connecting a chip through a bus, the first step is to understand the protocol of the bus. The chip connected to the I2c bus is controlled by the bus.1One 74HC595 lattice is used for column selection, and the other two are used for color selection. The lattice is equivalent to a set of diodes.The diode lights up only when one end is switched to a high level and the other to a low level. Just one end of the selection of different, bright different colors.Timer working mode selection: Set timer T1 in the high four digits and timer T0 in the low four digits. Then the last two characters of each mode set the working mode. When using interrupts, note that after entering the interrupt, the reset should be reset.2Serial port transceiver: Baud rate is generally set in mode 2 (automatic reloading initial value) because different devices have different data processing capabilities, the baud rate is set mainly to take care of low-speed devices and for communication between each other. The interrupt flag bit should be cleared by the software. When setting the serial port interrupt, either sending or receiving can enter the interrupt function, so pay attention to setting the interrupt function. (Self-sense generally sets a function, as the upper machine or lower machine).If you send interrupts, you have to figure out how to enter interrupts the first time, so you send them once and then you can enter interrupts. Only one byte can be sent at a time, and only after TI is set to one can the next byte be sent.3Pcf8591ad conversion, there are four channels of input, read PC  F8591, which channel, read is that channel input voltage, after the conversion of data stored in the chip, then read. Read to write the address of the chip, the son writes device address (0 x40 | channel number) and then reads the data.4Da conversion is to write the device address into the chip first, then write the sub-address (0x40) and then write the digital quantity to be converted. Device address chip information is introduced.5For the liquid crystal display, write data display, he will always display, do not continue to refresh, to change, only re-input.6For THE DS1302 clock chip, reading data is read out of the first data at the falling edge of the eighth clock when writing data, and then prepare for the next output. Pay attention to the writing of the program, but also pay attention to the position of the return value.7In Ds1302, the register is specified first, and then data is written to it. The registers on the chip data indicate the address. 8Initialization is best to write, in case you forget later. When reading or writing, the first operation is the lowest or highest bid, which can be judged according to the sequence diagram.9For the infrared transceiver, receiving, he is according to the length of time between the two falling edges to determine the high level or low level, write a program, first with the timer to determine the length of time, save, and then into binary (the program written to see more, very good).10Stepper motor: mainly used as switches, stepper motor torque decreases with the increase of speed. It is mainly used for automatic feeding of parts processing on machine tools. It can also be used in high-precision control places.Stepper motor is an open-loop control element stepper motor that converts electric pulse signal into angular displacement or linear displacement. In the case of the overload, motor speed, stop position depends only on the pulse signal frequency and pulse number, and are not affected by load change, when the stepper driver receives a pulse signal, it is driving a stepper motor according to set the direction of a fixed Angle, known as the "step Angle", its rotation is based on the Angle of the fixed step by step. The angular displacement can be controlled by controlling the number of pulses to achieve accurate positioning. At the same time, the speed and acceleration of the motor can be controlled by controlling the pulse frequency, achieving the purpose of speed regulation.11Servo motor : Servo motor refers to the engine that controls the operation of mechanical components in a servo system. It is an indirect transmission device for auxiliary motors. Servo motors can control speed, position accuracy is very accurate, voltage signal can be converted into torque and speed to drive the control object. Servo motor rotor speed is controlled by the input signal, and can respond quickly, in the automatic control system, used as an executive element, and has the characteristics of mechanical and electrical time constant is small, high linearity, starting voltage, etc., can receive the electrical signal into the motor shaft angular displacement or angular velocity output. It is divided into DC and AC servo motors. Its main characteristic is that when the signal voltage is zero, there is no rotation phenomenon, and the speed decreases uniformly with the increase of torque.12Chinese Characters overview: To output Chinese characters on display or printer, Chinese characters are designed into a dot matrix graph according to graphic symbols, and corresponding dot matrix codes (glyphs) are obtained.The unified encoding for the representation of Chinese characters in the computer is called the internal code (such as national code), and the internal code is unique (equivalent to the id number of the character). The encoding of Chinese characters formed to facilitate the input of Chinese characters is the input code, which belongs to the external code of Chinese characters. The input code varies with the encoding mode and is diverse. The Chinese character code formed for displaying and printing Chinese characters is the character code, and the computer finds the character code in the character library through the character code and realizes its conversion.Machine code: According to the GB code, each Chinese character has a certain binary code, but this code will conflict with THE ASCII code when handled internally by the computer. To solve this problem, the first byte of each GB code is incremented by 1. Because ASCII code only uses 7 bits, the "1" on the first digit can be used as a symbol to identify Chinese character codes. When the computer processes the code with the first digit of "1", it will be interpreted as the information of Chinese characters, and when it processes the code with the first digit of "0", it will be interpreted as the ASCII code. After such processing, the national code (internal code) is the machine's internal code.If put this "mouth" word graphic "." With "0" instead, you can very vividly get the "mouth" glyphs :0000H 0004H 3FFAH 2004H2004H 2004H2004H 2004H2004H 2004H2004H 2004H 3FFAH 2004H 0000H 0000H. Computer to output "mouth", find shows that character first address, according to the "mouth" machine code after calculation, to find a "mouth" glyph code, and then according to the glyph code (to) in binary character generator, in turn, scan control on the screen, which is where the "0" of the binary empty, is a place where "1" swept out of the window, Then you get the character graph of the mouth.Chinese characters are arranged according to the order of national standard codes and stored in the memory in the form of binary files, which constitute the Chinese character font library, also known as the Chinese character font library, called the Chinese character library1312864 liquid crystal: Each display point corresponds to a binary number, with 1 indicating on and 0 indicating off. The RAM that stores this lattice information is called the display data memory. To display a graph or Chinese character is to write the corresponding lattice information into the corresponding storage unit.When the horizontal address = 0FH, it will be reset to 00H, but it will not automatically add one to the vertical address. Therefore, when writing multiple data in a row, the program needs to determine whether the vertical address needs to be reset14GDRAM: Drawing display RAM provides 128×8 bytes of memory space. When changing the drawing RAM, the horizontal and vertical coordinate values are successively written, and then two bytes of data are written to the drawing RAM. The address counter (AC) will automatically increment the horizontal address (X address) and reset to 00H when the horizontal address is 0XFH. Vertical addresses will not be carried automatically plus 1. The drawing display must be turned off during writing to the drawing RAM,For C, a defined variable is automatically allocated space and its address is the name of the variable. Through this name, the data can be recruited in memory, and the new data can be obtained through an operation. In assembly, the programmer needs to define the storage space and send the data to the accumulator for operation, and the programmer needs to operate every step. In C, this is done by the compiler.FAQ1. What is the main function of microcontroller?Microcontroller is a compressed micro computer manufactured to control the functions of embedded systems in office machines, robots, home appliances, motor vehicles, and a number of other gadgets. A microcontroller is comprises components like - memory, peripherals and most importantly a processor.2. What is an example of a microcontroller?The examples of 8-bit microcontrollers are Intel 8031/8051, PIC1x, and Motorola MC68HC11 families. The 16-bit microcontroller performs greater precision and performance as compared to the 8-bit.3. What are the elements of a microcontroller?Therefore, the microcontroller must also satisfy the five basic elements of input, calculation, storage, output, and control. These are called five elements of microcontrollers.4. Which is best microprocessor or microcontroller?If you need access to large amounts of really fast memory then a microprocessor is likely your best option. A microcontroller is already embedded with memory so the memory choices are fewer than with a microprocessor. The maximum amount of FLASH memory available with most microcontrollers is usually around 2MB.5. What is difference between BIOS and CMOS?The BIOS is the program that starts a computer up, and the CMOS is where the BIOS stores the date, time, and system configuration details it needs to start the computer. ... CMOS is a type of memory technology, but most people use the term to refer to the chip that stores variable data for startup.6. Is CMOS a RAM or ROM?RAM and ROM are the products, but Complimentary Metal Oxide Semiconductor (CMOS) is the process they are built in. CMOS uses two different types of transistors to achieve a lower overall power consumption.7. Whats an RTC battery?The Real Time Clock (RTC) battery provides power for the internal clock/calendar and for maintaining system configuration settings. This error can occur when a machine has been left turned-off for an extended period of time (approximately one to four months), and it is the result of a depleted RTC battery.            
kynix On 2022-01-12   1701

Kynix

Kynix was founded in 2008, specializing in the electronic components distribution business. We adhere to honesty and ethics as our business philosophy and have gradually established an excellent reputation and credibility in our international business. With the accurate quotation, excellent credit, reasonable price, reliable quality, fast delivery, and authentic service, we have won the praise of the majority of customers.

Follow us

Join our mailing list!

Be the first to know about new products, special offers, and more.

Kynix

  • How to purchase

  • Order
  • Search & Inquiry
  • Shipping & Tracking
  • Payment Methods
  • Contact Us

  • Tel: 00852-6915 1330
  • Email: info@kynix.com
  • Follow Us

authentication

Kynix

© 2008-2026 kynix.com all rights reserve.