|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
P18F8720 配置字定義出錯(cuò),為什么? |
| 作者:kingpoo 欄目:單片機(jī) |
P18F8720 配置字定義出錯(cuò),為什么?(MPLAB 7.31 MCC18 V3.02) #pragma config OSC = ECIO, OSCS = OFF // CONFIG1H #pragma config PWRT = ON, BOR = ON, BORV = 42 // CONFIG2L (還有其它的,我沒有寫出來) Error [1225] configuration VALUE '0' not recognized for configuration setting 'OSCS' Error [1225] configuration VALUE '1' not recognized for configuration setting 'PWRT' ... 所有上面的定義都從"PIC18 CONFIGURATION SETTINGS ADDENDUM"得到,怎么會(huì)出錯(cuò)??(我用在p18f1320上都沒有問題的) * - 本貼最后修改時(shí)間:2006-3-3 11:20:59 修改者:kingpoo |
| 2樓: | >>參與討論 |
| 作者: 疏梅篩月影 于 2006/3/3 12:00:00 發(fā)布:
+ 他們的頭文件可能稍有不同,我遇到過這種情況.就是他們用的變量聲明問題.我就把用過的那個(gè)頭文件拷到現(xiàn)在用的就沒事了.我用的是MICROCHIP的C環(huán)境.我是這樣定義的,你可以參考一下P18F8720的頭文件自己設(shè)置參數(shù). #pragma romdata CONFIG _CONFIG_DECL(_CONFIG1H_DEFAULT & _OSC_HS_1H,\ _CONFIG2L_DEFAULT &_BOR_OFF_2L&_BORV_25_2L&_PWRT_ON_2L,\ _CONFIG2H_DEFAULT & _WDT_ON_2H,\ _CONFIG3H_DEFAULT,\ _CONFIG4L_DEFAULT &_STVR_OFF_4L& _LVP_OFF_4L,\ _CONFIG5L_DEFAULT,\ _CONFIG5H_DEFAULT,\ _CONFIG6L_DEFAULT&_WRT0_ON_6L&_WRT1_ON_6L&_WRT2_ON_6L&_WRT3_ON_6L,\ _CONFIG6H_DEFAULT,\ _CONFIG7L_DEFAULT,\ _CONFIG7H_DEFAULT); #pragma romdata * - 本貼最后修改時(shí)間:2006-3-3 12:04:35 修改者:疏梅篩月影 |
|
| 3樓: | >>參與討論 |
| 作者: kingpoo 于 2006/3/3 12:50:00 發(fā)布:
MPLAB 7.31 MCC18 V3.02版本已經(jīng)不支持_CONFIG_DECL了 MPLAB 7.31 MCC18 V3.02版本已經(jīng)不支持_CONFIG_DECL了 我原來用的就是_CONFIG_DECL,現(xiàn)在要一直到新的版本所有就用了 #pragma config 命令,在p18f1320中已經(jīng)是對(duì)的,但到p18f8720就會(huì)出錯(cuò) #pragma config OSC = ECIO, OSCS = OFF // CONFIG1H #pragma config PWRT = ON, BOR = ON, BORV = 42 // CONFIG2L #ifdef DEBUG #pragma config WDT = OFF, WDTPS = 128 // CONFIG2H #pragma config MODE = MC, WAIT = OFF // CONFIG3L #pragma config CCP2MUX = OFF // CONFIG3H #pragma config STVR = ON, LVP = OFF, DEBUG = ON // CONFIG4L #pragma config CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF,CP4 = OFF, CP5 = OFF, CP6 = OFF, CP7 = OFF, // CONFIG5L #pragma config CPB = OFF, CPD = OFF // CONFIG5H #pragma config WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF, WRT4 = OFF, WRT5 = OFF, WRT6 = OFF, WRT7 = OFF // CONFIG6L #pragma config WRTB = OFF, WRTD = OFF, WRTC = OFF // CONFIG6H #pragma config EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF, EBTR4 = OFF, EBTR5 = OFF, EBTR6 = OFF, EBTR7 = OFF // CONFIG7L #pragma config EBTRB = OFF // CONFIG7H 每一個(gè)#pragma config 都會(huì)有一個(gè)錯(cuò)誤,但不知道為什么? 下面是錯(cuò)誤信息: D:\xp_system_firmware\main_con.c:101:Error [1225] configuration VALUE '0' not recognized for configuration setting 'OSCS' D:\xp_system_firmware\main_con.c:102:Error [1225] configuration VALUE '1' not recognized for configuration setting 'PWRT' D:\xp_system_firmware\main_con.c:105:Error [1225] configuration VALUE '0' not recognized for configuration setting 'WDT' D:\xp_system_firmware\main_con.c:106:Error [1225] configuration VALUE '0' not recognized for configuration setting 'WAIT' D:\xp_system_firmware\main_con.c:107:Error [1225] configuration VALUE '0' not recognized for configuration setting 'CCP2MUX' D:\xp_system_firmware\main_con.c:108:Error [1225] configuration VALUE '1' not recognized for configuration setting 'STVR' D:\xp_system_firmware\main_con.c:110:Error [1225] configuration VALUE '0' not recognized for configuration setting 'CP0' D:\xp_system_firmware\main_con.c:111:Error [1225] configuration VALUE '0' not recognized for configuration setting 'CPB' D:\xp_system_firmware\main_con.c:113:Error [1225] configuration VALUE '0' not recognized for configuration setting 'WRT0' D:\xp_system_firmware\main_con.c:114:Error [1225] configuration VALUE '0' not recognized for configuration setting 'WRTB' D:\xp_system_firmware\main_con.c:115:Error [1225] configuration VALUE '0' not recognized for configuration setting 'EBTR0' D:\xp_system_firmware\main_con.c:116:Error [1225] configuration VALUE '0' not recognized for configuration setting 'EBTRB' |
|
| 4樓: | >>參與討論 |
| 作者: martin 于 2006/3/3 13:01:00 發(fā)布:
把你的#pragma config都拷貝到我的8720項(xiàng)目里編譯,都能通過 看看是不是項(xiàng)目設(shè)置里的路徑設(shè)置問題 |
|
| 5樓: | >>參與討論 |
| 作者: kingpoo 于 2006/3/3 15:44:00 發(fā)布:
知道哪里問題了,原來我的工程中已經(jīng)有ON與OFF的宏定義了 知道哪里問題了,原來我的工程中已經(jīng)有ON與OFF的宏定義了!!和系統(tǒng)中的宏定義沖突了 MICROCHIP系統(tǒng)中的宏定義是不是改成__ON或者_(dá)ON,這樣更好啊?否則太容易和用戶的定義重復(fù)了 * - 本貼最后修改時(shí)間:2006-3-3 15:56:07 修改者:kingpoo |
|
|
|
| 免費(fèi)注冊(cè)為維庫電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |