完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在与PIC12LF1840微控制器工作,并有困难使I2C工作。我用MPLAB代码配置器生成代码。当我探测我的时钟线(当调用I2C.MistMraveWrad)时,不管我做什么,电压大约稳定在1.1伏特。我正在提供3.3V的电路。我正在使用过去在PIC16LF18325微控制器上使用的功能代码。这是PIN寄存器。我使用RA1为SCLK,RA2为SDA,RA0为EASART TX,RA4为ADC输入。LATA=0x06;TrISA=0x3f;ANSELA=0x10;WPUA= 0x00;有什么想法可能是错的?为什么我看到1.1伏稳定在我的时钟线,即使我叫I2C功能?
以上来自于百度翻译 以下为原文 I am working with the PIC12LF1840 Microcontroller and having trouble getting the I2C to work. I generated code with MPLAB code configurator. When I probe my clock line (when calling I2C_MasterWrite) I see the voltage is steady at roughly 1.1 volts no matter what I do. I am supplying the circuit with 3.3V. I am resuing functioning code I had used on a PIC16LF18325 microcontroller in the past. Here are the pin registers. I am using RA1 for SCLK, RA2 for SDA, RA0 for EUSART Tx, and RA4 for an ADC input. LATA = 0x06; TRISA = 0x3F; ANSELA = 0x10; WPUA = 0x00; Any idea what could be wrong? Why am I seeing 1.1 volts steady on my clock line even though I am calling I2C functions? |
|
相关推荐
3个回答
|
|
我假设你只是用一个伏特计来观察这个引脚。它很可能是时钟很快,你只是看到平均电压。你能得到一个范围来观察信号吗?你确信你的PULUPS与SDA和SCL有正确的连接吗?您是以全速运行代码,还是使用调试器(CIPIT3、ICD3等)来执行代码?
以上来自于百度翻译 以下为原文 I assume you are just observing the pin with a voltmeter. It's probably clocking rapidly, and you are just seeing the average voltage. Can you get a scope to watch the signal? Are you sure you have pullups connected correctly to SDA and SCL? Are you running the code at full speed, or stepping through it with a debugger (PICkit3, ICD3, etc) |
|
|
|
我正在使用一个范围来观察信号。当设备用PICTIT3编程时,我可以看到时钟线以良好的锐利信号进入VCC /接地。编程完成后,我只看到这1.12伏。我不使用任何BW限制或类似的探针上的那种。我可以用同样的探针读取EUSAT信号,没有问题。我用SKK和SLK都用10KOHM上拉。我也在全速运行代码(没有调试器)
以上来自于百度翻译 以下为原文 I am using a scope to watch the signal. When the device programs with the pickit3, I can see the clock line going to VCC/Ground with nice sharp signals. After the programming is done, I am just seeing this 1.12 volts. I am not using any sort of BW limit or anything like that on the probe. I can read the EUSART signal with the same probe no problems. I am using a 10kohm pull-up for both SDA and SCLK. I am also running the code at full speed (no debugger) |
|
|
|
HI,在运行测试时将PICIT 3从PIC12断开。I2C通信依赖于电阻上拉,为I2C时钟和数据线建立高电平信号。PIKIT 3在ICSP时钟和数据线上有电阻下拉,4.7 KOHM。这个8引脚器件具有I2C和编程工具共享。相同的时钟引脚。通过拾取3连接,上拉和下拉电阻形成一个分压器,给出1.1个电压。I2C是一个“先听后说”的协议,因此当时钟引脚上没有合适的高逻辑电平时,I2C硬件将拒绝信号启动条件。迈西尔
以上来自于百度翻译 以下为原文 Hi, Disconnect the PICkit 3 from PIC12 when running your test. I2C communication depend on resistive pull-up to establish High level signal for I2C Clock and Data lines. PICkit 3 have resistive pull-down on ICSP Clock and Data lines, 4.7 kOhm. This 8 pin device have I2C and Programming tool sharing the same clock pin. With PICkit 3 connected, pull-up and pull-down resistors form a voltage divider giving 1.1 Volt. I2C is a 'listen before you talk' protocol, so when there is not a proper high logic level on the clock pin, I2C hardware will refuse to signal Start condition. Mysil |
|
|
|
只有小组成员才能发言,加入小组>>
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 03:25 , Processed in 1.673456 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号