完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我设置了PE0 - > PE3作为输入,启用内部上拉。 在没有连接这些引脚的情况下,我将输入寄存器读为0x09,表明上拉仅在引脚PE0和PE3上有效。 有人注意到类似的行为吗? 感谢致敬 缺口 以上来自于谷歌翻译 以下为原文 Hi all, I've set PE0 -> PE3 as inputs with internal pull-up enabled. Without connecting anything to these pins, I read the input register as 0x09, indicating that the pull-up is only operational on pins PE0 and PE3. Has anyone noticed similar behavior? Thanks and regards Nick |
|
相关推荐
5个回答
|
|
嗨Fabio,
感谢您的输入。 好吧,我有点困惑。 我不使用图书馆。 我刚才写的(1) GPIOE-> DDR& = 0xF0; //将PE0设置为PE3作为输入 GPIOE-> CR1 | = 0x0F; //在PE0上设置上拉到PE3 然后我可以用电压表测量引脚,在PE1和PE2上有0V。或者,我可以将GPIOE-> IDR转换为变量并读取0x09。 编辑:我在这些引脚上添加了外部上拉,现在很好...... 以上来自于谷歌翻译 以下为原文 Hi Fabio, Thanks for your input. Well I'm a bit confused. I dont use the library. I just wrote before the while(1) GPIOE->DDR &= 0xF0; // Set PE0 to PE3 as inputs GPIOE->CR1 |= 0x0F; // Set pull-up on PE0 to PE3 Then i can measure the pins with a voltmeter and have 0V on PE1 and PE2. Alternatively, i can transfer GPIOE->IDR to a variable and read 0x09. EDIT: i've added external pull-ups on these pins and now it's fine... |
|
|
|
你好Nico,是的我也试过这些命令。我发现了问题:在某种程度上,编译器没有创建用于读取引脚或端口的局部变量。所以使用全局变量就可以了。
在你的情况下,你有没有检查过FR6选项字节?该引脚(PE1和PE2)具有备用功能i2C clk和数据输出。问题可能在于此字节的配置。你的init函数似乎是正确的。我检查了ST库的Init函数,它遵循相同的步骤。它只添加GPIOE-> CR2& = 0xF0;用于中断配置。 问候。 以上来自于谷歌翻译 以下为原文 Hello Nico, yes I've tried these commands too. I discover the problem: For some way the compiler wasn't creating the local variable used for reading the pin or port. So using a global variable it worked. In your case, have you ever checked the FR6 option byte? This pins (PE1 and PE2) have alternate function i2C clk and data out. The problem could be in configuration of this byte. Your init function seems to be correct. I checked the ST library Init function and it follow the same steps. It only adds the line GPIOE->CR2 &= 0xF0; for interrupt configuration. Regards. |
|
|
|
你很亲密!用于IIC接口的2个引脚是“真开漏”。上拉引脚,Totem-Pole高驱动器和保护二极管未在这些引脚上实现。这两个输入需要外部上拉或图腾柱驱动。并且,不要忘记你也需要外部上拉输出用途。我一直在使用ST7& STM8多年来我仍然会经常感到惊讶然后我会承认。
JDF 以上来自于谷歌翻译 以下为原文 You're close! The 2 pins used for the IIC interface are ''True Open Drain'' The pullups, Totem-Pole high driver and protection diodes are NOT implemented on those pins. You need external pullups or totem pole drive for those 2 inputs. AND, don't forget you'll need the external pullup for output uses too. I've been using ST7 & STM8 for years and I still get surprised more often then I'll admit. jdf |
|
|
|
谢谢John和Fabio!您的意见略有冲突但我感谢您的帮助!
|
|
|
|
大家好,
我得到了支持人员的意见,这2个引脚没有上拉,数据表中有一点错误。 再次感谢您对我的小问题感兴趣,并且非常感谢那些反应灵敏的支持人员。 问候 萨科 以上来自于谷歌翻译 以下为原文 Hi all, I got the input from the support guys and these 2 pins don't have the pull-up, there's a little mistake in the datasheet. Thanks again for your interest in my little problem, and thanks a lot as well to the support guys who have been pretty responsive. Regards Nicolas |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
1392 浏览 1 评论
2046 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1507 浏览 1 评论
2798 浏览 6 评论
5169 浏览 21 评论
351浏览 4评论
486浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
276浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
537浏览 3评论
466浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-18 08:38 , Processed in 0.943593 second(s), Total 77, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号