Pic18f67k22 + pll + intosc + debug = problem

Status
Not open for further replies.

elt42at

Newbie level 6
Joined
Mar 26, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,387
Hello!

There is a problem with my microchip pic18 circuit.

I am using internal oscillator and enabled PLL (4x multiplier)


Code C - [expand]
1
2
#pragma config FOSC = INTIO2  // Oscillator: Internal RC oscillator 
#pragma config PLLCFG = ON      // PLL x4 Enable bit: Enabled



In my initialization of board i set primary clock source and PLL than wait for a while.


Code C - [expand]
1
2
3
4
OSCCON = 0x70; 
OSCCON2 = 0x00; 
OSCTUNE = 0xDF; 
DelayMs(250);



Now, the problem is debugging.

I am using PICKIT3. In debug mode, the circuit and code running. When i press HALT button, MPLAB sayas

Code C - [expand]
1
2
3
4
5
Running...
Halting...
Target halted
 
PK3Err0031: Failed to get PC



To be agree! I closed PLL then, debugging is worked perfect!

Is there any problem with PLL and DEBUG together!

Thanks!!!
 

40mhz is the limit for debug? or pickit3?

my circuit runs perfect at 64mhz ( 16mhz intosc and 4x PLL )

Some times, i need to see some SFR values. So, i want to use DEBUG mode.

I am pushing HALT button. First debugger says unable to get PC value. Than i press run button, microchip runs but serial port baudrate and led blink timings are changing. I measeured that the rate is 4x slow. Like PLL stops. In this time debugger can HALT and shows me PC.

My friend can debug his same circuit in 32mhz ( 8mhz internal and 4xPLL ) with mplabX.

Also, is there any different with mplab8 and mplabX in debug preferences!
 

Thanks "zia"!

ok, i cant debug at64mhz but why debugger makes PLL disable when i press "RUN" ???

(i add OSCTUNEbits.PLLEN=1; in while(1) than it is solved.)
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…