1. The open-drain gate of the FET is as follows:
The pull-up resistor effect in the figure is analyzed as follows:
When the tube is turned on or off, it can be understood as the software of the microcontroller when the port is set to 1 or 0.
(1) If there is no pull-up resistor (10k), connect the 5V power supply directly to the FET.
When the tube is turned on, the tube is equivalent to a resistor, and the size is about 1k, so the 5v voltage is all added to the equivalent resistor, and the output terminal Vout=5v.
When the tube is cut off, the equivalent resistance of the tube is very high, which can be understood as infinity, so the voltage of 5v is also added to the equivalent resistance, Vout=5v.
In both cases, the output is high and there is no low level.
(2) If there is a pull-up resistor (10k), connect the 5v power supply to the FET through this pull-up resistor.
When the tube is turned on, the tube is equivalent to a resistor, the size is about 1k, in series with the pull-up resistor, the output voltage is the voltage applied to the equivalent resistor, and its magnitude is Vout = 5v * tube equivalent resistance / ( Pull-up resistor + tube equivalent resistance) = 5v * 1 / (10 + 1) = low level.
When the tube is cut off, the equivalent resistance of the tube is very high, which can be understood as infinity. It is connected in series with the pull-up resistor. The output voltage is the voltage applied to the equivalent resistor. The size is Vout = 5v * The equivalent resistance of the tube / (pull-up resistor + tube equivalent resistance) = 5v * infinity / (infinity +1) = high level.
From (1) and (2), the effect of the equivalent resistance can be analyzed.
2. The P0 port circuit of 51 MCU is as follows:
It can be seen from the analysis of the pull-up resistor in 1 that it is necessary to add a pull-up resistor to the P0 port of the 51 MCU, and the following circuit is added as follows:
BAM Power Transmission Capacitors
BAM power transmission capacitors
RAM/RFM Induction Heating Capacitors,Water Pump Capacitor,Water Cooled Condense,Tank Capacitor
YANGZHOU POSITIONING TECH CO., LTD. , https://www.cndingweitech.com