1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
处理器:PIC16F18854 Rev 11MPLABX 3.51 MPASM 5.71Linux:MaGeIA5RealEng1.4614或ICD3 1.4614。这个项目最初是在PIC16C62的汇编程序中编写的,然后它被改编成PIC16F870的工作,现在它被改编成PIC16F18854,就像以前的芯片正在变的一样。IVE,加上使用18854中可用的一些额外资源可以改进产品。当time1H加载字节时,它有时会加载,但是当TMR1L低字节被清除时,高字节也被清除。在其他情况下,运行高字节不加载的代码完全相同。计时器没有在此时运行,因为它仍在初始化。如果计时器先加载低字节,则高字节永远不会加载,即停留在0x00上。然后,我在Time3和Time5上尝试与Time1相同的事情,并且不管我是否先加载高字节或低字节,它们都表现得出乎意料。然后我尝试了第二个设备,以防我损坏了第一个设备,它的运行方式也一样。(我的代码是使用一个修改后的.Cube文件运行的,该文件添加到所有SFR中。这使得跟踪银行TMR1HYB4更容易,并且如果已经在正确的银行中避免不必要的银行切换)。
以上来自于百度翻译 以下为原文 Processor: pic16f18854 rev 2001 Mplabx 3.51 Mpasm 5.71 Linux: Mageia 5 Real Ice 1.46.14 or ICD3 1.46.14 This project was originally written in assembler for a pic16C62, then it was adapted to work on a pic 16f870 and now it is being adapted to run on a pic16f18854 as the previous chip is becoming expensive, plus the product can be improved using some of the extra resources available in the 18854. When timer1H is loaded with a byte, it sometimes loads but when the TMR1L low byte is cleared, the high byte is also cleared. On other occasions, running exactly the same code the high byte does not load. The timer is not running at this point as it is still being initialized. If the timer is loaded low byte first, the high byte never loads i.e. stays on 0x00. I then tried the same thing on timer3 and timer5 which are the same as timer1, and they behave as expected regardless of whether I load the high or low byte first. I then tried a second device in case I damaged the first one, and it behaves the same way. Has anybody else experienced problems with this timer? (My code is running using a modified .include file with the bank number added to all the SFR's. This makes it easier to keep track of the bank e.g TMR1H_B4 and avoid unnecessary bank switching if already in the correct bank). Attachment(s) timr.asm (1.35 KB) - downloaded 30 times |
|
相关推荐
8个回答
|
|
尝试清除T1CON的位1,看看它是否工作得更好。
以上来自于百度翻译 以下为原文 Try clearing bit 1 of T1CON and see if it works better. |
|
|
|
谢谢,就是这样,现在我有了可预测的行为。在我看来,这应该会随着T1CON位1的清除而下降,作为解决办法,这样其他人就不会在这个问题上浪费时间了。如果一个bug总是以相同的方式运行,那么它比不可预测的问题要小得多,只要用户知道该bug。顺便说一下,我试着用设置了T3CON位1的T3加载T3,然后它表现出与定时器1相同的不良行为。所以我猜这个问题对于定时器1,3和5是很常见的。
以上来自于百度翻译 以下为原文 Thank you, that does the trick, now I have predictable behaviour. In my opinion this should go down in the silicon errata with clearing of T1CON bit 1 as a workaround so other people do not waste time on this problem. A bug that always behaves in the same manner is much less of a problem than an unpredictable one provided that the bug is known to the users. Incidentally, I tried loading T3 with the T3CON bit 1 set and it then exhibits the same bad behaviour as timer1. So I guess the problem is common to timers 1,3 and 5. |
|
|
|
我猜你没有费心去读那个东西。
以上来自于百度翻译 以下为原文 I guess you didn't bother reading what that bit does. |
|
|
|
实际上我读过bit 1所做的,但是我的初步数据表在这方面没有太大帮助。在pic16f18854数据表40001826A.pdf的第383页,它给出:bit 1RD16:Timer1 On bit 1==Enables Timer1 0=停止Timer1并清除Timer1门触发器位0ON: ]Timer1 On位1 ggngmd+arial,serif"]=停止Timer1并清除Timer1门触发器从这个描述中,它出现rs是位0的副本。这是否意味着我必须将位0和位1都清除为停止Timer1并设置两个位来运行它?这将CelTA[字体= GGNGMD + ARIAL,serif ]是最不寻常的。[字体= GGNGMD + ARIAL,serif ] [字体= GGNGMD + ARIAL,serif ] [字体= GGNGMD + ARIAL,serif ] ]如果您对这一位实际上做了什么[字体= GGNGMD + ARIAL,serif ]的进一步了解,请[字体= GGNGMD + ARIAL ]。“serif”,你和我们分享。
以上来自于百度翻译 以下为原文 Actually I did read what bit 1 does but the preliminary datasheet I have is not very helpful in this regard On page 383 of the pic16f18854 datasheet 40001826A.pdf it gives: bit 1 RD16: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 and clears Timer1 gate flip-flop bit 0 ON: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 and clears Timer1 gate flip-flop From this description it appears to be a duplicate of bit0. Does this mean I have to clear both bit 0 and bit 1 to stop Timer1 and set both bits to run it? This would certainly be most unusual. If you have further knowledge of what this bit actually does, please could you share it with us. |
|
|
|
我以前的文章看起来很糟糕——请忽略。实际上我读了1位的数据,但是我在PIC16F18854数据表383 0181826A.PDF的第383页上的初步数据表不是很有帮助:BIT 1RD16: Time1在BIT1= =启用Time10=停止Time1并清除Time1。门触发器0上:TIME1在BIT1=使Time10=停止Time1和清除Time1栅极触发器从这个描述,它似乎是一个重复的位0。这是否意味着我必须清除0位和1位来停止计时器1并设置两位来运行它?这肯定是最不寻常的。如果你对这个钻头实际做了进一步的了解,请你和我们分享一下。
以上来自于百度翻译 以下为原文 My previous post looks horrible - please disregard. Actually I did read what bit 1 does but the preliminary datasheet I have is not very helpful in this regard On page 383 of the pic16f18854 datasheet 40001826A.pdf it gives: bit 1 RD16: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 and clears Timer1 gate flip-flop bit 0 ON: Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 and clears Timer1 gate flip-flop From this description it appears to be a duplicate of bit 0. Does this mean I have to clear both bit 0 and bit 1 to stop the timer 1 and set both bits to run it? This would certainly be most unusual. If you have further knowledge of what this bit actually does, please could you share it with us. |
|
|
|
比特信息处于一个相当模糊的位置。它位于勘误表第13页。
以上来自于百度翻译 以下为原文 The bit information is in a fairly obscure location. It is located on page 13 of the errata. |
|
|
|
他们在这部分使用了PIC18TMR1模块,但他们并没有真正记录16位模式。这是从PIC18手册,这大概也适用于这个PIC:
以上来自于百度翻译 以下为原文 They've used the PIC18 TMR1 module in this part, but they haven't really documented the 16-bit mode anywhere. This is from a PIC18 manual which presumably also applies to this PIC: |
|
|
|
啊哈,现在我明白了。谢谢您的咖啡评论家和寺庙。(信息发现在PIC1887硅勘误文件编号800万702B.PDF的第13页,而不是在我使用PIC18854的部分的勘误表中)。
以上来自于百度翻译 以下为原文 Ahhh - now I get it. Thank you coffee critic and jtemples. (Info found on page 13 of pic18857 silicon errata document number 80000702B.pdf, not in the errata for the part I am using pic18854). |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
776浏览 1评论
665浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
594浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
675浏览 0评论
575浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 21:28 , Processed in 1.496692 second(s), Total 89, Slave 73 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号