- 打卡等级:初来乍到
- 打卡总天数:4
- 最近打卡:2025-05-01 06:58:22
金牌会员
- 积分
- 1333
|
发表于 2023-7-13 08:01:15
|
显示全部楼层
本帖最后由 jmg 于 2023-7-13 14:11 编辑
When the switch is closed, the MOS tube is turned on, and a rising edge will be generated, but the current at this time reaches 46mA.
If it is a short circuit, why is the current only 46mA? Has 46mA exceeded the maximum current that the microcontroller IO can stand?
You are correct to think 46mA is excessive, normally such a circuit is avoided as 46mA is too high for simple button sense.
You do not want to fight the LOW driving N-FET.
The reason you measure ~46mA is seen on these CMOS curves (from toshiba data, but applicable to all CMOS parts )
The 8051 port is designed with light pullups, so if you want to sense a switch to GND as your circuit shows, just omit the diode, and PFET and connect switch directly to P33 (you can use a 1k series resistor for ESD protection, if it is a remote switch)
P33 will then read HI for open switch and LO for closed switch.
As above, the peak curent needed through the switch is ~270uA at Vin ~ 2.0V, and drops to < 50uA at Vin = 0V
There is an optional 4.1k resistor pullup via P3PU, which can increase the switch current to ~ 1.2mA
|
|