質問編集履歴
1
追加情報を掲載しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,4 +10,75 @@
|
|
10
10
|
XC8コンパイラを使用して、同じように設定したいのですが、どのように記述したら良いのか分かりません。
|
11
11
|
XC8に関する情報が少なく、困っております。
|
12
12
|
|
13
|
-
どなたか教えていただけると助かります。
|
13
|
+
どなたか教えていただけると助かります。
|
14
|
+
|
15
|
+
##追加情報
|
16
|
+
http://blog.livedoor.jp/mplab/archives/1025058095.html
|
17
|
+
サイト(↑)を参考にしてコンパイルしています。
|
18
|
+
|
19
|
+
次のコードでコンパイルするとエラーがでてしまいます。
|
20
|
+
```html
|
21
|
+
#include <xc.h>
|
22
|
+
#include "usart.h"
|
23
|
+
|
24
|
+
// CONFIG1
|
25
|
+
#pragma config FOSC = INTOSC // Oscillator Selection (INTOSC oscillator: I/O function on CLKIN pin)
|
26
|
+
#pragma config WDTE = OFF // Watchdog Timer Enable (WDT disabled)
|
27
|
+
#pragma config PWRTE = ON // Power-up Timer Enable (PWRT enabled)
|
28
|
+
#pragma config MCLRE = ON // MCLR Pin Function Select (MCLR/VPP pin function is MCLR)
|
29
|
+
#pragma config CP = OFF // Flash Program Memory Code Protection (Program memory code protection is disabled)
|
30
|
+
#pragma config CPD = OFF // Data Memory Code Protection (Data memory code protection is disabled)
|
31
|
+
#pragma config BOREN = ON // Brown-out Reset Enable (Brown-out Reset enabled)
|
32
|
+
#pragma config CLKOUTEN = OFF // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
|
33
|
+
#pragma config IESO = OFF // Internal/External Switchover (Internal/External Switchover mode is disabled)
|
34
|
+
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is disabled)
|
35
|
+
|
36
|
+
// CONFIG2
|
37
|
+
#pragma config WRT = OFF // Flash Memory Self-Write Protection (Write protection off)
|
38
|
+
#pragma config PLLEN = OFF // PLL Enable (4x PLL enabled)
|
39
|
+
#pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will not cause a Reset)
|
40
|
+
#pragma config BORV = HI // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), high trip point selected.)
|
41
|
+
#pragma config LVP = OFF // Low-Voltage Programming Enable (High-voltage on MCLR/VPP must be used for programming)
|
42
|
+
|
43
|
+
|
44
|
+
#define _XTAL_FREQ 8000000 //Clock=8MHz
|
45
|
+
#define __delay(X) _delay((unsigned long)((X)))
|
46
|
+
#define __delay_us(X) _delay((unsigned long)((X)*(_XTAL_FREQ/4000000UL))) //usec delay
|
47
|
+
#define __delay_ms(X) _delay((unsigned long)((X)*(_XTAL_FREQ/4000UL))) //msec delay
|
48
|
+
|
49
|
+
|
50
|
+
void main(void) {
|
51
|
+
OSCCON=0x72; //PLL Disable/8MHz
|
52
|
+
ANSELA=0x04; //RA2 Analog Setting
|
53
|
+
ANSELC=0x00; //PORTC Digital Setting
|
54
|
+
TRISA=0x02; //RA2 Input
|
55
|
+
TRISC=0x28; //RC5, RC3 Input
|
56
|
+
LATC=0x00;
|
57
|
+
|
58
|
+
//RX, TX Port??
|
59
|
+
RXDTSEL = 0; // RC5??????
|
60
|
+
TXCKSEL = 0; // RC4??????
|
61
|
+
|
62
|
+
OpenUSART(USART_TX_INT_OFF&USART_RX_INT_OFF&USART_ASYNCH_MODE&USART_EIGHT_BIT&USART_CONT_RX&USART_BRGH_HIGH,51 );
|
63
|
+
|
64
|
+
while(1){
|
65
|
+
}
|
66
|
+
}
|
67
|
+
```
|
68
|
+
|
69
|
+
エラーの内容は次の通りです。
|
70
|
+
このエラーがなぜ起きてしまうのかわかりません。
|
71
|
+
|
72
|
+
```html
|
73
|
+
nbproject/Makefile-default.mk:137: recipe for target 'dist/default/production/Test1.X.production.hex' failed
|
74
|
+
make[2]: Leaving directory 'C:/Users/User01/MPLABXProjects/Test1.X'
|
75
|
+
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
|
76
|
+
make[1]: Leaving directory 'C:/Users/User01/MPLABXProjects/Test1.X'
|
77
|
+
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
|
78
|
+
make[2]: *** [dist/default/production/Test1.X.production.hex] Error 1
|
79
|
+
make[1]: *** [.build-conf] Error 2
|
80
|
+
make: *** [.build-impl] Error 2
|
81
|
+
|
82
|
+
BUILD FAILED (exit value 2, total time: 1s)
|
83
|
+
|
84
|
+
```
|