我现在调试的是PIC24F32KA302这个芯片,以前没做过PIC的程序,前段时间板子没回来时只是看了,
今天一连上板子怎么也进不了调试状态,总是说我的配置字没设置好,怎么回事呢?编程功能都好用。
The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
1、板子上焊了两个晶振,一个16MHZ,一个32.768K,并且都配了两个电容。
2、PICKIT3检测什么的都正常。
3、大部分情况是一点编译就出现上面的错误提示,有时候点编译不出现,点运行又出现了,程序根本走不到断点,如果仿真运行就是正常的。
我的配置字是这样的:
_FBS
(
BWRP_OFF & // Boot Segment Write Protect (Disabled)
BSS_OFF // Boot segment Protect (No boot flash segment)
)
_FGS
(
GWRP_OFF & // General Segment Flash Write Protect (General segment may be written)
GSS0_OFF // General Segment Code Protect (No Protection)
)
_FOSCSEL
(
FNOSC_PRI & // Fast RC Oscillator (FRC):8MHz
SOSCSEL0_OFF & // SOSC Source Type (Digital Mode for use with external clock on SCLKI)
FNOSC_LPFRC & // LPRC Power and Accuracy (High Power/High Accuracy)
// IESO_ON // Internal External Switch Over bit (Internal External Switchover mode enabled (Two-speed Start-up enabled))
IESO_OFF
)
_FOSC
(
POSCMOD_NONE & // Primary Oscillator Mode (Primary oscillator disabled)
OSCIOFNC_OFF & // CLKO Enable Configuration bit (CLKO output disabled)
POSCFREQ_MS & // Primary Oscillator Frequency Range Configuration bits (Primary oscillator/external clock frequency between 100kHz to 8MHz)
SOSCSEL1_SOSCHP &// SOSC Power Selection Configuration bits (Secondary Oscillator configured for high-power operation)
FCKSM_CSECME // Clock Switching and Monitor Selection (Clock Switching and Fail-safe Clock Monitor Enabled)
)
_FWDT
(
WDTPS_PS32768 & // Watchdog Timer Postscale Select bits (1:32768)
FWPSA_PR128 & // WDT Prescaler bit (WDT prescaler ratio of 1:128)
FWDTEN_OFF & // Watchdog Timer Enable bits (WDT disabled in hardware; SWDTEN bit disabled)
WINDIS_OFF // Windowed Watchdog Timer Disable bit (Standard WDT selected (windowed WDT disabled))
)
// Warning:
// Always enable MCLRE_ON config bit setting so that the MCLR pin function will
// work for low-voltage In-Circuit Serial Programming (ICSP). The Microstick
// programming circuitry only supports low-voltage ICSP. If you disable MCLR pin
// functionality, a high-voltage ICSP tool will be required to re-program the
// part in the future.
_FPOR
(
///// BOREN_BOR3 & // Brown-out Reset Enable bits (Enabled in hardware; SBOREN bit disabled)
//// PWRTEN_ON & // Power-up Timer Enable (PWRT enabled)
I2C1SEL_PRI & // Alternate I2C1 Pin Mapping bit (Default SCL1/SDA1 Pins for I2C1)
BORV_V20 & // Brown-out Reset Voltage bits (Brown-out Reset at 1.8V)
MCLRE_ON & // MCLR Pin Enable bit (RA5 input disabled; MCLR enabled)
BOREN_BOR0 &
RETVRDIS_DISABLED &
PWRTEN_OFF
)
_FICD
(
ICS_PGx1 // ICD Pin Placement Select (EMUC/EMUD share PGC3/PGD3)
)
/**********************配置位结束*************************************/
|