完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,大家好,
AM使用CYBLE 012012-00 我有DS1307微RTC模块,基于I2C,我想从中获取数据。 下面是我的代码的代码片段: 同时(I2CMII2CYMSTRYNONOA错误!= I2CMYI2CMASTSTATUS() { I2CMJI2CMADSCURSTATUS(); } 同时(I2CMII2CYMSTRYNONOA错误!= I2CMY2I2CMASTESTESTART(0x68 U,0x00 U); CyDelay(10); 同时(I2CMII2CYMSTRYNONOA错误!= I2CMY2I2CMASTEMWRITE字节(0x00 U); CyDelay(10); 同时(I2CMII2CYMSTRYNONOA错误!= I2CMY2I2CMASTESTEnRADE(0x68 U,0x1U); CyDelay(10); D1=I2CMYI2CMASTRADESENTELL字节(I2CMYI2CYACKYDATA); D2= I2CMYI2CMASTRADIDENTELL字节(I2CMYI2CYACKYDATA); D3=I2CMYI2CMASTRADESENTELL字节(I2CMYI2CYACKYDATA); D4=I2CMYI2CMASTRADESENTELL字节(I2CMYI2CYACKYDATA); D5=I2CMYI2CMASTRADESENTELL字节(I2CMYI2CYACKYDATA); D6= I2CMYI2CMASTRADIDENTELL字节(I2CMYI2CYACKYDATA); D7=I2CMY2I2CMASTRADESENTELL字节(I2CMYI2CYACKYDATA); D8=I2CMY2I2CMASTRADESENTELL字节(I2CMYI2CY-NAKYA数据); I2CM.I2cMexsStestStutter(); 我不能超越线以下前进: 同时(I2CMII2CYMSTRYNONOA错误!= I2CMY2I2CMASTESTESTART(0x68 U,0x00 U); 不知道该怎么办? 我正在使用PSoC 4创建者 我的连接引脚如下: PRC侧 VCC-3.3V GND SCL SCL(P3〔5〕) SDA SDA(P3〔4〕) 有任何人配置之前请帮助我 谢谢 以上来自于百度翻译 以下为原文 Hi All, Am using CYBLE 012012-00 I have DS1307 tiny RTC module which I2C based from which i want get data. Below is code snippet of my code:- while(I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterStatus()) { I2CM_I2CMasterClearStatus(); } while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u)); CyDelay(10); while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterWriteByte(0x00u)); CyDelay(10); while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendRestart(0x68u, 0x1u)); CyDelay(10); d1 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d2 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d3 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d4 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d5 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d6 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d7 = I2CM_I2CMasterReadByte(I2CM_I2C_ACK_DATA); d8 = I2CM_I2CMasterReadByte(I2CM_I2C_NAK_DATA); I2CM_I2CMasterSendStop(); i am not able to go forward beyond below line:- while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(0x68u, 0x00u)); not sure what to do? i am using PSOC 4 creator I have connected pins as below:- RTC---proc side vcc--3.3v gnd--gnd scl-scl(P3[5]) sda-sda(P3[4]) have anyone configured this before please help me out Thanks |
|
相关推荐
6个回答
|
|
尝试用I2C地址0x34。该累加器本身增加了R/W位。
鲍勃 以上来自于百度翻译 以下为原文 Try with I2C address 0x34. The compponent adds the R/W bit itself. Bob |
|
|
|
嗨,鲍伯, 我尝试了所有组合(如0x68、0x68 u、104、0x32、0x32 u、52)作为从属地址。 对于写入位(I2CMYI2CXRead EX-FEXY模式,0,0x0,0x0U) 但它不会过去 同时(I2CMII2CYMSTRYNONOA错误!= I2CMJI2CMASTESTESTART(104, 0); 有什么想法吗? 以上来自于百度翻译 以下为原文 Hi Bob, I tried all combinations like (0x68,0x68u,104,0x32,0x32u,52) as a slave address and for write bit (I2CM_I2C_WRITE_XFER_MODE,0,0x0,0x0u) but it wont go past while (I2CM_I2C_MSTR_NO_ERROR != I2CM_I2CMasterSendStart(104, 0)); any idea? |
|
|
|
神圣奇迹 发表于 2019-1-7 07:16 0x34不在你的列表中。你的上拉电阻有多少欧姆? 鲍勃 以上来自于百度翻译 以下为原文 0x34 is not in your list. How many ohms are your pull-up resistors? Bob |
|
|
|
你好鲍勃 实际上,它的0×34错误我在这里写了0×32。 使用小型RTC DS1307模块的示意图显示3.3K上拉电阻 以上来自于百度翻译 以下为原文 Hi bob Actually its 0×34 by mistake i written 0×32 here in post. Have used tiny rtc ds1307 module who's schematics shows 3.3k pull-up resistor |
|
|
|
最后的机会:使用逻辑分析仪或范围来检查信号。当启动命令失败时,信号错误。 我脑海中浮现的是:你是否忘记了I2CYSTART()命令? 鲍勃 以上来自于百度翻译 以下为原文 Last chance: Use a logic analyzer or a scope to check the signals. When the start command fails something with the signals is wrong. Just came to my mind: could it be you forgot the I2C_Start() command? Bob |
|
|
|
I2CYSTART()函数已经被调用。 是的,我必须探测信号。 谢谢你的帮助。 以上来自于百度翻译 以下为原文 I2C_start() function is already called. Yes i have to probe the signals. Thanks for the help. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2077 浏览 1 评论
1829 浏览 1 评论
3645 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1771 浏览 6 评论
1517 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
525浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
378浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
416浏览 2评论
363浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
873浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 19:44 , Processed in 1.039834 second(s), Total 87, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号