完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,所有,我一直在跟踪一个问题与EASART模块,看起来像一个候选者的硅勘误表,但它目前没有记录。我想分享我的评论和可能的建议(当然,我可能会做错什么)。[侧记:我刚刚把我的项目从PIC18F4620移植到一个更新的设备,因为另一个EASART硅勘误表。在18F4620中,当TXREG与停止位(ErraTaA 33)相同的周期写入时,发送了一些额外的零字节。我没有收到问题,但建议的解决办法是不可接受的,所以我已经移动到18F25K80。我没想到会被另一个EuSART相关的问题所困扰。问题是:从中断处理程序内部的RCREG1读取(检查RCIF之后)返回一个与串行线上接收的字节不同的损坏字节。另外的证据(我做的测试结果):1)数据正在SE中。NT来自PC计算机,但我确信字节在接收上损坏,而不是发送方的,因为我已经用USB逻辑分析仪检查了RX PIN。顺便说一下,这是异步串行(Syc=0)。2)没有波特率不匹配:我知道波特率编程是好的,因为我看到TX的比特宽度与RX的比特宽度相同。顺便说一下,我使用了115200,并且所有的BRG编程都是由“我定义的X-TalthFRIQ”值参数化的。3)腐败是“振荡器依赖的”。在一定的条件下,根据时钟值,期望的0x00字节被转换成0x21或0x42。我的结果是(BRGH=1和BRG16=1):3.1)振荡器=16 MHz×4,PLL=64 MHz=&;RxReG1读取0x21而不是预期的0x03.2)振荡器=iNoSc 8 MHz×4 PLL=32 MHz=& gt;RxReG1读取0x42而不是预期的0x00 OBs:是的,我们在这里看到一个模式构建…但是,4兆赫×4 PLL=16兆赫,我的程序根本没有工作,我不想调查。我可以试试它的增益。3.3)振荡器= InOSC 16 MHz x 1(没有PLL)=16兆赫=gt;没有腐败!4小时)腐败也依赖于BRGH/BRG16设置。结果3.1至3.3已获得BRGH=1和BRG16=1。总结:4.1)振荡器=16 MHz×4,PLL=64兆赫,BRGH=1,BRG16=1=&>;腐败。4.2)振荡器=16 MHz×4 PLL=64兆赫,BRGH=0,BRG16= 1=&>;不腐败。和4.3都使用不同的波特率公式“FoC//(16(n + 1)””比4.1“FoC//(4(n+1))”,所以似乎问题是依赖于振荡器设置和波特率发生器电路。5)尽管0x00=& gt;0x21/0x42可能对一些额外的研究有用,但这并不是唯一的腐蚀。我见过。我还注意到其他不同的字节被破坏,我不确定腐败是否取决于接收的确切字节,或者是否与同时发送的字节有关。所以,不要把这个案子当作一个规则,它只是碰巧我重复了一个特定的协议,在某些特定的字节中最可能发生的腐败就像我提到的0x00,但并不总是这样。6)我检查了错误条件ORR和FER,没有一个。7)我认为它可能是一些K。IN的电气问题,所以我尝试添加更多的解耦电容器,更多的VDDCORL/VCAP,添加“坦克”钽电容器并联到陶瓷100NF解耦等没有变化。BTW,该设备正在运行5V。目前,我继续我的发展与4.3列出的设置。然而,能够使用其他波德率公式(4.1)是很好的,因为它在选择项目即将运行的更高波特率方面提供了更多的灵活性。
以上来自于百度翻译 以下为原文 Hi all, I've been tracking an issue with the EUSART module that looks like a candidate for silicon errata but it's currently not documented. I'd like to share my findings for comments and possible suggestions (of course, i might be doing something wrong). [Side note: I've just ported my project from PIC18F4620 to a newer device due to another EUSART silicon errata. With 18F4620 I had some extra zero bytes being sent when TXREG is written in the same cycle as the stop bit (errata #33). I had no receiving problems there, but the suggested workaround was not acceptable so I've moved to 18F25K80. I didn't expect to be bitten by another EUSART related issue.] The problem: reading from RCREG1 inside the interrupt handler (after checking RCIF) returns a corrupt byte that is different from the byte received on serial line. Additional evidence (results from tests i've made): 1) The data is being sent from a PC computer, but I'm sure the byte is corrupt on reception, and not on sender's side, because I've checked with an u*** logic analyzer tapping on the RX pin. btw, this is async serial (SYNC=0). 2) There is no baudrate mismatch: i know my baud rate programming is good because I see on scope that TX's bit width are the same as RX's bit width. Btw, i'm using 115200 and it all BRG programming is parametrized by the "#define _XTAL_FREQ" value i use. 3) The corruption is "oscillator dependent". In a certain condition I see a expected 0x00 byte being turned into either 0x21 or 0x42, depending on the clock value. The results I have are (BRGH=1 and BRG16 = 1): 3.1) Oscillator = INTOSC 16 MHz x 4 PLL = 64 MHz => RXREG1 reads 0x21 instead of expected 0x00 3.2) Oscillator = INTOSC 8 MHz x 4 PLL = 32 MHz => RXREG1 reads 0x42 instead of expected 0x00 obs: yes, we see a pattern building here... but with 4 MHz x 4 PLL = 16 MHz my program didn't worked at all and i didn't care to investigate. i may try it gain. 3.3) Oscillator = INTOSC 16 MHz x 1 (NO PLL) = 16 MHz => no corruption! tested for hours flawlessly. 4) The corruption is also dependent on BRGH/BRG16 settings.The results 3.1 to 3.3 have being obtained with BRGH=1 and BRG16 = 1. Summarizing: 4.1) Oscillator = INTOSC 16 MHz x 4 PLL = 64 MHz, BRGH = 1, BRG16 = 1 => corruption. 4.2) Oscillator = INTOSC 16 MHz x 4 PLL = 64 MHz, BRGH = 0, BRG16 = 1 => no corruption. 4.3) Oscillator = INTOSC 16 MHz x 4 PLL = 64 MHz, BRGH = 1, BRG16 = 0 => no corruption. Please notice that 4.2 and 4.3 both use a different baudrate formula "fosc/(16(n+1))" than 4.1 "fosc/(4(n+1))" so it seems the issue is dependent on both oscillator settings and and baud rate generator circuitry. 5) Although the 0x00 => 0x21/0x42 may be useful for some additional research, this is not the only corruption i've seen. I've also noticed other different bytes being corrupted and i'm not sure if the corruption depends on the exact byte being received or if it's related to the one being sent at the same time. So don't take this case as a rule, it just happens that i'm repeating a certain protocol and the corruption happens most likely in some specific bytes like the 0x00 i've mentioned, but not always. 6) I've checked for error conditions OERR and FERR and there is none. 7) I've thought it could be some kind of electrical problem so I've tried adding more decoupling capacitors, more vddcore/vcap, adding "tank" tantalum capacitors in parallel to the ceramic 100nF decoupling etc. No change. Btw, the device is operating with 5V. Currently I'm continuing my development with the setting listed in 4.3. However it would be nice to be able to use the other baudrate formula (4.1) as it gives more flexibility in choosing the higher baudrates the project will be operating soon. regards, Miguel |
|
相关推荐
10个回答
|
|
|
|
|
|
好奇。我可以想到“尖峰”被看作是开始位,但是…谁知道呢。
以上来自于百度翻译 以下为原文 Curious. I could think of "spikes" that are seen as start bits but... who knows. |
|
|
|
我猜想这一定是有意义的。我怀疑尖峰会被认为是一个虚假的开端,因为任何电气工程师在决定钻头时都会选择一个绝大多数的电路(我猜是内部芯片设计)。异步串行还必须再次采样的信号在位中,以确保这是一个真正的开始,所以尖峰几乎不这样做,但我目前的猜测是“超调”的快速切换可能是罪魁祸首。超调到高于电源的水平很容易使很多IC出错。一些不吉利的组合BRGH=BRG16=1设置和时钟使PIC更易受此影响,怎么知道?我有一个新的证据:8)将5V串行端口(FTDI)替换为3.3V(PIC的电源也改变为3.3V)的ARM处理器似乎已经解决了这个问题。使用BRGH/BRG16/64兆赫,到目前为止还不错。下一步我会把波特增加到Mbps范围。
以上来自于百度翻译 以下为原文 I'm guessing it must be something in this direction. I'd doubt the spike would count as a spurious start because any electrical engineer would opt for a kind majority circuity when deciding the bit (i'm guessing the internal chip design). Async serial also has to sample again the signal at the mid of the bit to make sure it's really a start, so spikes hardly do it. However my current guess is the "overshoot" of the fast switching might be the culprit. overshooting to levels higher than power supply can easily make a lot of ICs mi***ehave. Some unlucky combination the BRGH=BRG16=1 settings and clock make the PIC more susceptible to this, how knows? I have a new evidence: 8) Replacing the 5V serial port (FTDI based) with an ARM processor running on 3.3V (supply of the PIC also changed to 3.3V) seems to have cured the issue. Using BRGH/BRG16/64MHz and it's fine so far. Next steps I will increase the baud to the Mbps range. |
|
|
|
你的意思是,PIC等,但你改变了接口到PC?
以上来自于百度翻译 以下为原文 You mean, same PIC etc but you changed the interface to the PC? |
|
|
|
是的,同样的图片,同样的代码。我只是换了另一端(电源电压)。
以上来自于百度翻译 以下为原文 Yes, same PIC, same code. I just changed the other end (and power supply voltage). |
|
|
|
5V场景:PC(Linux /测试程序)& lt;=& gt;fTDI & lt;=& gt;TTL串行& lt;=& 5V PIC3.3V场景:ARM(Linux /同一测试程序重新编译)& lt;= & gt;3.3V串行& lt;=& 3.3V PICPIC PIC,相同代码。BTW,谢谢您的关注!
以上来自于百度翻译 以下为原文 5V scenario: PC (linux/test program) <=> USB <=> FTDI <=> TTL serial <=> 5V PIC 3.3V scenario: ARM (linux/same test program recompiled) <=> 3.3V serial <=> 3.3V PIC Same PIC, same code. Btw, thanks for your attention! |
|
|
|
HI,第一个重要的点是内部振荡器仅在VDD和GT之间从0到60C加上最大+/- 2%,如果您的应用需要比UART操作更大的温度范围,则可能是不可靠的,因为您可能超过+/-2%最大误差(不计数0.16%错误)。R从波德率@ 115200波特基于64兆赫)。如果你需要在0到60C以外的操作,比XTAL或共振器是必要的。在室温下,你的PIC应该是好的(假设内部校准没有被擦除)。你确定UART中的内部2级FIFO没有问题吗?我用了多年的PIC18F420和PIC18F46K22,我记不起任何问题@ 115200波特。你能发布一个项目来显示这个问题吗?当做
以上来自于百度翻译 以下为原文 Hi, The first important point is that the internal oscillator only garantees maximum +/-2% from 0 to 60C for Vdd > 2.5V If your application need a temperature range larger than that UART operation cannot be reliable because you'll potentially exceed +/-2% maximum error (not counting the 0.16% error from baudrate @ 115200bauds based on 64MHz). If you need operation outside 0 to 60C than a XTAL or resonnator will be necessary. At room temperature your PIC should be OK (assuming the internal calibration was not erased). Are you sure you have no issue with the internal 2 level FIFO in the UART ? I have used for years the PIC18F4520 and PIC18F46K22 and I cannot remember any issue @ 115200bauds. Can you post a project showing the issue ? Regards |
|
|
|
嗨,RISC,非常好的分数,谢谢。是的,我的应用程序不会运行在0-60C之外,但我会考虑到这一点。在检查RCIF之后,我读取了RCREG内部中断,并且还检查了ORR标志是否溢出。根据他们的说法,他们从来没有发生过。你认为有什么其他的方法可以搞乱内部2级FIFO吗?我也是!自从2000年初以来,我有过PIC16系列串行端口(与PIC18非常相似)的经验,我从来没有见过这样的问题。我几乎确信“超调导致IC出错”的理论,因为PIC18F25K80的EASART从昨天起运行在1.3 Mbps。在3.3V没有任何单一错误。问候,米格尔
以上来自于百度翻译 以下为原文 Hi RISC, Very good points, thank you. Yes, my application won't be operating outside 0-60C but I'll take this into account. I read RCREG inside interrupt, after checking RCIF, and do also check OERR flags for overrun. According to OERR they did never occur. Do you think of any other way I could be messing with the internal 2 level FIFO? Me too! I have experience working with PIC16 family serial port (which is quite similar to PIC18) since early 2000's and I've never seen this kind of problem. I'm almost convinced of the "overshoot causing IC to mi***ehave" theory since I have the PIC18F25K80's EUSART running fine at 1.3 Mbps since yesterday at 3.3V without any single error. regards, Miguel |
|
|
|
这是一个相当容易看到的范围。您使用的是什么FTDI适配器?
以上来自于百度翻译 以下为原文 That's something that should be fairly easy to see/prove out with a scope. What FTDI adapter are you using? |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5253 浏览 9 评论
2038 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3219 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2267 浏览 5 评论
792浏览 1评论
688浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
617浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
686浏览 0评论
586浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-30 15:15 , Processed in 1.932955 second(s), Total 67, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号