Continue to Site

# MPLAB X pulling my hair out again.

#### Pommie

##### Well-Known Member
I've not used any pics for a long time but needed a simple project doing. I picked an 18F2620 as the target device. Hooked it up as normal to my pickit 4 and it won't program. After trying two boards and 4 chips, rechecking the wiring umpteen times I'm at a loss.

The project consists of the config bits and this,
Code:
#include <xc.h>
void main(void){
while (1){
}
}
When I try to compile it (the first time only) I get this,
Code:
Connecting to MPLAB PICkit 4...

Application version............00.06.87
Boot version...................01.00.00
Script version.................00.04.48
Script build number............7acb7c9d66
Tool pack version .............1.8.1120
PICkit 4 is supplying power to the target (4.30 volts).
Target device PIC18F2620 found.
Device Revision Id  = 0x6

Calculating memory ranges for operation...

Erasing...

The following memory area(s) will be programmed:
configuration memory

Script GetVersionDE failed with status Type = runScript, Script name = GetVersionDE, Status = 0xa00
.
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
As can be seen above, the first time it interrogates the chip it gets an id from the Pic18F2620 rev 6 but the second time it tries to fetch the id it fails.
If I then try to compile again, I get this,
Code:
*****************************************************

Calculating memory ranges for operation...

Erasing...

The following memory area(s) will be programmed:
configuration memory

Script GetVersionDE failed with status Type = runScript, Script name = GetVersionDE, Status = 0xa00
.
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.
I tried connecting my pickit 4 to a board containing a 16F18446 (last project I worked on) and that compiles fine.

In all cases the pickit is set to power the target and the target is just the chip.

Has anyone ANY idea what could be the problem?

Mike.
Edit, after following all the recommendations on this page. I finally got it working by moving it to a dedicated USB3 port (not via a hub) and it now compiles!!! Do 18 series take more power than 16 series?
Edit2 And now it's doing the same on the dedicated port. I give up.

Last edited:

#### Pommie

##### Well-Known Member
I've just switched to a 18F23K20 and (touch everything) it seems to be working. At least I can get on with the task in hand after wasting most of the day.

Mike.

#### rjenkinsgb

##### Well-Known Member
In all cases the pickit is set to power the target and the target is just the chip.
Try adding a load resistor across the 5V (or 3.3v?) power at the device.

I have had problems with just a PIC and no other parts, it seems that the VPP current upsets the VDD voltage? Adding a suitable resistor across VDD-VSS fixed it completely, in my case.
(I actually added two x 470R, but I don't think it really needs both).

#### tumbleweed

##### Active Member
One thing you want to do is to make sure that the firmware in the PICKITx/ICDx matches the firmware for the version of MPLABX that you're using, or you can get all sorts of nonsensical messages. I've had them "fail right out of the box" until I did this.

For me, it doesn't always update automatically when I switch versions of MPLABX, so I have to force the firmware update. I recommend doing that w/out a target chip connected (which I'd always recommend doing when you switch devices/projects anyway).

It's also a good idea to have any recommended bypass and Vcap/VDDcore capacitors installed (if needed by your chip).

#### Pommie

##### Well-Known Member
Just switched back to the 18F2620 board, added a 330Ω resistor across the power lines and it appears to be working again.

I checked the firmware for the PK4, I only have one version on my PC and that was reloaded without success.

Anyway, it seems to be working now. Tomorrow may be a different story as you can never tell with MPLABX.

Thanks everyone,

Mike.

Replies
20
Views
2K
Replies
10
Views
1K
Replies
19
Views
1K
Replies
10
Views
3K
Replies
11
Views
2K