Microchip
直播中

徐振方

7年用户 150经验值
私信 关注
[问答]

PIC16F18313未记录的错误:同步模式下的USART丢失数据

你好,我从来没有使用过这个william hill官网 ,但是我使用PIC单片机已经有很长时间了。最近,我想我在PIC16F18313 EASART1中发现了一个硅错误。当使用同步模式时,如果写入最后一个字节是TRAN时,数据可能丢失(丢失的数据和时钟)。StFrand(在TSR)中,它是最后一个比特(第七或第八)。我在“Meal.C”中提供了一个示例代码,其中有两个测试(只是取消了Meal.C中的一个测试行来选择测试):测试是用16MHz的内部振荡器用2x PLL完成的。在相同的结果下,使用XC8 1.44(MPLAX 4.01中的默认设置)在空闲模式下编译。硬件测试是PIC16F18313 Rev 200 4H(A4)。Test1:执行对传输的延迟增加,在Seop.Test2上显示正确和不正确的传输:执行对传输。使用Test1和多比特模式的有问题的延迟来显示哪些位被正确地通过该线发送(它也在每对之前重置EUSAT以获得相同的结果)。注意:如果测试是使用其他波特率/ CPU速度执行的,则必须相应地调整延迟。EST结果:在这里,您可以看到对6,9和10的截断时钟。这里从一个正确的传输(16个时钟)放大的数据,然后是一个截断传输(9个时钟)。最后一个是TEST2的结果。它显示了一组具有不同位模式的截断传输。它表明前8位被传输OK,只有第二字节的第一位被转移。解决方法:如果你想继续使用双缓冲功能(如我所愿):没有。有什么建议吗?如果您能够释放双缓冲功能:不中断:仅在最后一个字节已完全移位时,才使用TrMT(而不是TXIF)将数据写入TXRG。中断:使用定时中断写入TXRG(而不是TXIF)。结论:这应该包含在勘误表文件和同一个家庭的其他设备测试,以了解所有受影响的设备/修订。如果可能的话,它应该被固定在下一个受影响的设备的硅修订。我还没有能够测试最新的PIC16F18313硅修订版(A6),因为所有购买的设备似乎仍然是静止的。A4

以上来自于百度翻译


      以下为原文

    Hello.
I've never used this forum, but I've been using PIC microcontrollers for a long time.

Recently, I think I've found a silicon bug in the PIC16F18313 EUSART1.
When used in synchronous mode, data may get lost (missing data and clock) if write to the TXREG is done when the last written byte is transferring (in TSR) it's last bits (7th or 8th).

I've provided a sample code in "main.c" with two test (just uncomment one of the test lines in main.c to select the test):

Testing is done using internal oscillator at 16Mhz with 2x PLL.
EUSART baudrate is set to 1Mhz (Speeds from 1-4Mhz have been tested with same results).
Compiled in free mode using XC8 1.44 (and default settings in MPLAB X 4.01).
Hardware tested is PIC16F18313 rev 2004h (A4).

Test1: executes pairs of transfers with an increasing delay, showing both correct and incorrect transfers on the scope.
Test2: executes pairs of transfers with using a problematic delay from test1 and multiple bit patters to show which bits are correctly send through the wire (It also resets the EUSART before each pair to get the same result each time).

Note: If testing is performed using other baudrates / CPU speeds, delays must be adjusted accordingly.

Test Results:

Here you can see truncated clocks at pair 6,9 and 10.


Here the zoomed data from one correct transfer (16 clocks) followed by a truncated transfer (9 clocks).


This last one is the result of test2. It shows a set of truncated transfers with different bit patterns.
It shows that the first 8 bits are transfered ok and only the first bit of the second byte is transfered.

Workarounds:
If you want to keep using the double buffer functionality (as I wanted):
NONE. Any suggestions?
If you can afford to loose the double buffer functionality:
Without interrupts: Poll the TRMT (instead of TXIF) to write data to TXREG only when last byte has been completely shifted.
With interrupts: Use a timer interrupt to write to TXREG (instead of TXIF).

Conclusions:
This should be included in the errata documents and tested with other devices of the same family to know all affected devices/revisions.
If possible, it should be fixed on next silicon revisions of affected devices.
I've not been able to test the newest PIC16F18313 silicon revision (A6) because all devices bought seem to be still A4.
   Attachment(s)

main.c (5.14 KB) - downloaded 29 times

回帖(4)

tijing忽忽

2018-9-26 16:48:37
也许更好的方式来报告这将是一个支持票到Microchip。Microchip人事可能会或可能不会在用户william hill官网 中阅读这篇文章。这篇文章仍然很有价值,因为一些其他用户可能有重要的信息,或者可以使用你的信息,但是它不是保证信息到微芯片的方式。

以上来自于百度翻译


      以下为原文

    Possibly a better way to report this would be with a support ticket to Microchip. Microchip personnal may or may not read this particular post in a user forum.
This post is still valuable as some other user may have important information about it or can use your info however it is not a guaranteed way to get the info to Microchip.
举报

吴键洪

2018-9-26 17:02:31
这是一个HTTP://www. McCHIP.COM/FUMMS/M1051559ASPXX的复制品,可能是“前两个帖子需要批准PITA”的另一个受害者。

以上来自于百度翻译


      以下为原文

    This is a duplicate of http://www.microchip.com/forums/m1051559.aspx
Probably another victim of the "first two posts require approval PITA".
 
举报

吴秀英

2018-9-26 17:21:19
它不是一个,而是在发布时说未知错误的一个:HTTP://www. McCHIP.COM/FUMMS/M94732.ASPXPOST,然后错误,编辑,没有正确地格式化文本,发布,最终找到了正确格式的方法,没有错误,但是由于批准坑不能编辑原来的文本。A.格林先生:请一些管理员,如果可能的话删除这个线程,另一个是好的。

以上来自于百度翻译


      以下为原文

    It's not that one, but the one saying unknown error when posting:
 
http://www.microchip.com/forums/m947432.aspx
 
Posted then error, edited, without formatting text properly, posted, finally found the way to format it properly without error but could not edit the original one because of the approval PITA.mr green:
 
Please some admin, remove this thread if possible, the other one is the good one.
举报

陈晨

2018-9-26 17:31:39
没有管理员将审查或删除此线程。不在这个william hill官网 上。

以上来自于百度翻译


      以下为原文

    No Admin will review or remove this thread.  Not on this forum.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分