完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我在MCC生成的源中发现了一个bug,它导致PIC和从属设备之间的重复事务,但是我不知道在哪里报告。MCC生成I2C1.C。在这个文件中,第684行应该感谢,丹尼尔。K。
以上来自于百度翻译 以下为原文 Hi, I just found a bug in a MCC-generated source which causes duplicate transactions between PIC and slave devices, but I don’t know where to report. The code is generated by choosing PIC16F18346 and MSSP1. MCC generates i2c1.c. In this file, line 684, while(i2c1_state != S_MASTER_IDLE); should be while(i2c1_state != S_MASTER_IDLE) Thanks, Daniel.K |
|
相关推荐
7个回答
|
|
你确定吗?那之后直接发生了什么?第一个窗体(“不执行循环”)是一种常见的等待特定状态标志更改的方式。
以上来自于百度翻译 以下为原文 Are you sure? What comes straight after that? The first form ( a "do nothing loop") is a common way to wait until a particular status flag changes. |
|
|
|
我上传更多的代码用于理解。//用于中断的IF(*pFLAG==I2C1YMasaGug等待){(I2C1LY状态)!{s/MistelyDelphi;{//强迫任务运行,因为我们知道队列有/ /需要发送PIR1BITS。SSP1IF=TRUE;} //块,直到请求完成为止。
以上来自于百度翻译 以下为原文 I upload more code for understanding. // for interrupt based if (*pflag == I2C1_MESSAGE_PENDING) { while(i2c1_state != S_MASTER_IDLE); { // force the task to run since we know that the queue has // something that needs to be sent PIR1bits.SSP1IF = true; } } // block until request is complete |
|
|
|
我上传更多的代码用于理解。//用于中断的IF(*pFLAG==I2C1YMasaGug等待){(I2C1LY状态)!{s/MistelyDelphi;{//强迫任务运行,因为我们知道队列有/ /需要发送PIR1BITS。SSP1IF=TRUE;} //块,直到请求完成为止。
以上来自于百度翻译 以下为原文 I upload more code for understanding. // for interrupt based if (*pflag == I2C1_MESSAGE_PENDING) { while(i2c1_state != S_MASTER_IDLE); { // force the task to run since we know that the queue has // something that needs to be sent PIR1bits.SSP1IF = true; } } // block until request is complete |
|
|
|
完全正常。while行等待开始条件设置,然后下一个块设置SSPIF。它不尝试多次设置SSPIF,直到开始完成。
以上来自于百度翻译 以下为原文 Perfectly normal. The while line waits for the Start condition to be set, then the next block sets SSPIF. It is NOT trying to set SSPIF multiple times until the Start completes. |
|
|
|
然后我想这样写。//用于中断的IF(*pFLAG==I2C1YMasaGug等待){(I2C1LY状态)!(= SyMistelIDLE);/ /强制执行任务,因为我们知道队列有/需要发送PIR1BITS。SSP1IF=TRUE;} /块,直到请求完成为止。
以上来自于百度翻译 以下为原文 Then I would like to write like this. // for interrupt based if (*pflag == I2C1_MESSAGE_PENDING) { while(i2c1_state != S_MASTER_IDLE); // force the task to run since we know that the queue has // something that needs to be sent PIR1bits.SSP1IF = true; } // block until request is complete |
|
|
|
我发布了这个帖子的根本原因。请参阅HTTP://www. McCHIP.COM/FUMUS/M1001673.ASPXY感谢您,丹尼尔。K
以上来自于百度翻译 以下为原文 I posted the root cause of this post. Please see http://www.microchip.com/forums/m1001673.aspx Thank you, Daniel. K |
|
|
|
是的,我最近测试过MCC,很方便,但是质量代码很差,至少这个I2C主代码不是一个健壮的驱动程序(PIC18):1。可能的空指针写入,如果上拉电阻器失败或其他,Pi2iC1YOLD可以是空指针,因为初始化是在这个代码之后。2。“静态”I2C1TyActhOngRealEclipse块TrBug;在FuncI2C1MrimeWrrad中。它仅适用于I2C1CONTIONTRAIQueLeSyLange= 1。所以为什么Trb阙?UE在这个驱动程序中使用吗?
以上来自于百度翻译 以下为原文 yes, I've test MCC recently, convenient but seems bad quality codes, at least this I2C master code is not a robust driver(PIC18): 1. possible NULL pointer written , if pull up resistor failed or something else, p_i2c1_current could be NULL pointer, since initialization is after this codes. // Check first if there was a collision. // If we have a Write Collision, reset and go to idle state */ if(I2C1_WRITE_COLLISION_STATUS_BIT) { // clear the Write colision I2C1_WRITE_COLLISION_STATUS_BIT = 0; i2c1_state = S_MASTER_IDLE; *(p_i2c1_current->pTrFlag) = I2C1_MESSAGE_FAIL; // reset the buffer pointer p_i2c1_current = NULL; return; } 2. "static" I2C1_TRANSACTION_REQUEST_BLOCK trBlock; in func I2C1_MasterWrite. It's valid only with I2C1_CONFIG_TR_QUEUE_LENGTH = 1. so why TRB queue is used in this driver? |
|
|
|
只有小组成员才能发言,加入小组>>
5183 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3178 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2229 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
510浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 19:31 , Processed in 1.333432 second(s), Total 89, Slave 72 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号