完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
嗨,我已经产生了I2C驱动程序和谐。我需要在EEPROM中连续地在5个不同的位置写入数据。但是我的代码挂在DRVIII2CYBuffRyEngEngError事件中。如果(EEPRODATA.I2CBuffErrase= = DRVIII2CYBuffrEyEngEngRead错误){EEPRODATA.I2CSTATE= EEPROMYI2CYEL错误;}但在调试后向每个位置写入数据后给出断点。在这种情况下,代码不会挂在DRVIII2CYBuffelyEvthyError上,有人能帮我解决这个问题吗?
以上来自于百度翻译 以下为原文 hi, I have generated I2C driver in hARMony. I need to write data in eeprom continuous at 5 different location continuously. But my code hangs in DRV_I2C_BUFFER_EVENT_ERROR event. if(eepromData.I2CBufferEvent == DRV_I2C_BUFFER_EVENT_ERROR) { eepromData.i2cStates = EEPROM_I2C_ERROR; } But while debugging giving breakpoint after writing data to each location. In this case code doesn't hangs to DRV_I2C_BUFFER_EVENT_ERROR can anyone help me with this....... |
|
相关推荐
14个回答
|
|
|
只有在I2C上看到的错误是当从设备保持SDA低时,建议:在PIC复位时其他设备是否正确复位?如果没有,它可能仍在驱动SDA低。检查范围或仪表。您可能需要时钟SCL,直到其他设备释放SDA。如果其他设备具有单独的电源、电池备份等(DS323 2M数据表对此有注意),也会发生这种情况。
以上来自于百度翻译 以下为原文 Only error I saw on I2C was when slave device held SDA low. Suggest: - Did other device get properly reset when PIC was reset? If not it may still be driving SDA low. Check with scope or meter. You may need to clock SCL until other device releases SDA. This can also happen if other device has separate power source, battery backup, etc. (DS3232M datasheet has note about this). |
|
|
|
|
|
HI,如果试图以太短的间隔多次写入I2C EEPROM,将有:从第二次和后续尝试报告的DRVIII2CYBuffReEngError错误状态值。如果写入I2C EEPROM,则立即尝试从同一EEPROM芯片读取。相同的操作可以尝试L。在一段时间后,I2C EEPROM将再次准备好。迈西尔
以上来自于百度翻译 以下为原文 Hi, If trying to write to I2C EEPROM multiple times with too short interval, there will be: DRV_I2C_BUFFER_EVENT_ERROR status value reported from second and following attempts. Same if writing to I2C EEPROM, and then immediately trying to read from the same EEPROM chip. The same operation may be tried later, after some time I2C EEPROM will be ready to ansver again. Mysil |
|
|
|
|
|
|
|
|
|
|
|
电源是PIC32和EEPROM的常用电源。我给I2C EEPROM写了5次,给出了E.EncDATA.I2CSTATE==EEPROMYI2C2IDLE;而(i(5))if((EEPRODATA.I2CSTATE==EEPROMETII2CYALE))(EEPROMEDATIONI2CSTATE==EEPROMETII2CYSTART){MMESET(EEPROMWORTELCOC,0,40);EEPROMYROC。0);/ / EEPROM EEPROMWORTELCO.[地址]字节EEPROMYROC。字节[0 ];EEPROMWORDELCOC [1 ]=EEPROMETHOROC。字节[1 ];STRCAT(和;EEPROMWORDELCOC(2),“Hello”);EEPROMDEATA.I2CSTATEE= EEPROMYI2C2写;EEPROMYI2C2DATAWAWWRADE();否则,如果(EEPRODATA.I2CSTATE==EEPROMETII2CWAITITX写){ReT1= EEPROMYI2C2DATAWAWRADE();(//trueIf(EEPRODATA.I2cBuffeEngult==DrvII2CyBuffelyEvestRoad完成)//false(EEPRODATA.I2CBuffeEngult==DRVIII2CyBuffrEythEngError错误)如果(ReT1=1){EEPRODATA.I2CSTATE==EEPROMETII2CYIDLE;I++;RIT1=0;}}
以上来自于百度翻译 以下为原文 power source is common for PIC32 and EEPROM. I am writing to I2C EEPROM for 5 times as given below. eepromData.i2cStates == EEPROM_I2C_IDLE; while(i<5) { if((eepromData.i2cStates == EEPROM_I2C_IDLE)||(eepromData.i2cStates==EEPROM_I2C_START)) { memset(EEPROMWriteloc,0,40); EEPROM_loc.word=EEPROM_Section(0); //address of eeprom EEPROMWriteloc[0]=EEPROM_loc.byte[0]; EEPROMWriteloc[1]=EEPROM_loc.byte[1]; strcat(&EEPROMWriteloc[2],"hello"); eepromData.i2cStates = EEPROM_I2C_WRITE; EEPROM_I2C_DATA_WRITE(); }else if(eepromData.i2cStates == EEPROM_I2C_WAIT_WRITE) { ret1=EEPROM_I2C_DATA_WRITE(); //true is if(eepromData.I2CBufferEvent ==DRV_I2C_BUFFER_EVENT_COMPLETE) //false if(eepromData.I2CBufferEvent == DRV_I2C_BUFFER_EVENT_ERROR) if(ret1==1) { eepromData.i2cStates == EEPROM_I2C_IDLE; i++; ret1=0; } } } |
|
|
|
|
|
我能写一次数据,但在再次写入数据时,如果在每次写操作后都使用断点,它会被粘在DRVIII2CYBuffSerII事件中。PIC32和EEPROM的电源是相同的。如何解决问题?
以上来自于百度翻译 以下为原文 I am able to write data once but while writing data again it get stuck to DRV_I2C_BUFFER_EVENT_ERROR if I use breakpoint after every write operation it works. Power source is same for PIC32 and EEPROM. How can I solve issue? |
|
|
|
|
|
|
|
|
|
|
|
HI,问题不协调驱动程序或I2C EEPROM。当DRVIII2CYBuffRyEngEtError错误被检测到时,问题在应用程序代码中。这应该发生,应用程序应该再次尝试相同的传输。或者问题是,当EEPROM在内部写操作忙时,I2C从设备返回NACK,原因是I2C从设备返回NACK。和声驱动程序没有像Irc-EEPROM设备有关DRVIII2CYBuffRyEngEndoAdSerssNoAcKeSee数据表的“确认”状态。迈西尔
以上来自于百度翻译 以下为原文 Hi, Problem is Not in Harmony driver or I2C EEPROM. Problem is in application code when DRV_I2C_BUFFER_EVENT_ERROR is detected. This should be expected to happen, application should try the same transfer again. It may be possible to program a counter for maximum number of retries to be allowed. Reason for problem is that Harmony do not report reason for the status value, when reason is that I2C slave device return NACK when EEPROM is busy with internal write operation. Harmony driver there is no status like DRV_I2C_BUFFER_EVENT_ADDRESS_NO_ACK See datasheet for I2C EEPROM device about 'Acknowledge'. Mysil |
|
|
|
|
|
当EEPROM处于忙碌状态,而不是一次。写锁存缓冲器的大小与一个字节写入的时间大约相同。如果你写一个锁存器,你不需要等到忙,直到它被写入,也就是说当EEPROM变得忙碌。如果代码好,则不应该选择超时。E在同一总线上有4个设备,3个EEPROM(多EEPROM交叉/寻址)和RTC。
以上来自于百度翻译 以下为原文 Wait while the eeprom is busy, not once. Write latch buffer sizes which takes about the same time as a single byte write to compute. If you write a latch, you do not need to wait for busy until it is written, that is when the eeprom becomes busy. Timing out should not be option if the code is good. I've had 4 devices on the same bus, 3 eeproms (multi-eeprom cross/addressing) and rtc. ;---------------------------------------------------- .equ arg_Address_L, w0 ;+latch index .equ arg_Address_H, w1 .equ platch, w2 .equ cnt, w3 .equ timeout, w4 ;rtn error, w0 save_latch: rcall set_address_wr mov ptr_Latch_Buffer,platch mov [ptr_pagesize],cnt ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ loop_bk: mov.b [platch++],w0 call _i2c_write dec cnt,cnt bra nz,loop_bk call _i2c_stop ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wait_ack: call _i2c_start mov ChipSel,w0 call _i2c_write btsc I2C1STAT,#ACKSTAT bra wait_ack call _i2c_stop retlw #EPERROR_OK,w0 ;---------------------------------------------------- |
|
|
|
|
|
如果(AppDATa. I2cBuffReal==null),如果我连续写入数据,上述条件仍然是错误的。因此,每次写入时,应用程序都会给出DRVIII2CYBuffServEvestError错误。但是如果在I2C上写入数据之后使用断点,则条件变为真,并按照预期工作。在连续读写过程中,条件是真的吗?
以上来自于百度翻译 以下为原文 if(appData.I2CBufferHandle==NULL) Above condition remains false if I am writing data continuously.So application gives DRV_I2C_BUFFER_EVENT_ERROR every time I write. But if I use breakpoint after writing data over I2C above condition become true and it works as expected. What should I do to make above condition true while continuous read write process ? |
|
|
|
|
|
嗨,你不能。每次EEPROM写完成,EEPROM硬件将忙于更新EEPROM永久存储。这将花费大约5毫秒。在这个时候,没有其他可以做的,EEPROM设备将不会回答时调用。迈西尔
以上来自于百度翻译 以下为原文 Hi, You cannot. Every time EEPROM write is completed, EEPROM hardware will be busy with updating EEPROM permanent storage. This will take about 5 millisecond. In this time, nothing else can be done, and EEPROM device will not answer when called. Mysil |
|
|
|
|
|
我尝试使用5毫秒DelayStand事件生成ISDVVII2CYBuffReEvestError使用以下函数来检查Stuts.AppDATA I2CbFuleEvraseDRVIII2CyTrimeStasuSGET(AppDATA HANTELI2C0,AppDATA I2CbBuff句柄);
以上来自于百度翻译 以下为原文 I tried putting 5 milliseconds delay Still event generated is DRV_I2C_BUFFER_EVENT_ERROR using following function to check status. appData.I2CBufferEvent = DRV_I2C_TransferStatusGet ( appData.handleI2C0, appData.I2CBufferHandle ); |
|
|
|
|
|
HI,在上述情况下,在得到事件DVVII2CYBuffServEvestError错误之后,我没有重试传输。我正在检查传输状态,所以它保持在同一状态,将事件作为DRVIII2CYBuffrEyEngEtError错误。现在,在得到重传之后,我现在得到了DRVIII2CYBuffReEngEndoTebug事件。现在我试着写和读512页如果EEPROM。我能够成功地写和读203页,但之后,驱动程序不断地提供DRVIII2CYBuffReEngEnter挂起状态。如果发生DRVIII2CYBuffRyEngEvpEndol事件,下一个状态应该是什么?提前感谢…
以上来自于百度翻译 以下为原文 hi, In above case after getting event DRV_I2C_BUFFER_EVENT_ERROR I was not retrying for transmit.I was checking transfer status so it was remaining in same state giving event as DRV_I2C_BUFFER_EVENT_ERROR. Now after getting retransmit again now I am getting DRV_I2C_BUFFER_EVENT_COMPLETE event. Now I am trying to write and read 512 pages if eeprom. I am able to write and read 203 pages successfully but after that driver gives DRV_I2C_BUFFER_EVENT_PENDING state continously. What should be next state if DRV_I2C_BUFFER_EVENT_PENDING event occurs ? Thanks in advance..... |
|
|
|
|
|
嗨,一个问题:同样的问题发生在准确的203页之后,如果你用MCU和EEPROM下电,重新上电,重新启动调试器并重复实验?你使用的是PIC设备类型?您使用的是什么EEPROM设备类型?你使用的是什么和声版本?(可能并不重要,在版本2.03b的和谐中,I2C驱动程序仍然在Alpha州。)
以上来自于百度翻译 以下为原文 Hi, A question: Does the same problem occur after exactly 203 pages, if you power down the board with MCU and EEPROM, power up again, restart debugger and repeat the experiment? What PIC device type are you using ? What EEPROM device type are you using? What Harmony version are you using? (May not matter much, in version 2.03b of harmony, i2c driver was still in Alpha state.) Mysil |
|
|
|
|
|
我得到这个问题,我发送错误地址地址EEPROM。我有16位地址位置,我首先发送LSB。但我希望发送16位地址位置与MSB第一。
以上来自于百度翻译 以下为原文 I got the issue I was send wrong address location of eeprom. with 16 bit address location I was sending LSB first. But I was expected to send 16 bit address location with MSB first. Issue is solved after doing that. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 20:36 , Processed in 1.540860 second(s), Total 98, Slave 81 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1365