1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好…直到最近,我一直在用绝对代码来编码我的PIC项目,但是我的项目已经变得越来越大,所以我已经移动到写可重新定位的代码。这是我做的第二个可重新定位的代码项目。BUTthis是我第一次遇到这个问题。我的第一个项目是用P。16F87A,似乎链接器文件16F877 AG.LKR是正确设置的,因为在那个项目中没有问题&我可以让链接器在MPASMX目录中使用默认拷贝。现在我正在使用P16F870做一个项目…16F870G.LKR产生了链路时间误差(1)’,UDATA’不能适应截面。这只是通过尝试正确的LKR文件(见第一附件16F870G.LKR)…只是保护RAM的不同部分没有帮助,因为我发现我的参数映射到特殊寄存器(如PCL)…我只看到这个通过运行程序通过模拟器,我发现程序被困在一个循环…我将参数设置为0xD,但是这个参数映射到PCL,它跳转到地址0xD。幸运的是,这是对例行程序的呼唤,它刚刚从它跳起来,我就能够找到它。最后,我从P16F87A复制LKR并将其更改为适合P16F870(见第二附件SSM。LKR)。程序编译…NOerrors…没有未经授权的跳跃…太棒了!!!!但是没有…我想在PIC板上运行PIC程序,使用我的PICtiT3来监视程序开发。现在我又回到了下面的链接器错误……错误部分'dBGD1 '不能适合绝对部分。段落“dgdd1”启动=0x000 000 b5,长度=0x000 000 0Brror:1连接了调试映射文件(SEESS.x.Debug 1.txt)。当然,如果我进入项目属性并将硬件工具更改为模拟器,程序编译并获得调试后的w。map(SEESS。x.Debug 2. txt)可以有人告诉M为什么会发生这样的事情?如何修复??MPLABIDID/V3.51 MPLink 5.08,Link设备数据库1.34版
SSM.LKR(1.57 KB)下载32次S.x.Debug 1.txt(2.16 KB)-下载30次S.x.Debug 2.txt(6.45 KB)-下载26次 以上来自于百度翻译 以下为原文 Hello All ... I have until recently been coding for my PIC projects in absolute code but my projects have been getting much larger so I have moved to writing relocatable code. This is the second relocatable code project that I have done BUT this is the first time I have had this problem. My first project was with a p16F877a, it seems that the linker file 16f877a_g.lkr was setup correctly because in that project there was no problem & I could let the linker use the default copy in the mpasmx directory. Now I am doing a project using p16F870 ... 16f870_g.lkr produced a link time error (1) '.udata' can not fit the section ... This was only by trying the correct the lkr file (see first attachment 16f870_g.lkr) ... just unprotecting different sections of ram didn't help as I found that my parameters were being mapped over special registers (like PCL) ... I only saw this by running the program through the simulator where I found that the program was stuck in a loop ... I was setting my parameter to 0xD BUT this parameter was mapped to PCL which jump to the address 0xD. luckly, this was the call to the routine which it had just jumped from so it looped and I was able to find it. In the end I copied the lkr from the p16F877a and change it to fit p16F870 (see second attachment ssm.lkr). The program compiles ... NO errors ... NO unauthorised jumps ... all great!!! but NO ... I want to run the program in a PIC on a breadboard & use my pickit3 to monitor the program development. I NOW am back again getting the following linker error ... Error - section 'dbgD1' can not fit the absolute section. Section 'dbgD1' start=0x000000b5, length=0x0000000b Errors : 1 The debug.map file is attached (see SS.X.debug1.txt) Of course if I go into the project properties & change the hardware tools to simulator, the program compiles & I get thew following debug.map (see SS.X.debug2.txt) Can someone tell me why this is happening & how to fix it?? mplab_ide/v3.51 MPLINK 5.08, LINKER Device Database Version 1.34 Attachment(s) 16f870_g.lkr (1.58 KB) - downloaded 29 times ssm.lkr (1.57 KB) - downloaded 32 times SS.X.debug1.txt (2.16 KB) - downloaded 30 times SS.X.debug2.txt (6.45 KB) - downloaded 26 times |
|
相关推荐
6个回答
|
|
16F870G.LKR链接器文件看起来不错,而您修改后的SSM.LKR对于16F870来说是不正确的。你最好发布你的ASM代码。
以上来自于百度翻译 以下为原文 The 16f870_g.lkr linker file looks okay, and your modified ssm.lkr is incorrect for the 16F870. You better post your asm code. |
|
|
|
你好1和0…当我开始这个项目时,我使用的是16F870G.LKR&AM.我已经得到链接器错误“错误-部分”SSP1不能适应该节。“SSP1”长度=0x000×00 03”,我用“SSM。LKR”修正了它。当我编译代码时,没有将调试工具设置为PICTIT3(设置为使用模拟器),程序编译时没有问题,模拟代码的工作,正如我预期的那样进行,我用UDATA设置的参数寄存器被分配给RAM部分作为S可用。在这张照片的数据表中…找到附上的代码…但是如果SSM LKR有问题,很好地知道SSM LKR为什么不正确?因为基本上“SSM。LKR”与16M8ABA(16F77 AG.LKR)MLABX的LKR文件相同,但修改以反映这2个PIC(即页数、EDATA内存)之间的差异。
以上来自于百度翻译 以下为原文 Hello 1and0 ... when I started the project I was using 16f870_g.lkr & I has getting the linker error " Error - section 'SSP1' can not fit the section. Section 'SSP1' length=0x00000003" & I corrected it with 'ssm.lkr'. When I compiled the code WITHOUT the debug tool set to pickit3 (set to use simulator) the program compiles without problem, simulating the code works as intended as well going where I expected to go & my parameter registers which I set with UDATA were allocated to the ram section available as stated in the data sheet for this PIC ... do find attached the code ... but if there is problem with ssm.lkr, it would be nice to know exactly why ssm.lkr is incorrect?? Because basically 'ssm.lkr' is the same as LKR file that you get with MPLABX for the 16F877a (16f77a_g.lkr) BUT modified to reflect the differences between these 2 PIC i.e. number of pages, amount eedata memory. |
|
|
|
正如我前面说过的,默认的16F870G.LKR链接器文件是正确的。您的代码不正确——您试图将变量分配给不存在的数据存储器。根据16F870数据表,它只共享数据存储器,因此必须用UDATAYSHR指令保留所有的变量,而不是UDATA指令。也就是说,不需要使用Page或LCAL,因为您的PIC设备只有一页程序内存,以及您的LooppWMutul子程序。可以更有效地写为
以上来自于百度翻译 以下为原文 Like I said earlier, the default 16f870_g.lkr linker file is correct. It is your code that is incorrect -- you are trying to allocate variables to non-existing data memory. According to the 16F870 datasheet it has ONLY shared data memory, so you must reserve all your variables with the UDATA_SHR directive, not the UDATA directive. That said, there is no need to use PAGESEL or LCALL as your PIC device has only one page of program memory, and your LOADPWMDUTYL subroutine LOADPWMDUTYL GLOBAL LOADPWMDUTYL BANKSEL SSPTMP MOVWF SSPTMP ; If all is as it should be, the lowest 2bits ; should contain the in SSPTMP BANKSEL CCP1CON BCF CCP1CON, 4 BANKSEL SSPTMP PAGESEL LPWMDC1 BTFSS SSPTMP, 6 GOTO LPWMDC1 BANKSEL CCP1CON BSF CCP1CON, 4 LPWMDC1 BANKSEL CCP1CON BCF CCP1CON, 5 BANKSEL SSPTMP BTFSS SSPTMP, 7 RETURN BANKSEL CCP1CON BSF CCP1CON, 5 RETURN can be more efficiently written as LOADPWMDUTYL GLOBAL LOADPWMDUTYL BANKSEL SSPTMP MOVWF SSPTMP ; If all is as it should be, the lowest 2bits ; should contain the in SSPTMP RRF SSPTMP RRF SSPTMP,W BANKSEL CCP1CON XORWF CCP1CON,W ANDLW 0x30 XORWF CCP1CON RETURN |
|
|
|
你好1安多…谢谢你的回复…问题和解决方法如此明显,我本应该看到的。已经测试了UDATA更改为UDATAYSHR和它的代码。我同意LaLead和PaGeSe不需要16F870…我刚从16F87A项目中拔出了代码,在RAM中,RAM大多没有初始化RAM和只有一些共享的部分。总之…谢谢你的帮助:
以上来自于百度翻译 以下为原文 Hello 1andO ... Thank you for replying ... the problem & solution was so obvious I should have seen it. Have tested the code with the udata changed to udata_shr & it works. I agree the lcall & pagesel are not needed with the 16f870 ... I just pulled that code from a 16f877a project where the ram had mostly uninitialised ram & only some shared sections. Anyway ... thank you for your help :) |
|
|
|
不客气。所以我想你现在明白为什么你的SSM LKR对于16F870是不正确的了吗?
以上来自于百度翻译 以下为原文 You're welcome. So I take it you now understand why your ssm.lkr is incorrect for the 16F870? |
|
|
|
是真的…我忽略了所有的GPR事实上是共享的,因为有些银行没有在所有银行共享。当然,我也在寻找一些邪恶的东西…当然不是在平视中隐藏的东西。这让我想知道如何才能使一个功能完备的库文件(o)能够在PIC家族(或至少PIC的基线家族)的整个范围内使用。因为这已经为我突出了这个问题,所以至少更新我(o)文件来弥补这个问题是很好的。这可能是本周末要考虑的问题:
以上来自于百度翻译 以下为原文 True ... I was overlooking the fact that all the GPR were actually shared because some were not shared across all banks ... of course I was also looking for something sinister ... not something hidden in plain view. Of course ... This makes me wonder how one can make a fully functioning library file (.o) which could be used over the full range of PIC family (or at least the baseline families of PIC) which accounts for this problem. As this has highlighted this problem for me, it would at least be nice to update the (.o) files I do have compensate for this problem ... which is probably going to be this weekend problem to consider :) |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
774浏览 1评论
664浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
592浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
674浏览 0评论
574浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 17:34 , Processed in 2.654504 second(s), Total 86, Slave 70 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号