单片机IO口判断高低电平的问题

2020-02-04 09:15发布

我想用5V电源的正加在单片机P1口判断高低电平,是否需要加个电阻,防止单片机不正常,如果需要的话大概要加多大?(貌似有听人说电流太大的话单片机无法工作)
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
21条回答
millwood0
2020-02-05 18:15
you should look into the datasheet for your device.it typically specify the maximum current through the clamping diodes. Usually that's 20 - 25ma: anything greater than that can cause permanent damage to the clamping diodes.

so at 5v, the minimum resistance allowed is 5v/20ma = ...

If you are doing adc on that pin,you will look into the maximum resistance specification.

if you are applying an ac signal to it, you need to look into the input capacitance figure to make sure that the resistance isn't too large for your signal (as the resistance forms a low-pass filter with the pin's input capacitance).

...

一周热门 更多>