找不到 PIC10F200 的包含文件
Included file not found for PIC10F200
我正在尝试在 PIC10F200 上编译一些代码,我正在使用 MPLABX。
以下代码是main.asm
文件:
#include "p10f200.inc"
; CONFIG
__CONFIG _WDT_OFF & _CP_OFF & _MCLRE_OFF
ORG 0x0000
INIT ; We are initializing the microcontroller over the next three lines.
MOVLW ~(1 << GP1) ;these two lines set GP1 as an output
TRIS GPIO
BSF GPIO, GP1 ;this line is where we set GP1 output high to light the LED
LOOP
GOTO LOOP ; loop forever
END ; Needed to end the program.
错误说编译器找不到 p10f200.inc 文件。
"C:\Program Files\Microchip\xc8\v2.20\bin\xc8-cc.exe" -c -mcpu=10F200 -mdfp="C:/Program Files (x86)/Microchip/MPLABX/v5.40/packs/Microchip/PIC10-12Fxxx_DFP/1.3.46/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto -o build/default/production/main.o main.asm
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
main.asm:1:10: fatal error: 'p10f200.inc' file not found
#include "p10f200.inc"
^~~~~~~~~~~~~
1 error generated.
make[2]: *** [build/default/production/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
(908) exit status = 1
nbproject/Makefile-default.mk:113: recipe for target 'build/default/production/main.o' failed
make[2]: Leaving directory 'C:/Users/build/MPLABXProjects/Demo Final.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/build/MPLABXProjects/Demo Final.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 457ms)
很抱歉,如果这是一个基本错误,我对使用微控制器和装配非常陌生。
我知道这不是一个完整的答案,但我希望它能让您走上正轨。
Microchip 在最新版本的 XC8 中用新的汇编器替换了旧的汇编器。有很多变化,包括语法,很难在此答案中总结。您需要参考新汇编程序的手册。不幸的是,您可以在互联网上找到的大多数示例都不再有效。
例如,开头只需要 #include "xc.inc"
。不再支持绝对内存分配。配置也有不同的语法,比如 CONFIG WRT = OFF
。还有很多。。。还是要看说明书。
我遇到了同样的问题。
实际上我的 PC 上安装了 2 个不同版本的 MPLAB X。一个是 5.3 版,另一个是 5.45 版。 (是的,可以安装两个版本的软件。已经很久了,我什至不记得为什么。)
无论如何,我发现这个问题是在安装 PIC10F200(版本 5.45!)时出现的,mpasm 编译器没有出现在列表中。由于某些原因,5.3 版仍然有 mpasm 作为编译器的选择。
是的,令人困惑。不是一直都是吗。
我知道您正在尝试使用 Circuit Bread youtube 视频代码。我可以补充的是,在选择编译器时,它必须是 mpasm 编译器,因为您正在尝试用汇编语言编写。 “XC8 编译器不会完成这项工作,至少对于您在上面复制和粘贴的代码不会。
我正在尝试在 PIC10F200 上编译一些代码,我正在使用 MPLABX。
以下代码是main.asm
文件:
#include "p10f200.inc"
; CONFIG
__CONFIG _WDT_OFF & _CP_OFF & _MCLRE_OFF
ORG 0x0000
INIT ; We are initializing the microcontroller over the next three lines.
MOVLW ~(1 << GP1) ;these two lines set GP1 as an output
TRIS GPIO
BSF GPIO, GP1 ;this line is where we set GP1 output high to light the LED
LOOP
GOTO LOOP ; loop forever
END ; Needed to end the program.
错误说编译器找不到 p10f200.inc 文件。
"C:\Program Files\Microchip\xc8\v2.20\bin\xc8-cc.exe" -c -mcpu=10F200 -mdfp="C:/Program Files (x86)/Microchip/MPLABX/v5.40/packs/Microchip/PIC10-12Fxxx_DFP/1.3.46/xc8" -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto -o build/default/production/main.o main.asm
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
main.asm:1:10: fatal error: 'p10f200.inc' file not found
#include "p10f200.inc"
^~~~~~~~~~~~~
1 error generated.
make[2]: *** [build/default/production/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
(908) exit status = 1
nbproject/Makefile-default.mk:113: recipe for target 'build/default/production/main.o' failed
make[2]: Leaving directory 'C:/Users/build/MPLABXProjects/Demo Final.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/build/MPLABXProjects/Demo Final.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 457ms)
很抱歉,如果这是一个基本错误,我对使用微控制器和装配非常陌生。
我知道这不是一个完整的答案,但我希望它能让您走上正轨。
Microchip 在最新版本的 XC8 中用新的汇编器替换了旧的汇编器。有很多变化,包括语法,很难在此答案中总结。您需要参考新汇编程序的手册。不幸的是,您可以在互联网上找到的大多数示例都不再有效。
例如,开头只需要 #include "xc.inc"
。不再支持绝对内存分配。配置也有不同的语法,比如 CONFIG WRT = OFF
。还有很多。。。还是要看说明书。
我遇到了同样的问题。
实际上我的 PC 上安装了 2 个不同版本的 MPLAB X。一个是 5.3 版,另一个是 5.45 版。 (是的,可以安装两个版本的软件。已经很久了,我什至不记得为什么。)
无论如何,我发现这个问题是在安装 PIC10F200(版本 5.45!)时出现的,mpasm 编译器没有出现在列表中。由于某些原因,5.3 版仍然有 mpasm 作为编译器的选择。
是的,令人困惑。不是一直都是吗。
我知道您正在尝试使用 Circuit Bread youtube 视频代码。我可以补充的是,在选择编译器时,它必须是 mpasm 编译器,因为您正在尝试用汇编语言编写。 “XC8 编译器不会完成这项工作,至少对于您在上面复制和粘贴的代码不会。