完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我所面临的问题已经在下面的线程中被解开:http://www. McCys.com /论坛/ M47 8248. ASPX。我有完全相同的问题:在发送地址和R/W位之后,在设置停止位时,会遇到总线冲突。你可能会问,为什么在地址被发送之后设置停止位?我用它作为一个I2C总线扫描器,我只想知道相应的地址是否有一个附加的有源设备,如果我发送它的地址,它会告诉我一个知识。我的问题与原始帖子的主要区别是:由于我用I2C面对这个问题,我把所有的I2C设备从总线上删除了。所以没有设备连接到I2C总线上。我这样做是为了验证我的扫描是否正确地通过所有的地址。我假设附件中的一个设备被卡住并保持我的SDA线低,但是由于没有设备被连接,我认为这不应该发生。看起来PIC32的I2C主机会被卡住并保持SDA线低(因此产生总线冲突)。在原来的帖子中所说的序列,在启用I2C模块之前,将I2C引脚设置为高状态并没有帮助。是否有人也面临同样的问题,我有暗示或解决方法?我正在使用PIC32 MX230F156D。我附上了一个逻辑分析仪的图片,告诉你总线上发生了什么(记住:没有设备附在总线上)。
以上来自于百度翻译 以下为原文 Hi everyone, The problem I am facing was already disucussed in the the following thread: http://www.microchip.com/forums/m478248.aspx. I have exactly the same problem: After sending the address and R/W bit, I get a bus collission when setting the stop bit. You'll probably ask, why setting the stop bit after the address was sent? I use it for an I2C bus scanner where I just want to know if the corresponding address has an active device attached which sends me an aknowledge if I send its address. The main difference of my problem to the problem of the original post is: Since I faced this problems with I2C, I have removed all I2C devices from the bus. So there is no device attached to the I2C bus. I did it to verify wheter my scan runs through all addresses correctly or not. I assumed that one of the attached devices gets stuck and holds my SDA line low, but since no device is attached I thought this should not happen!? It seems that the I2C master of the PIC32 gets stuck and holds the SDA line low (and therefore generates the bus collission). The sequence, which was told in the original post, by setting the I2C pins to high state before enabling the I2C module did not help. Did anyone also face the same problem and has a hint or workaround for me? I'm working with a PIC32MX230F156D. I have attached a picture of the logic analyzer to show you what happens on the bus (remember: no device is attached to the bus). Attached Image(s) |
|
相关推荐
4个回答
|
|
轻微的细节,它不是一个停止*位,是停止条件。停止条件是当数据线从低到高时,时钟已经很高。因此,为了产生停止条件,主机必须保持数据线低,直到时钟高之后。
以上来自于百度翻译 以下为原文 Slight detail, it is not a STOP *bit*, is the STOP condition. A STOP condition is when the data line goes from low to high when the clock is already high. So to generate a STOP condition, the master must hold the data line low until the after the clock does high. |
|
|
|
在您的示例中,您试图写入预留的I2C地址。这可能会导致I2C硬件中的奇怪行为。尝试将您的地址扫描限制为0x10gt;
以上来自于百度翻译 以下为原文 In your example you are trying to write to a reserved I2C address. This may cause odd behavior in the I2C hardware. Try limiting your address scan to 0x10 >= addr < 0xF0. |
|
|
|
在总线上有所需的上拉电阻吗?Ruben
以上来自于百度翻译 以下为原文 Do you have the required pull-up resistors on the bus? /Ruben |
|
|
|
你的提示很有帮助!现在开始工作了。如果你写了一个保留地址,总线碰撞会正常吗?
以上来自于百度翻译 以下为原文 Your hint was very helpful! It is working now. Is it normal to get a bus collission if you write to a reserved address? |
|
|
|
只有小组成员才能发言,加入小组>>
5166 浏览 9 评论
2000 浏览 8 评论
1928 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3174 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2226 浏览 5 评论
733浏览 1评论
615浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
505浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
631浏览 0评论
528浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 05:10 , Processed in 1.184072 second(s), Total 54, Slave 47 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号