完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好!我目前在移植+增强为26K22到25K42I编写的固件不能获得UART1 TX中断标志,所以我认为我的代码中有一个bug。相反,代码的遗留部分就在那里,因为包含文件中有一个bug。产生任何错误,这是错误的,因为正确的位是U1TXIF,它在寄存器PiR3中。查看设备中包含的文件显示了这一点,我猜想它是这样写的,所以代码在家庭之间是可移植的,事实上第三结构在26K22包含文件中,在252中。5包含文件,但在这种情况下,它是错误的。我记得在编写代码时看到了其他错误,但是没有注意到,因为它们更明显。而且,这是对数据表的批判,这仍然是“初步的”,命名约定有很多不同之处,这是我不理解的。立…例如,TMR2类型定时器中的“定时器”位被命名为“on”和“txon”,在TMR1类型定时器中,它被命名为“on”和“tMR1on”,在tMR0定时器中是“EN”和“T0EN”等。使用单一命名约定的IMHO将是最好的东西,但那就是我。
以上来自于百度翻译 以下为原文 Hi! I'm currently working on porting + enhancing a firmware written for 26k22 to 25k42 I wasn't able to get the UART1 TX interrupt flag to set so i thought there was a bug in my code. Instead, a legacy portion of code was sitting there, because of a bug in the include file.. I can write PIR1bits.TXIF without generating any errors, which is wrong because the correct bit is U1TXIF and it is in register PIR3. Looking at the device include file shows this typedef union { struct { unsigned INT0IF :1; unsigned ZCDIF :1; unsigned ADIF :1; unsigned ADTIF :1; unsigned C1IF :1; unsigned SMT1IF :1; unsigned SMT1PRAIF :1; unsigned SMT1PWAIF :1; }; struct { unsigned :4; unsigned TX1IF :1; unsigned RC1IF :1; unsigned :1; unsigned PSPIF :1; }; struct { unsigned :4; unsigned TXIF :1; }; } PIR1bits_t; I suppose it's written like this so the code is portable between families, infact the third structure is there in the 26k22 include file AND in the 2525 include file, but in this case, it's wrong. I recall seeing other errors like this while writing code but didn't take note because they were more obvious. Also, and that's a critique to the datasheet, which is still "preliminary", there are many differences in naming conventions, which i don't understand.. For example the "Timer On" bit in TMR2 type timers is named "ON" and "TxON", in TMR1 type timers it is named "ON" and "TMR1ON" and in TMR0 timers it is "EN" and "T0EN" and other of such things.. IMHO using a single naming convention would be the best thing, but that's me |
|
相关推荐
7个回答
|
|
|
|
|
|
|
|
|
|
谢谢,我知道怎么开一张票:糟糕的是,这些日子花了4到8个星期,因为花了这么长的时间看车票,得到了道歉。
以上来自于百度翻译 以下为原文 Thanks, I know how to open a ticket :) too bad these daysit takes between 4 and 8 weeks to receive an apology for taking so long for looking at the ticket |
|
|
|
这实际上取决于,在DMA问题2个月后得到回复,但是对于编译器相关的问题只有1天!
以上来自于百度翻译 以下为原文 It actually depends, got a reply after 2 months on a DMA question; but only 1 day for a compiler related one! |
|
|
|
有趣。同样的问题在PIC18F56K42.Hin事实上,通过H,大部分或全部的PIR,PUE,和IPR BITSyt合并有一个以上的位字段在第二个(和第三个)位字段中有坏的(可能是遗留的)条目。我只是在编译器问题上得到了一天的答复。以前,5个月的PPS问题,解决了通过更新数据表与新的信息,然后告诉我,这是我的错,我没有跟上(新)数据表。
以上来自于百度翻译 以下为原文 Interesting. Same problem in pic18f56k42.h In fact, scanning through the .h, most or all of the PIR, PIE, and IPR bits_t unions with more than one bitfield have bad (presumably left over) entries in the 2nd (and 3rd) bitfields. I just got a one day reply on a compiler problem. Previously, 5 months on a PPS issue that was resolved by updating the datasheet with new information and then telling me it was my fault that I wasn't following the (new) datasheet. |
|
|
|
可以!所以是一张罚单(我发现越来越多的剩菜):这是一只野兽!而且看起来消耗的比K22还少(但我不能做真正的比较,因为我在新版本的固件上使用了SMT)
以上来自于百度翻译 以下为原文 Okay! So a ticket it is (and i'm finding more and more of this leftovers) Side note: this chip is a BEAST!! and appears to consume less than the k22 (but i can't do a real comparison because i used the SMT on the new version of this firmware) |
|
|
|
当心:XC8 V1.45中仍有残羹剩饭!打开另一张票
以上来自于百度翻译 以下为原文 Beware: There are still leftovers present in XC8 V1.45! Opening another ticket.. |
|
|
|
只有小组成员才能发言,加入小组>>
5223 浏览 9 评论
2024 浏览 8 评论
1949 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3198 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2252 浏览 5 评论
769浏览 1评论
655浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
583浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
667浏览 0评论
569浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-16 21:26 , Processed in 1.491438 second(s), Total 90, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号