Hallo Leute,
ich bin Anfänger bei der Microcontroller Programmierung. Ich habe schon
ein wenig mit einem Baseline Chip programmiert (PIC12F508). Jetzt wage
ich mich an die Midrange Klasse ran. Um eine LED zum leuchten zu bringen
habe ich ein C-Programm erstellt.
1 | #pragma config FOSC = ECM // Oscillator Selection bits (internal RC oscillator)
|
2 | #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
|
3 | #pragma config CP = OFF // Code Protection bit (Code protection off)
|
4 | #pragma config MCLRE = ON // GP3/MCLR Pin Function Select bit (GP3/MCLR pin function is MCLR)
|
5 | #pragma config BOREN = OFF // Brown-out off
|
6 | #pragma config PWRTE = OFF // Power-up Timer off
|
7 | #include <xc.h>
|
8 |
|
9 | /***** CONFIGURATION *****/
|
10 | // ext reset, no code protect, no brownout detect, no watchdog,
|
11 | // power-up timer enabled, int RC clock
|
12 | //__CONFIG(MCLRE_ON & CP_OFF & CPD_OFF & BOREN_OFF & WDTE_OFF &
|
13 | // PWRTE_OFF & FOSC_INTRCIO);
|
14 |
|
15 |
|
16 | /***** MAIN PROGRAM *****/
|
17 | void main()
|
18 | {
|
19 | //*** Initialisation
|
20 |
|
21 | // configure port
|
22 | TRISIO = 0; // configure GP1 (only) as an output
|
23 | GPIObits.GP1 = 1; // set GP1 high
|
24 |
|
25 |
|
26 | //*** Main loop
|
27 | for (;;)
|
28 | { // loop forever
|
29 | ;
|
30 | }
|
31 | }
|
Dabei bekomme ich folgende Fehlermeldung und ich weiß nicht warum.
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/Max/MIDRANGE.X'
make -f nbproject/Makefile-default.mk
dist/default/production/MIDRANGE.X.production.hex
make[2]: Entering directory 'C:/Users/Max/MIDRANGE.X'
"C:\Program Files (x86)\Microchip\xc8\v1.45\bin\xc8.exe" --pass1
--chip=16LF1509 -Q -G --double=24 --float=24
--opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore
--mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=default
--summary=default,-psect,-class,+mem,-hex,-file
--output=default,-inhx032
--runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-dow
nload,-stackcall,+clib --output=-mcof,+elf:multilocs
--stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s"
"--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory:
(%n) %s" -obuild/default/production/Main.p1 Main.c
Main.c:39: error: (0) Unknown macro (CPD_OFF) used in __CONFIG()
Main.c:39: error: (0) Unknown macro (FOSC_INTRCIO) used in __CONFIG()
Main.c:49: error: (192) undefined identifier "TRISIO"
Main.c:50: error: (192) undefined identifier "GPIObits"
Main.c:50: error: (196) struct/union required
(908) exit status = 1
nbproject/Makefile-default.mk:106: recipe for target
'build/default/production/Main.p1' failed
make[2]: Leaving directory 'C:/Users/Max/MIDRANGE.X'
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/Max/MIDRANGE.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/Main.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 556ms)
Ich benutzte die MLAB X IDE v. 4.05 und den XC8 v. 1.45 Compiler.
Kann mir jemand einen Hinweis geben, wie ich die Fehler beheben kann.
Viele Grüße