Hallo Leute,
ich habe ein Problem im folgenden Code:
1 | #include <p18f2410.h>
|
2 |
|
3 | #pragma config OSC = INTIO67 // Interner Oszillator, Port function on RA6 u. RA7
|
4 | #pragma config WDT = OFF // Watchdog Timer Off
|
5 | #pragma config PWRT = ON
|
6 |
|
7 | #pragma code
|
8 |
|
9 | // **************************************************************************************
|
10 | // init: Initialisierung des PIC
|
11 | // **************************************************************************************
|
12 |
|
13 | void init(void)
|
14 | {
|
15 | // USART
|
16 | BRGH = 1; // 9600 Baud @ 4 Mhz
|
17 | SPBRG = 25;
|
18 | SYNC = 0;
|
19 |
|
20 | SPEN = 1; // Serielles Port Einschalten
|
21 | CREN = 1; // Continious Receive Einschalten
|
22 |
|
23 | TXEN = 1; // Transmit einschalten
|
24 |
|
25 | TRISB = 0x00;
|
26 | } //init
|
27 |
|
28 | // **************************************************************************************
|
29 | // rs232_send: Sendet ein Zeichen über die Serielle Schnittstelle
|
30 | // **************************************************************************************
|
31 |
|
32 | void rs232_send(char x)
|
33 | {
|
34 | while (!TXIF); // warten bis Senderegister frei ist
|
35 | TXREG = x;
|
36 | } //init
|
37 |
|
38 | // **************************************************************************************
|
39 | // main: Hauptprogramm
|
40 | // **************************************************************************************
|
41 |
|
42 | void main(void)
|
43 | {
|
44 | init();
|
45 | }
|
Das Problem ist jetzt das die ganzen Variablen nicht erkannt werden.
1 | main.c:33:Error [1105] symbol 'BRGH' has not been defined
|
2 | main.c:33:Error [1101] lvalue required
|
3 | main.c:35:Error [1105] symbol 'SYNC' has not been defined
|
4 | main.c:35:Error [1101] lvalue required
|
5 | main.c:37:Error [1105] symbol 'SPEN' has not been defined
|
6 | main.c:37:Error [1101] lvalue required
|
7 | main.c:38:Error [1105] symbol 'CREN' has not been defined
|
8 | main.c:38:Error [1101] lvalue required
|
9 | main.c:40:Error [1105] symbol 'TXEN' has not been defined
|
10 | main.c:40:Error [1101] lvalue required
|
11 | main.c:51:Error [1105] symbol 'TXIF' has not been defined
|
In dem Headerfile stehen keine Definitionen. Aber woher bekomme ich die?
LG
Andreas