我也遇到同样的问题,不知道怎么解决。我用的是mplab x IDE,kit3.5,PIC18F44K22,内部晶振,
配置字如下:
//#pragma config CONFIG1H = 0x38
__CONFIG(1, FOSC_INTIO67 & PLLCFG_ON & PRICLKEN_ON & FCMEN_OFF & IESO_OFF);
//#pragma config CONFIG2L = 0x1F
__CONFIG(2, PWRTEN_OFF & BOREN_SBORDIS & BORV_190);
//#pragma config CONFIG2H = 0x3D
__CONFIG(3, WDTEN_NOSLP & WDTPS_32768);
//#pragma config CONFIG3H = 0xBF
__CONFIG(4, CCP2MX_PORTC1 & PBADEN_ON & CCP3MX_PORTB5 & HFOFST_ON & T3CMX_PORTC0 & P2BMX_PORTD2 & MCLRE_EXTMCLR);
//#pragma config CONFIG4L = 0x85
__CONFIG(5, STVREN_ON & LVP_ON & XINST_OFF);
//#pragma config CONFIG5L = 0x3
__CONFIG(6, CP0_OFF & CP1_OFF);
//#pragma config CONFIG5H = 0xC0
__CONFIG(7, CPB_OFF & CPD_OFF);
//#pragma config CONFIG6L = 0x3
__CONFIG(8, WRT0_OFF & WRT1_OFF);
//#pragma config CONFIG6H = 0xE0
__CONFIG(9, WRTC_OFF & WRTB_OFF & WRTD_OFF);
//#pragma config CONFIG7L = 0x3
__CONFIG(10, EBTR0_OFF & EBTR1_OFF);
//#pragma config CONFIG7H = 0x40
__CONFIG(11, EBTRB_OFF);
下载时出错提示如下:
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.43.35
Firmware type..............PIC18F
Target voltage detected
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3fff
configuration memory
Device Erased...
Programming...
program memory
Address: 0 Expected Value: 9e Received Value: 0
Failed to program device |