zzsczz 发表于 2015-4-8 23:40:22

m48输入引脚消耗电流过大,是配置有问题还是坏了

如题,用m48测量高电平信号时间(超声波传感器的信号返回值)
使用 16位计数器cnt1计数
上升沿触发int0,即pd2脚
当pb0作为icp1功能捕获下降沿时,万用表测电流,用vcc驱动pb0和pd2时80mA左右;传感器驱动pb0和pd2,输出高电平只能达到500mv

用int1 (即pd3)捕获下降沿,问题解决

输入都没有上拉电阻

是芯片坏了还是设置有问题?有没有遇到类似问题的电工说说?

jiangxingyuan 发表于 2015-4-9 08:11:28

硬件或配置问题,IO输出高电平时,负载电阻太小或是要外部拉低IO时,IO为输出模式。

njsyq 发表于 2015-4-9 09:23:57

估计是硬件问题,以前也遇到过类似的情况。

zzsczz 发表于 2015-4-9 21:22:12

proteus 仿真也证实了这个现象 , icp1 仿真方式下消耗 240mA 电流








zzsczz 发表于 2015-4-9 21:28:19

仿真文件

有图有代码 ,有感兴趣的电工帮忙看看, 也许是手册没读清楚。。。。






zzsczz 发表于 2015-4-9 23:21:33

http://www.avrfreaks.net/forum/atmega-8-current-consumption

Source and sink currents refer to the currents that an output pin CAN deliver pulling up (source) or pulling down (sink). These have no relationship to minimum current consumption unless something external is connected.
You can set a pin as an output or set it as an input with a pullup; either will consume very little current. If the pin is an input, it should be either a definite high or definite low; if it simply "floats", then current can be high.
These things are all described in the specification sheet and in various Atmel app notes.
页: [1]
查看完整版本: m48输入引脚消耗电流过大,是配置有问题还是坏了