新茂SM89516A单片机的P0口不受控制

[复制链接]
3548|4
 楼主| Yellow_Fox 发表于 2011-7-19 11:46 | 显示全部楼层 |阅读模式
P0口接了1K的上拉电阻(排阻)。
程序很简单,如下:
Test_Loop:
      CPL     P0.0
      CPL     P2.7
      DELAY_1S
      JMP  Test_Loop
P2口的电平可正常翻转,但P0口的电平却一直保持在高电平状态。
用AT89C52,飞利浦的89C51RD2等芯片都很正常,就新茂这个不正常,不知是何故。
有哪位大侠用过新茂单片机的,还望给些解答啊,拜托了。
ayb_ice 发表于 2011-7-19 14:51 | 显示全部楼层
仔细看一下手册
 楼主| Yellow_Fox 发表于 2011-7-19 15:28 | 显示全部楼层
2# ayb_ice

手册上貌似写得很简单,如下:
The ports 1, 2 and 3 of standard 8051 have internal pull-up resistor,and port 0 has open-drain outputs. Each I/O pin can
be used independently as an input or an output. For I/O ports to be used as an input pin, the port bit latch must contain a
‘1’ which turns off the output driver FET. Then for port 1, 2 and 3 port pin is pulled high by a weak internal pull-up, and can
be pulled low by an external source. The port 0 has open-drain outputs which means its pull-ups are not active during nor-
mal port operation. Writing ‘1’ to the port 0 bit latch will causing bit floating so that it can be used as a high-impedance

这样跟普通的51芯片不是一样的嘛,开漏输出。。。
input.
ayb_ice 发表于 2011-7-19 16:28 | 显示全部楼层
确实和标准51 一样的,是不是你的硬件问题,排阻接对没有
xw0300408 发表于 2012-5-25 16:59 | 显示全部楼层
新茂被台湾昂宝收购了,我们是最大代理,所有资料都是中文,有任何问题请联系我

QQ:1427398763
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

56

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部