完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,
我试图激活GPIO引脚在波尔塔上,但没有效果。 我的简约固件是这样的: IFCONFIG=0x03; 同步延迟; RVCTL=0x03; 同步延迟; EP6CFG=0xE0; 同步延迟; FippET= 0x80; 同步延迟; FippET= 0x86. 同步延迟; FippET= 0x00; 同步延迟; EP6FIFOCFG=0x0C; 同步延迟; pFrAgAsAb=0x00; 同步延迟; (1){} 现在,我想激活PA1和PA3作为GPIO输出,并在这之前插入(1){}:OEA=0x0A; 同步延迟; CLR IOA 1 同步延迟; CLR IOA 3 同步延迟; 我知道,SimcDelp不是真正需要的,但它不会造成任何伤害。 PA1和PA3引脚被22KOHM电阻拉到VCC,尽管GPIO引脚被作为输出(0SF0A到SFR 0xB2的OEA)并被CLR命令清除,但它们仍然保持高电平。 即使我写0x00到0xB0,这也应该设置输出引脚低,他们停留在3.3V。 我做错什么了? 以上来自于百度翻译 以下为原文 Hi, I tried to activate GPIO pins on PortA but to no avail. My minimalistic firmware is this: IFCONFIG = 0x03; SYNCDELAY; REVCTL = 0x03; SYNCDELAY; EP6CFG = 0xE0; SYNCDELAY; FIFORESET = 0x80; SYNCDELAY; FIFORESET = 0x86; SYNCDELAY; FIFORESET = 0x00; SYNCDELAY; EP6FIFOCFG = 0x0C; SYNCDELAY; PINFLAGSAB = 0x00; SYNCDELAY; while (1) {} Now I want to activate PA1 and PA3 as GPIO outputs and inserted this before the while (1) {}: OEA=0x0A; SYNCDELAY; CLR IOA.1 SYNCDELAY; CLR IOA.3 SYNCDELAY; I know, syncdelay is not really required here, but it should not do any hARM. The PA1 and PA3 pins are pulled to VCC by 22kOhm resistors and they stay high despite the GPIO pins being enabled as outputs (0x0A to OEA at SFR 0xB2) and cleared by the CLR commands. Even if I write 0x00 to 0xB0, which should also set the output pins low, they stay at 3.3V. What am I doing wrong? |
|
相关推荐
3个回答
|
|
|
你好,弗兰克,
亲切地,将IOA寄存器设置为在引脚上输出的期望值。 IOA寄存器的SFR地址是0x80,而不是0xB0。请参阅EZUSB(R)技术参考手册。 HTTP://www. CyPress .COM/FIL/12646/下载 最好的问候, 斯里纳斯 以上来自于百度翻译 以下为原文 Hello Frank, Kindly, set the IOA register with the desired values to be output on the pins. The SFR address for IOA register is 0x80 and not 0xB0. Please refer to the EZUSB(R) Technical Reference Manual. http://www.cypress.com/file/126446/download Best regards, Srinath S |
|
|
|
|
wangcong12138 发表于 2018-9-11 12:10 嗨,Srinath, 对不起,0xB0是我的坏,但它只是一个打印在这里的职位。在固件中,我已经有0x80,但没有效果。 问题似乎是要把PIN作为输出来工作。 无论我做什么,它都保持在高Z。 我现在已经通过10K电阻连接到VCC,并通过10K电阻将GND连接到GND。 因此,如果引脚与输入引脚一样高Z,则两个LED都点亮一点,因为没有电流流入或流出引脚。 如果我通过一个1K电阻器向外部施加0V或3.3V,LED中的一个会变暗,而另一个则被点亮更多,正如预期的那样,当引脚处于0V或3.3V时。 这样,我可以很容易地看出,如果针是0, 1或高Z。 正如我之前说过的,无论我做什么,PIN总是高Z的。 我特别检查了PA3,因为PA3输出使能不被任何其他的PoTa引脚替换,但是即使在PA3上,I也只有高Z。 数据传输在EP6的作品就像一个魅力和它停止工作如果我配置6作为终点,所以我确信固件的第一部分是执行然后OEA = 0a应该得到执行,太。 还有别的防止门主要从输出? 以上来自于百度翻译 以下为原文 Hi Srinath, sorry, the 0xB0 was my bad, but it was a typo only in the post here. In the firmware I already had 0x80 but with no effect. Also the problem seems to be to get the pin to work as an output. No matter what I do it stays in high-Z. I have now connected an LED to VCC via a 10k resistor and an LED to GND via a 10k resistor. So if the pin is high-Z like with input pins, both LEDs are lit up just a bit, because no current flows into or out of the pin. If I apply 0v or 3.3v to the pin externally via a 1k resistor one of the LEDs goes dark and the other one is lit up more, just as expected when the pin is at 0v or 3.3v. This way I can easily see if the pin is 0, 1 or high-Z. As I said before, the pin is always high-Z, no matter what I do. I checked especially with PA3, because PA3 output enable is not overridden by any alternate function like some other PortA pins, but even on PA3 I only get high-Z. The data transfer over the EP6 works like a charm and it ceases to work if I configure EP6 as an Out-Endpoint, so I am sure that the first part of the firmware is executed and then the OEA=0A should get executed, too. Can anything else prevent the PortA GPIOs from being outputs? |
|
|
|
|
nvywyer 发表于 2018-9-11 12:22 好的,不管是什么原因,OEA=0x0a都被翻译成间接寻址,这与SFR不起作用。 我手动改变它直接寻址,它现在正在工作。 以上来自于百度翻译 以下为原文 Ok, for whatever reason OEA=0x0a had been translated to indirect addressing, which does not work with the SFR. I changed it manually to direct addressing and it is working now. |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2477 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2074 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7568浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6114浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7963浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 16:27 , Processed in 0.603228 second(s), Total 74, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2132