阅读:1361回复:4
请问68013固件中要用到IO口时要设置什么寄存器吗?
为什么我在固件程序中用
sbit PA0=IOA^0; ... main() { ... PA0=0; ... } PA口的第0位怎么不会变化还是1? 是不是还需要设置什么寄存器? 谢谢! |
|
沙发#
发布于:2004-07-27 16:26
解决了,把OEA这个寄存器给忘了。
怪不得总是觉得缺点什么。 非常感谢! |
|
板凳#
发布于:2004-07-27 15:58
C的是这样:
OEA=0xFF OUTA=0xff |
|
地板#
发布于:2004-07-27 15:45
这是汇编的:
The drive current for the EZ-USB product family is only about 1.5mA (same for sink and source), so you can only drive an LED with this low current specified. If you place the diode between 5V and an I/O pin, you can either float the pin (OEA = 0) or drive it low (OEA=1,OUTA=0) to turn on the light. |
|
地下室#
发布于:2004-07-27 14:19
奇怪啊,怎么改C51的程序PA0都是高位。
怎么会这样呢? 谢谢! |
|