Re: 求助 AN967文档的源代码 MPLab编译不能
|
||||
---|---|---|---|---|
新會員
|
谢谢楼上 ,看了一下 链接内容好东西 !
偶是新手 好好学学 谢谢!
發表於: 2008/7/4 19:04
|
|||
|
Re: 求助 AN967文档的源代码 MPLab编译不能
|
||||
---|---|---|---|---|
版主
|
看了一下 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
|
|||
|
求助 AN967文档的源代码 MPLab编译不能
|
||||
---|---|---|---|---|
新會員
|
是在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
|
|||
|