完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在控制I2C引脚以执行“复位奴隶”动作时有困难。PIN C3(SCL1)设置如下:I2C1按预期工作。第一步是强制C3(SCL1)低。尝试下面的(以及各种各样的事情):不起作用。SCL仍然很高。在数据表中,关于开漏的说法不多。“当ODCONX位被设置时,相应的端口输出变成一个仅能下沉电流的开路漏极驱动器。当ODCONX位被清除时,相应的端口输出引脚是标准的推挽驱动器,能够提供和下沉电流。“没有例子。我误解了它是怎么运作的吗?
以上来自于百度翻译 以下为原文 Having trouble taking control of i2c pins to perform a "reset slaves" manoeuvre. Pin C3 (SCL1) was setup as follows: ANSELCbits.ANSELC3 = 0; RC3PPS = 0x21; //RC3->I2C1:SCL1; I2C1SCLPPSbits.I2C1SCLPPS = 0x13; //RC3->I2C1:SCL1; ODCONCbits.ODCC3 = 1; RC3I2Cbits.TH = 1; TRISCbits.TRISC3 = 0; // then various peripheral configs I2C1CON0bits.EN = 1; // then enable i2c1 worked as expected. First step is to force C3 (SCL1) low. Tried the following (and various things like it): I2C1CON0bits.EN = 0; // turn off i2c1 ODCONCbits.ODCC3 = 0; // turn off open-drain RC3_SetDigitalOutput(); // (it should be already) RC3_SetLow(); // tried before and after setting to output etc..... Doesn't work. SCL remains high. In the datasheet not much is said about open drain "When an ODCONx bit is set, the corresponding port output becomes an open-drain driver capable of sinking current only. When an ODCONx bit is cleared, the corresponding port output pin is the standard push-pull drive capable of sourcing and sinking current." No examples. Have I misunderstood how it works? |
|
相关推荐
2个回答
|
|
为了允许LATC3控制引脚RC3,将RC3PPS设置为零。参考:表17-2在数据表中,无论ODC设置如何,都可以驱动引脚低。事实上,如果你有一个I2C设备连接到一个PIN,我建议你总是离开它的ODC位设置。你不想驾驶I2C线,戴夫
以上来自于百度翻译 以下为原文 To allow LATC3 to control pin RC3, set RC3PPS to zero. Ref: Table 17-2 in the Data Sheet. You can drive a pin low regardless of the ODC setting. As a matter of fact, if you have an I2C device connected to a pin, I recommend that you always leave its ODC bit set. You never want to drive an I2C line high. Regards, Dave |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2036 浏览 8 评论
1956 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3217 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2264 浏览 5 评论
786浏览 1评论
677浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
603浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
684浏览 0评论
581浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 04:23 , Processed in 1.286314 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号