m48输入引脚消耗电流过大,是配置有问题还是坏了
如题,用m48测量高电平信号时间(超声波传感器的信号返回值)使用 16位计数器cnt1计数
上升沿触发int0,即pd2脚
当pb0作为icp1功能捕获下降沿时,万用表测电流,用vcc驱动pb0和pd2时80mA左右;传感器驱动pb0和pd2,输出高电平只能达到500mv
用int1 (即pd3)捕获下降沿,问题解决
输入都没有上拉电阻
是芯片坏了还是设置有问题?有没有遇到类似问题的电工说说? 硬件或配置问题,IO输出高电平时,负载电阻太小或是要外部拉低IO时,IO为输出模式。 估计是硬件问题,以前也遇到过类似的情况。 proteus 仿真也证实了这个现象 , icp1 仿真方式下消耗 240mA 电流
仿真文件
有图有代码 ,有感兴趣的电工帮忙看看, 也许是手册没读清楚。。。。
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]