完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好,
我通过I2C将STEVAL-MKI137V1(万用表传感器)连接到STM32L152D-EVAL。我使用的库来自STM32CubeExpansion_MEMS1_V4.0.0。 我将I2C引脚连接到PB11和PB10,没有任何外部电阻 STEVAL-MKI137V1侧面。 这个问题对我来说很奇怪。大多数情况下代码不起作用,它会产生类似Acknowledge Failure的错误,有时代码运行良好而没有任何错误! 这个问题的预期原因是什么?我该如何解决? 注意:与外部上拉电阻有关的问题是什么?因为我没有使用它们。 提前致谢。 #steval-mki137v1#i2c 以上来自于谷歌翻译 以下为原文 Hi all, I connected STEVAL-MKI137V1 (Magnometer sensor) to STM32L152D-EVAL through I2C. The library I am using is from STM32CubeExpansion_MEMS1_V4.0.0. I connected I2C pins to PB11 and PB10 without any external resistors on STEVAL-MKI137V1 side. The problem is weird for me. Most of the times the code do not work, it give error like Acknowledge Failure, and sometimes the code works very well without any error! What is the expected reason of this problem? How can I solve it? Note: is the problem related to external pull-up resistors? Because I did not use them. Thanks in advance. #steval-mki137v1 #i2c |
|
相关推荐
5个回答
|
|
|
I2C总线需要上拉电阻(SDA,SCL信号)。
以上来自于谷歌翻译 以下为原文 Pull-up resistors are needed for the I2C bus (SDA, SCL signals). |
|
|
|
|
|
可能是问题吗?
另外,外部电阻的价值是多少? 最好的祝福。 以上来自于谷歌翻译 以下为原文 Could it be the problem? Also, what is the value of the external resistors? Best regards. |
|
|
|
|
|
是的,它可以。
尝试通常的4k7值。 如果您想要一种更科学的方法来计算电阻值,请查看 https://www.nxp.com/docs/en/user-guide/UM10204.pdf ,第7.1节。大卫 以上来自于谷歌翻译 以下为原文 Yes, it can. Try the usual 4k7 value. If you wanted a more scientific method to compute the resistor values, have a look at https://www.nxp.com/docs/en/user-guide/UM10204.pdf , section 7.1David |
|
|
|
|
|
我将审查该文件。谢谢你。
我不确定问题是因为上拉电阻。代码有时会工作,但在大多数情况下会给我不同的错误。 再次,我感谢你的帮助。 以上来自于谷歌翻译 以下为原文 I will review the document. Thanks for it. I am not sure yet that the problem is because the pull-up resistor. The code works sometimes while gives me different errors on most of the times. Again, I appreciate your help. |
|
|
|
|
|
问题解决了。在数据表中写道:
'要选择/利用I2C接口,CS线必须连接高电平(即连接到Vdd_IO)。 所以,我连接了引脚。 最好的祝福。 以上来自于谷歌翻译 以下为原文 The problem was solved. In the datasheet it is written that: 'To select/exploit the I2C interface, the CS line must be tied high (i.e. connected to Vdd_IO).' So, I connected the pin. Best regards. |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1472 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1524 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3674 浏览 1 评论
3864 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2483 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
752浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
684浏览 5评论
730浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
975浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
779浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-14 14:20 , Processed in 2.484614 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1648