查看: 549|回复: 0

[经验] 单片机上拉电阻的作用

[复制链接]
  • TA的每日心情
    开心
    2019-11-4 13:48
  • 签到天数: 14 天

    连续签到: 1 天

    [LV.3]偶尔看看II

    发表于 2020-2-18 09:36:28 | 显示全部楼层 |阅读模式
    分享到:

    [color=rgb(34, 34, 34) !important]1. 场效应管的漏极开路门电路如下:

    [color=rgb(34, 34, 34) !important]

    [color=rgb(34, 34, 34) !important]图中上拉电阻作用分析如下:

    [color=rgb(34, 34, 34) !important]管子导通或截止可以理解为单片机的软件时端口置1或0.

    [color=rgb(34, 34, 34) !important](1)如果没有上拉电阻(10k),将5V电源直接与场效应管相连。

    [color=rgb(34, 34, 34) !important]

    [color=rgb(34, 34, 34) !important]当管子导通时, 管子等效一电阻,大小为1k左右,因此5v电压全部加在此等效电阻上,输出端Vout=5v。

    [color=rgb(34, 34, 34) !important]当管子截止时,管子等效电阻很高,可以理解为无穷大,因此5v的电压也全部加在此等效电阻上,Vout=5v。

    [color=rgb(34, 34, 34) !important]在这两种情况下,输出都为高电平,没有低电平。

    [color=rgb(34, 34, 34) !important](2)如果有上拉电阻(10k),将5v电源通过此上拉电阻与与场效应管相连。

    [color=rgb(34, 34, 34) !important]

    [color=rgb(34, 34, 34) !important]当管子导通时, 管子等效一电阻,大小为1k左右,与上拉电阻串联,输出端电压为加在此等效电阻上的电压,其大小为Vout = 5v * 管子等效电阻/(上拉电阻+管子等效电阻)=5v * 1/(10+1) = 低电平。

    [color=rgb(34, 34, 34) !important]当管子截止时, 管子等效电阻很高,可以理解为无穷大,其与上拉电阻串联,输出端电压为加在此等效电阻上的电压,其大小为Vout = 5v * 管子等效电阻/(上拉电阻+管子等效电阻)=5v * 无穷大 /(无穷大+1) = 高电平。

    [color=rgb(34, 34, 34) !important]由(1)和(2),可以分析出等效电阻的作用。

    [color=rgb(34, 34, 34) !important]2. 51单片机的P0口电路如下:

    [color=rgb(34, 34, 34) !important]

    [color=rgb(34, 34, 34) !important]由1中的上拉电阻作用分析可知,需要在51单片机的P0口,加一个上拉电阻,加上后的电路如下:

    [color=rgb(34, 34, 34) !important]



    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-4-25 23:29 , Processed in 0.107982 second(s), 14 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.