Stavros84
Junior Member level 2
Hello
I try to program pic18F452 with ICD3. I use a very simple code because its my first time. Here is the code that i use. Its from the examples of C18.
At first i use ICD3 as a Debugger. When i press program everything its OK. But when i press the button RUN i have this message:
MPLAB ICD 3 detected
Connecting to MPLAB ICD 3...
Running self test...
Self test completed
Firmware Suite Version...... 01.26.33
Firmware type......................PIC18F
MPLAB ICD 3 Connected.
Target Detected
Device ID Revision = 00000007
Programming...
Programming/Verify complete
Running...
ICD3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
I check my configuration bits. I read in the section Debug Failure Actions (Troubleshooting>Error Messages> Debug Failure Actions) in the MPLAB ICD3 help. But i don't know what i am doing wrong.
Does someone know why i can't program my pic?
I try to program pic18F452 with ICD3. I use a very simple code because its my first time. Here is the code that i use. Its from the examples of C18.
Code:
#include "p18f452.h"
// HS-PLL Enabled, Internal External Osc. Switch Over OFF Disabled
#pragma config OSC = HS, OSCS = OFF
// Power Up Timer: OFF Disabled
#pragma config PWRT = ON
// Brown Out Reset: OFF, Brown Out Voltage: OFF Disabled
#pragma config BOR = OFF, BORV = 27
// Watchdog Timer: OFF Disabled, Watchdog Postscaler: 1:128
#pragma config WDT = OFF, WDTPS = 128
// CCP2 Mux: OFF Disabled (RB3)/ON Enable (RC1)
#pragma config CCP2MUX = ON
// Stack Overflow Reset: OFF Disabled
#pragma config STVR = OFF
// Low Voltage ICSP:OFF Disabled
#pragma config LVP = OFF
// Background Debugger Enable: OFF Disabled
#pragma config DEBUG = OFF
// Code Protection Block 0-3: OFF Disabled
#pragma config CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF
// Boot Block Code Protection: OFF Disabled
#pragma config CPB = OFF
// Data EEPROM Code Protection: OFF Disabled
#pragma config CPD = OFF
// Write Protection Block 0-3: OFF Disabled
#pragma config WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF
// Boot Block Write Protection: OFF Disabled
#pragma config WRTB = OFF
// Configuration Register Write Protection: OFF Disabled
#pragma config WRTC = OFF
// Data EEPROM Write Protection: OFF Disabled
#pragma config WRTD = OFF
// Table Read Protection Block 0-3: OFF Disabled
#pragma config EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF
// Boot Block Table Read Protection: OFF Disabled
#pragma config EBTRB = OFF
void main (void)
{
/* Make all bits on the Port D (LEDs) output bits.
* If bit is cleared, then the bit is an output bit.
*/
TRISD = 0;
/* Reset the LEDs */
PORTD = 0;
/* Light the LEDs */
PORTD = 0x5A;
while (1)
;
}
At first i use ICD3 as a Debugger. When i press program everything its OK. But when i press the button RUN i have this message:
MPLAB ICD 3 detected
Connecting to MPLAB ICD 3...
Running self test...
Self test completed
Firmware Suite Version...... 01.26.33
Firmware type......................PIC18F
MPLAB ICD 3 Connected.
Target Detected
Device ID Revision = 00000007
Programming...
Programming/Verify complete
Running...
ICD3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
I check my configuration bits. I read in the section Debug Failure Actions (Troubleshooting>Error Messages> Debug Failure Actions) in the MPLAB ICD3 help. But i don't know what i am doing wrong.
Does someone know why i can't program my pic?