eanema
Member level 2
I am have having problems entering into debug mode. I am using a test application (shown below) to simply turn on a few LEDs. I am using the linker script '18F4550i.lkr'
The 18F4550 is on a bread board with a minimal configuration.
-It is powered from the ICD2 unit
-It has a 4 MHz crystal configured (i know the osc is good because it works fine when its program with stand alone code)
-It has a 10k pull up resistor on MCLR
-it has MCLR, PGM, and PGC connected to the IDC2 header
The problem is this:
When I configure the device to use the internal oscillator (#pragma config FOSC = INTOSC_HS) every thing works fine, but when I change the configuration to the high speed oscillator (#pragma config FOSC = HSPLL_HS) I get the error:
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming EEPROM Memory
...Programming Program Memory (0x0 - 0x13F)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
...Programming RSBUG
Verifying...
...Program Memory
...EEPROM
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.
This doesn't make a whole lot of sense to me, so any advise would be helpful. I've spent the past 8 hours trying to figure this out.
#pragma config PLLDIV = 1 // 4MHz crystal
#pragma config CPUDIV = OSC1_PLL2
#pragma config USBDIV = 2 // Clock source from 96MHz PLL/2
#pragma config FOSC = INTOSC_HS // HSPLL_HS
#pragma config FCMEN = OFF
#pragma config IESO = OFF
#pragma config PWRT = OFF
#pragma config BOR = ON
#pragma config BORV = 3
#pragma config VREGEN = OFF //USB Voltage Regulator
#pragma config WDT = OFF
#pragma config WDTPS = 32768
#pragma config MCLRE = ON
#pragma config LPT1OSC = OFF
#pragma config PBADEN = OFF
#pragma config CCP2MX = OFF
#pragma config STVREN = ON
#pragma config LVP = OFF
#pragma config ICPRT = OFF // Dedicated In-Circuit Debug/Programming
#pragma config XINST = OFF // Extended Instruction Set
#pragma config CP0 = OFF
#pragma config CP1 = OFF
#pragma config CP2 = OFF
#pragma config CP3 = OFF
#pragma config CPB = OFF
#pragma config CPD = OFF
#pragma config WRT0 = OFF
#pragma config WRT1 = OFF
#pragma config WRT2 = OFF
#pragma config WRT3 = OFF
#pragma config WRTB = OFF // Boot Block Write Protection
#pragma config WRTC = OFF
#pragma config WRTD = OFF
#pragma config EBTR0 = OFF
#pragma config EBTR1 = OFF
#pragma config EBTR2 = OFF
#pragma config EBTR3 = OFF
#pragma config EBTRB = OFF
#include <p18cxxx.h>
void main (void) {
TRISD=0x00; //turn on some LEDs
PORTD=0xff;
Nop();
Nop();
while (1);
}
The 18F4550 is on a bread board with a minimal configuration.
-It is powered from the ICD2 unit
-It has a 4 MHz crystal configured (i know the osc is good because it works fine when its program with stand alone code)
-It has a 10k pull up resistor on MCLR
-it has MCLR, PGM, and PGC connected to the IDC2 header
The problem is this:
When I configure the device to use the internal oscillator (#pragma config FOSC = INTOSC_HS) every thing works fine, but when I change the configuration to the high speed oscillator (#pragma config FOSC = HSPLL_HS) I get the error:
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming EEPROM Memory
...Programming Program Memory (0x0 - 0x13F)
...Loading DebugExecutive
...Programming DebugExecutive
...Programming Debug Vector
...Programming RSBUG
Verifying...
...Program Memory
...EEPROM
...Debug Executive
...Debug Vector
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
Connecting to debug executive
ICD0083: Debug: Unable to enter debug mode. Please double click this message for more information.
This doesn't make a whole lot of sense to me, so any advise would be helpful. I've spent the past 8 hours trying to figure this out.
#pragma config PLLDIV = 1 // 4MHz crystal
#pragma config CPUDIV = OSC1_PLL2
#pragma config USBDIV = 2 // Clock source from 96MHz PLL/2
#pragma config FOSC = INTOSC_HS // HSPLL_HS
#pragma config FCMEN = OFF
#pragma config IESO = OFF
#pragma config PWRT = OFF
#pragma config BOR = ON
#pragma config BORV = 3
#pragma config VREGEN = OFF //USB Voltage Regulator
#pragma config WDT = OFF
#pragma config WDTPS = 32768
#pragma config MCLRE = ON
#pragma config LPT1OSC = OFF
#pragma config PBADEN = OFF
#pragma config CCP2MX = OFF
#pragma config STVREN = ON
#pragma config LVP = OFF
#pragma config ICPRT = OFF // Dedicated In-Circuit Debug/Programming
#pragma config XINST = OFF // Extended Instruction Set
#pragma config CP0 = OFF
#pragma config CP1 = OFF
#pragma config CP2 = OFF
#pragma config CP3 = OFF
#pragma config CPB = OFF
#pragma config CPD = OFF
#pragma config WRT0 = OFF
#pragma config WRT1 = OFF
#pragma config WRT2 = OFF
#pragma config WRT3 = OFF
#pragma config WRTB = OFF // Boot Block Write Protection
#pragma config WRTC = OFF
#pragma config WRTD = OFF
#pragma config EBTR0 = OFF
#pragma config EBTR1 = OFF
#pragma config EBTR2 = OFF
#pragma config EBTR3 = OFF
#pragma config EBTRB = OFF
#include <p18cxxx.h>
void main (void) {
TRISD=0x00; //turn on some LEDs
PORTD=0xff;
Nop();
Nop();
while (1);
}