• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 求助 AN967文档的源代码 MPLab编译不能
#3
新會員
新會員


查看用戶資訊
谢谢楼上 ,看了一下 链接内容好东西 !
偶是新手 好好学学 谢谢!

發表於: 2008/7/4 19:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 求助 AN967文档的源代码 MPLab编译不能
#2
版主
版主


查看用戶資訊
看了一下 AN967 Bidirectional VF Control of Single and 3-Phase Induction Motors Using the PIC16F72
這個程式是採用 Relocateable 語法寫的,所以在 Project 裡還要告訴 Linker 要使用 16f72.lkr 檔案一起來彙編。單獨去會編這個檔案是會有錯誤的。
可以參考一下 MPASM 的教材:
http://www.microchip.com.tw/modules/w ... nglefile.php?cid=4&lid=33

發表於: 2008/7/4 17:33
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


求助 AN967文档的源代码 MPLab编译不能
#1
新會員
新會員


查看用戶資訊
是在Microchip网站上下载的AN967(用PIC16F72驱动单相交流电机)的原代码
压缩包里面包括一个asm 和一个inc文件
我用MPLab 8.1 (网站上下的次新稳定版) 编译
报错,内容如下:
----------------------------------------------------------------------
Release build of project `E:\pic test\1\1.mcp' started.
Fri Jul 04 11:37:28 2008
----------------------------------------------------------------------
Make: The target "E:\pic test\1\MC_16F72.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F72 "MC_16F72.asm" /l"MC_16F72.lst" /e"MC_16F72.err" /x"MC_16F72.xrf" /aINHX8M
Error[149] E:\PIC TEST\1\MC_16F72.ASM 76 : Directive only allowed when generating an object file
Error[149] E:\PIC TEST\1\MC_16F72.ASM 79 : Directive only allowed when generating an object file
Error[149] E:\PIC TEST\1\MC_16F72.ASM 83 : Directive only allowed when generating an object file
Message[302] E:\PIC TEST\1\MC_16F72.ASM 89 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 91 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 118 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 120 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 135 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 141 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 144 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 733 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 734 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 750 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[149] E:\PIC TEST\1\MC_16F72.ASM 900 : Directive only allowed when generating an object file
Halting build on first failure as requested.
----------------------------------------------------------------------
Release build of project `E:\pic test\1\1.mcp' failed.
Fri Jul 04 11:37:30 2008
----------------------------------------------------------------------
BUILD FAILED

然后我根据Error 149 就改成输出build library target (invoke MPLIB)
这次编译成功了 但是按照help 此种只能生成.o文件 也确实生成了一个.o文件
但是下一步该怎样做呢? 怎么才能生成 Hex文件呢 晕了

----------------------------------------------------------------------
Debug build of project `E:\pic test\1\1.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Fri Jul 04 11:36:15 2008
----------------------------------------------------------------------
Make: The target "E:\pic test\1\MC_16F72.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16cxx "MC_16F72.asm" /l"MC_16F72.lst" /e"MC_16F72.err" /o"MC_16F72.o" /d__DEBUG=1 /x"MC_16F72.xrf" /aINHX8M
Message[301] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P16F72.INC 35 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Message[302] E:\PIC TEST\1\MC_16F72.ASM 89 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 91 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 118 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 120 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 135 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 141 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 144 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 733 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 734 : Register in operand not in bank 0. Ensure that bank bits are correct.
Message[302] E:\PIC TEST\1\MC_16F72.ASM 750 : Register in operand not in bank 0. Ensure that bank bits are correct.
Make: The target "E:\pic test\1\1.cof" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplib.exe" /c "1.lib" "MC_16F72.o"
MPLIB 4.20, Librarian
Copyright (c) 2008 Microchip Technology Inc.

Errors : 0

----------------------------------------------------------------------
Debug build of project `E:\pic test\1\1.mcp' succeeded.
Preprocessor symbol `__DEBUG' is defined.
Fri Jul 04 11:36:19 2008
----------------------------------------------------------------------
BUILD SUCCEEDED


尝试编译那些普通的example 可以编译通过的 (说明编译器和我可能没有问题)
单片机型号也没有选错啊 环境变量没改 尝试指定 如lib lkr的 也没有用

这个程序 纯粹的汇编 根据作者说明 有一段db(Sine表) 是要在开机时候从rom加载到ram中的
我怀疑是不是这段导致的编译不能啊

AN967的原链接
http://www.microchip.com/stellent/i...ppnote=en022135

老大们帮我看看吧 或许对你们是个很简单的小问题 对我这个新手 我看能卡死我啊 呜呜

發表於: 2008/7/4 12:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------