[英]Using Port DD as GPIO on MCF5282
I've got a MCF5282 that I'm trying to use PDD4 as a GPIO on. 我有一个MCF5282,我正在尝试将PDD4用作GPIO。 In my setup code, I've got:
在我的设置代码中,我得到了:
MCF5282_GPIO_DDRDD = 0x10; /* cs on dd4. */
MCF5282_GPIO_PORTDD = 0x10; /* active-low. */
And in my main loop, I've got: 在我的主循环中,我得到了:
MCF5282_GPIO_PORTDD = (mainloop_cnt & 0x10);
Which should give me a nice square wave on the oscilloscope, but the port doesn't seem to be doing as I say. 这应该在示波器上给我一个不错的方波,但该端口似乎没有像我所说的那样工作。 Am I missing some setup steps?
我是否缺少一些设置步骤? I can't find anything in the 5282 manual about a “Port DD pin-assignment register” to repurpose it from its “primary” role as DDATA.
我在5282手册中找不到任何有关“端口DD引脚分配寄存器”的内容,无法将其用作DDATA的“主要”角色。
Edit 2011-03-01: We never figured this out, we just used a different pin for GPIO. 编辑2011-03-01:我们从来没有想过,我们只是为GPIO使用了不同的引脚。
您可能需要清除芯片配置寄存器中的PSTEN才能禁用DDATA,请参阅《 MCF5282和MCF5216 ColdFire微控制器用户手册》第27-4页
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.