What configuration bits should be used to debug PIC16F1947?
I'm stuck with configuration bits with PIC16F1947. I'm new to PIC programming so please answer in details.
I've the following setup:
- MPLAB 8.46
- MPLAB ICD 3
- HI-TECH C Compiler 9.81
A PIC16F1947 PIM (Plug in module) is plugged on PICDEM LCD 2 Demo Board. The board is powered by 3 V battery and J15 jumper was connected according to the manual (1-3 connected, 2-4 connected on J15). The project is compiled as debug build.
Following are the configuration bits used:
// Configuration word 1
__CONFIG( FOSC_INTOSC & // INTOSC oscillator: I/O function on CLKIN pin
WDTE_OFF & // WDT disabled
PWRTE_OFF & // PWRT disabled
MCLRE_OFF & // MCLR/VPP pin function is digital input
CP_OFF & // Program memory code protection is disabled
CPD_OFF & // Data memory code protection is disabled
BOREN_OFF & // Brown-out Reset disabled
CLKOUTEN_OFF & // CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin
IESO_OFF & // Internal/External Switchover mode is disabled
FCMEN_OFF // Fail-Safe Clock Monitor is disabled
);
// Configuration word 2
__CONFIG( WRT_OFF & // Write protection off
VCAPEN_OFF & // VCAP pin functionality is disabled
PLLEN_OFF & // 4x PLL disabled
STVREN_OFF & // Stack Overflow or Underflow will not cause a Reset
BORV_19 & // Brown-out Reset Voltage (VBOR) set to 1.9 V
LVP_OFF // High-voltage on MCLR/VPP must be used for programming
);
I can program (burn firmware) the micr开发者_开发知识库o via MPLAB. But when I try to Debugger > Run
it, the output windows shows following error:
ICD3Err0040: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.
I've checked the documentation about ICD3Err0040 but it seems to me that everything is alright.
What I'm doing wrong? Please help.
I've upgraded MPLAB IDE from 8.46
to 8.63
and debugging started to work!!!
May be they had issue with previous version.
IN CONFIG WORD 1 WRITE:- ICS_PGx2 SHOULD WORK
Debugger>Program
Invokes the msg box shown above. Click [ok] and the IDE will modify the configuration bits appropriately to permit debugging.
For those who cannot see the pic shown above. Single -Supply ICSP Enable bit must disabled Watchdog Timer Enable bit must be disabled
精彩评论