打印

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

[复制链接]
2074|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 一样的,是不是你的硬件问题,排阻接对没有

使用特权

评论回复
5
xw0300408| | 2012-5-25 16:59 | 只看该作者
新茂被台湾昂宝收购了,我们是最大代理,所有资料都是中文,有任何问题请联系我

QQ:1427398763

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

56

帖子

0

粉丝