View previous topic :: View next topic |
Author |
Message |
Eoin87
Joined: 20 Oct 2009 Posts: 18
|
Enabling FRCPLL Causes debugger to fail |
Posted: Wed Nov 04, 2015 6:22 pm |
|
|
When I program my PIC24FJ32GB002 with the fuse FRCPLL set, I get the following error message from my PK3:
Running...
PK3Err0040: The target device is not ready for debugging.
Please check your configuration bit settings and program
the device before proceeding.
As soon as I switch back to FRC it works perfectly.
Any ideas what could cause this? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19559
|
|
Posted: Thu Nov 05, 2015 2:32 am |
|
|
How long is your cable?.
There are lots of issues with the connection having to be kept as 'short as possible', once the clock rate rises.... |
|
|
Eoin87
Joined: 20 Oct 2009 Posts: 18
|
|
Posted: Thu Nov 05, 2015 3:35 am |
|
|
The connections from the debug header on the PCB to the PIC on my PCB are very short and neat, I'm guessing you dont mean the length of the USB cable??
I am supplying target power from the PCB itself and not from the PIckit3. My VDD is 3.3V |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19559
|
|
Posted: Thu Nov 05, 2015 3:52 am |
|
|
The connections on the PCB, _and_ the cable between this and the PicKit. On several of the debuggers you have to get shorter actual cables to the debugger to work at higher frequencies. Or are you using the direct six pin connector, rather than an RJ connector?.
From the PicKit3 User's guide:
"• What limitations are there with the standard cable?
The standard ICSP RJ-11 cable does not allow for clock speeds greater than
about 15 Mbps." |
|
|
Eoin87
Joined: 20 Oct 2009 Posts: 18
|
|
Posted: Thu Nov 05, 2015 4:01 am |
|
|
i'm using a direct 5-pin header on my PCB where the pickit plugs in.
So the distance from there to PIC is around 1cm max |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19559
|
|
Posted: Thu Nov 05, 2015 8:55 am |
|
|
Realistically you need to post on the MicroChip forum, or ask MicroChip directly.
What resistors have you got on PGC/PGD?. ideally show us a picture of your connections. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 05, 2015 11:00 am |
|
|
If you check the Microchip forum, some people report that putting a scope
probe on the PGC line will often make it start working. So they end up
putting a 22pf cap on that line. |
|
|
Eoin87
Joined: 20 Oct 2009 Posts: 18
|
|
Posted: Thu Nov 05, 2015 5:11 pm |
|
|
Hi guys,
I fixed it without any hardware modifications. I have no idea why turning off some of the fuses I did makes it work but now it works.
Here are the fuse settings:
#fuses FRC_PLL, NOOSCIO, DEBUG, PLLDIV2, NOIESO, CKSNOFSM, SOSC_HIGH, WUT_DEFAULT, RTCOSC_SOSC, ICSP1 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Nov 05, 2015 5:15 pm |
|
|
But what were your original fuse settings that didn't work ?
Can you post them ? |
|
|
wangine
Joined: 07 Jul 2009 Posts: 98 Location: Curtea de Arges, Romania
|
|
Posted: Fri Nov 06, 2015 5:27 am |
|
|
PCM programmer wrote: | But what were your original fuse settings that didn't work ?
Can you post them ? |
Is about FRCPLL on , i has same isue long time with all dsPIC33FJxxMC and also xxGS series .The strange thing was, sometime procesor start, some time dont even start with PLL on , without touch any code,,, after some research, the below function in ASM solve for all ds33 procesors.
Code: | void start_PLL()
{
//this code sets the multipliers
#byte CLKDIV_L=0x0744
#byte CLKDIV_H=0x0745
#byte PLLFBD_L=0x0746
#byte PLLFBD_H=0x0747
//Configure multipliers N1=0, N2=0, M=43
PLLFBD_L=41;
PLLFBD_H=0x00;
CLKDIV_L=0x00;
CLKDIV_H=0x00;
#asm asis
MOV 0x00,w0
MOV #0x743, w1 ;OSCCON_H 0x743
MOV #0x78, w2
MOV #0x9A, w3
MOV.B w2, [w1]
MOV.B w3, [w1]
MOV.B w0, [w1]
MOV 0x01, w0
MOV #0x742, w1 ;OSCCON_L 0x742
MOV #0x46, w2
MOV #0x57, w3
MOV.B w2, [w1]
MOV.B w3, [w1]
;write bit to switch from FRC to FRC_PLL
MOV.B w0, [w1]
#endasm
} |
It was not tested on 24PIC family |
|
|
|