How do MCUs with different level signals communicate?
Latest update time:2024-03-04
Reads:
▲
For more exciting content, please click
the blue words
above
to follow us!
Circuit design can actually be fun. Let’s talk about the purpose of this circuit first: when two MCUs work at different operating voltages (such as MCU1 operating voltage 5V; MCU2 operating voltage 3.3V), how to carry out serial communication between MCU1 and MCU2? Obviously, the corresponding TX and RX pins cannot be directly connected, otherwise the MCU with a lower operating voltage may be burned! The following "level bidirectional conversion circuit" can realize serial communication between MCUs with different VDD (chip operating voltage).
The core of this circuit lies in the MOS field effect transistor (2N7002) in the circuit. Its function is very similar to that of a triode. It can be used as a switch to control the on and off of the circuit. However, compared to transistors, MOS tubes have many advantages, which will be discussed in detail later. The picture below is the actual 3D diagram and circuit diagram of the MOS tube. To put it simply, to use it as a switch, as long as Vgs (conduction voltage) reaches a certain value, pins D and S will be turned on. If Vgs does not reach this value, it will be turned off.
So how to apply 2N7002 to the above circuit, and what role does it play? Let’s analyze it below.
If you follow lines a and b, cut off the circuit. Then the TX pin of MCU1 is pulled up to 5V, and the RX pin of MCU2 is also pulled up to 3.3V. When the S and D pins of 2N7002 (corresponding to pins 2 and 3 in the figure) are cut off, they are equivalent to the two lines a and b, cutting off the circuit. In other words, this circuit can deliver the corresponding operating voltage to the two MCU pins when the 2N7002 is turned off.
Further analysis below:
Data transmission direction MCU1-->MCU2.
1. MCU1 TX sends high level (5V), and MCU2 RX is configured as a serial port receiving pin. At this time, the S and D pins of 2N7002 (corresponding to pins 2 and 3 in the figure) are cut off, and the diode 3 inside the 2N7002-- >2 directions are blocked. Then MCU2 RX is pulled up to 3.3V by VCC2.
2. MCU1 TX sends low level (0V). At this time, the S and D pins of 2N7002 are still cut off, but the diode 2-->3 direction in 2N7002 is open, that is, VCC2, R2, the diode in 2N7002, and MCU1 TX A loop. Pin 2 of 2N7002 is pulled low, and MCU2 RX is 0V at this time. This circuit transmits data from MCU1 to MCU2, achieving the effect of level conversion.
Next analysis:
Data transmission direction MCU2-->MCU1
1. MCU2 TX sends high level (3.3V). At this time, the voltage difference of Vgs (voltage difference between pins 1 and 2 in the picture) is approximately equal to 0. 2N7002 is cut off. The diode 3-->2 direction in 2N7002 is blocked. At this time The MCU1 RX pin is pulled up to 5V by VCC1.
2. MCU2 TX sends low level (0V). At this time, the voltage difference of Vgs (voltage difference between pins 1 and 2 in the picture) is approximately equal to 3.3V. 2N7002 is turned on, and the diode 3-->2 direction in 2N7002 is blocked, VCC1 , R1, the diode in 2N7002, and MCU2 TX form a loop. Pin 3 of 2N7002 is pulled low, and MCU1 RX is 0V at this time.
This circuit transmits data in the direction from MCU2 to MCU1, achieving the effect of level conversion.
At this point, the analysis of the circuit is complete. This is a bidirectional serial port level conversion circuit.
Advantages of MOS:
1. The source S, gate G, and drain D of the field effect transistor correspond to the emitter e, base b, and collector c of the transistor respectively. Their functions are similar. Figure 1 shows the N-channel MOS transistor and NPN transistor pins. Figure 2 shows the corresponding diagram of the pins of P-channel MOS transistors and PNP transistors.
2. The field effect transistor is a voltage-controlled current device, and the ID is controlled by VGS. The ordinary transistor is a current-controlled current device, and the IC is controlled by IB. The MOS pipeline amplification factor is (transconductance gm) how many amperes can cause the drain current to change when the gate voltage changes by one volt. The transistor is the current amplification factor (Beta β) that changes the collector current when the base current changes by one milliamp.
3. The gate of the field effect transistor is insulated from other electrodes and does not generate current; when the transistor is working, the base current IB determines the collector current IC. Therefore, the input resistance of the field effect transistor is much higher than that of the triode.
4. In field effect transistors, only majority carriers participate in conduction; in transistors, there are two types of carriers, majority carriers and minority carriers, involved in conduction. Since the concentration of minority carriers is greatly affected by factors such as temperature and radiation, the field Effect tubes have better temperature stability than triodes.
5. When the source of a field effect transistor is not connected to the substrate, the source and drain can be used interchangeably, and the characteristics change little. However, when the collector and emitter of the triode are used interchangeably, the characteristics are very different. Large, the b value will be reduced a lot.
6. The noise coefficient of field effect tubes is very small. Field effect tubes should be used in the input stage of low-noise amplifier circuits and circuits that require a high signal-to-noise ratio.
7. Both field effect transistors and ordinary transistors can form various amplifier circuits and switching circuits. However, the manufacturing process of field effect transistors is simple and has excellent characteristics that ordinary transistors cannot match. They are gradually replacing them in various circuits and applications. Ordinary transistors and field effect transistors have been widely used in current large-scale and ultra-large-scale integrated circuits.
8. High input impedance and low driving power: Since there is a silicon dioxide (SiO2) insulation layer between the gate and the source, the DC resistance between the gate and the source is basically the SiO2 insulation resistance, which is generally about 100MΩ. The AC input impedance is basically The capacitive reactance of the input capacitor. Due to the high input impedance, there will be no voltage drop for the excitation signal, and it can be driven as long as there is voltage, so the driving power is extremely small (high sensitivity). A general transistor must have a base voltage Vb and then generate a base current Ib to drive the collector current. Driving a transistor requires power (Vb×Ib).
9. Fast switching speed: The switching speed of MOSFET has a great relationship with the capacitive characteristics of the input. Due to the existence of the capacitive characteristics of the input, the switching speed becomes slower, but when used as a switch, it can reduce the internal resistance of the drive circuit. , to speed up the switching speed (the input is driven by a "perfusion circuit" described later, which speeds up the capacitive charge and discharge time). MOSFET only relies on multicarriers to conduct electricity, and there is no minority carrier storage effect, so the turn-off process is very fast, the switching time is between 10-100ns, and the operating frequency can reach more than 100kHz. Ordinary transistors due to the storage effect of minority carriers, Switches always have hysteresis, which affects the increase in switching speed (currently, the operating frequency of switching power supplies using MOS tubes can easily reach 100K/S ~ 150K/S, which is unimaginable for ordinary high-power transistors) .
10. No secondary breakdown: Since ordinary power transistors have a phenomenon that when the temperature rises, the collector current will rise (positive temperature ~ current characteristics), and the rise in collector current will lead to a further rise in temperature. A further increase in temperature will further lead to a vicious cycle of an increase in collector current. The withstand voltage VCEO of the transistor gradually decreases as the tube temperature increases. This causes the tube temperature to continue to rise and the withstand voltage to continue to decrease, eventually leading to the breakdown of the transistor. This is a kind of problem that causes the TV switching power supply tube and line output. The destructive thermoelectric breakdown phenomenon, which accounts for 95% of the tube damage rate, is also called the secondary breakdown phenomenon. MOS tubes have the opposite temperature-current characteristics than ordinary transistors, that is, when the tube temperature (or ambient temperature) rises, the channel current IDS decreases instead. For example, a MOS FET switch with IDS=10A, when the VGS control voltage remains unchanged, IDS=3A at a temperature of 250C. When the chip temperature rises to 1000C, IDS drops to 2A. This kind of temperature rise causes The negative temperature current characteristic of the channel current IDS decreases, preventing a vicious cycle and thermal breakdown. That is to say, there is no secondary breakdown phenomenon in MOS tubes. It can be seen that using MOS tubes as switching tubes can greatly reduce the damage rate of the switching tubes. In the past two years, after TV switching power supplies have used MOS tubes to replace the ordinary transistors in the past, the switching tubes The greatly reduced damage rate is also an excellent testament to this.
11. After the MOS tube is turned on, its conduction characteristics are purely resistive: when the ordinary transistor is in saturated conduction, it is almost straight-through and has an extremely low voltage drop, which is called the saturation voltage drop. Since there is a voltage drop, then That is to say; after the ordinary transistor is saturated and turned on, it is equivalent to a resistor with a very small resistance, but this equivalent resistance is a nonlinear resistor (the voltage on the resistor and the current flowing through it cannot comply with Ohm's law), When a MOS tube is used as a switching tube, there is also a very small resistance after saturated conduction, but this resistance is equivalent to a linear resistance. The resistance of the resistance, the voltage drop at both ends and the current flowing through it are in compliance with Ohm's law. The relationship is that the larger the current, the larger the voltage drop, and the smaller the current, the smaller the voltage drop. Since it is equivalent to a linear component after conduction, the linear component can be used in parallel. When two resistors are connected in parallel, there will be an automatic current balance. Therefore, when the power of one tube is not enough, MOS tubes can be used in parallel with multiple tubes without additional balancing measures (nonlinear devices cannot be directly applied in parallel).
Source: Internet
Recommended reading
· END ·