完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我用PIC16F1705作为奴隶,用时钟拉伸。在我开始推动足够的数据到使起停条件之间的时间下降到0.1ms以下之前,它似乎工作正常。图片设置为2Mhz运行。有时我从总线上得到坏数据。看起来我并没有违反任何i2c的设置和保持时间。如果isr不能跟上,就应该时钟伸展,直到它准备好把数据放到总线上。你知道是什么原因造成的吗?P.S.我也有逻辑分析仪的踪迹,但论坛现在似乎有困难处理它们。
以上来自于百度翻译 以下为原文 Hi, I am using a pic16f1705 as a slave, with clock stretching. It seems to work fine until I start pushing enough data on the bus to cause the time between the start and stop condition to drop below 0.1ms. The pic is set to run at 2Mhz. Some times I get bad data from the bus. It doesn't look like I'm violating any setup and hold times for i2c. And if the isr couldn't keep up is should just clock stretch until it is ready to put data on the bus. Do you have any idea what could cause this? p.s. I also have logic analyzer traces but the forum seems to have trouble handling them right now. |
|
相关推荐
4个回答
|
|
新会员不能邮寄,波特率是多少?什么拉?Vcc?注意,中断中的I2C的PIC从其中断延迟受到限制。主机可能需要插入等待。我假设你正在使用时钟拉伸模式,而不是释放时钟,直到你完成了。
以上来自于百度翻译 以下为原文 New Members can't post. What baud rate? What pullups? Vcc? Note a PIC Slave with the I2C in the interrupt is limited by its interrupt latency. The Host may need to insert waits. I assume you are using both clock stretching modes and not releasing the clock till you are done? |
|
|
|
H.NKUZZMAN波特率是100KHZ,上拉是10KVCC是PIC上的5V,在主设备上是3.3。这可能是个问题。这个单元被配置为与smbus兼容,但是在手册的第138页我发现,smbus兼容性只适用于默认引脚,而我没有打开。
以上来自于百度翻译 以下为原文 Hi NKurzman The baud rate is 100khz The pull-ups are 10k vcc is 5V on the pic and 3.3 on the master device. This might be a problem. The unit is configured as smbus compatible, but on pg 138 of the manual I found that smbus compatibility is only possible for the default pins, which I am not on. |
|
|
|
好的,我已经把引脚换回来了,以便I2C引脚处于默认位置。在这种配置中,引脚应该是SMBus兼容的,所以信号电平不应该是问题。我看到了非常类似的行为,从设备读取的开始位和停止位之间的延迟小于100us会导致读取回坏数据。
以上来自于百度翻译 以下为原文 Ok, I've swapped the pins back so that the i2c pins are at their default locations. In this configuration the pins should be SMBUS compatible, so signal levels should not be a problem. I'm seeing very similar behavior where reading from the device with less than 100us delay between the start and the stop bit causes bad data to be read back. |
|
|
|
嗨,史提芬,你有没有特别的理由使用10K拉力?拉起的价值会对你的时间产生影响。我最近有一个问题与MikReleltRoNoCa点击板。他们在传感器板上使用了10K的上拉,有时我甚至无法在总线上得到一个启动位。我切换到2.2K,从那时起没有问题。我会努力降低你的抵抗力,看看这是否有帮助。
以上来自于百度翻译 以下为原文 Hi Steven, Is there a specific reason you are using 10K pull-ups? The value of the pull-ups will have an effect on your timing. I recently had an issue with a MikroElektronika Click board. They used 10k pull-ups on their sensor board, and sometimes the I couldn't even get a start bit on the bus. I switched to 2.2k, and no problems since. I would try to lower your resistance and see if that helps. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
727浏览 1评论
612浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
501浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
626浏览 0评论
524浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 06:50 , Processed in 1.383345 second(s), Total 84, Slave 67 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号