MPLAB X, PICkit 3 and Midrange devices problem

Post
Mike McConnell
New Member
2012/12/13 21:06:45
I Really need some advice/help/ideas on an issue with a PICkit3 and MPLAB X and PIC16s.
Setup:
Windows 7 Pro. 6 Core 3.2Ghz with 32G RAM and twin 2T Sata3 drives. New machine
with only a few things installed so it's very clean.
Downloaded MPLAB X v1.51 and let it install normally. Downloaded and installed XC8.
Downloaded and installed C18 (for the USB stack work). Downloaded and installed
application library. No other MCHP software installed
I have multiple PICkit2s and 3s available. Both versions have been used extensively
over the past several years. I also have an ICD2 but its off site at the moment.
Both PICkit2 and PICkit3 properly show up in Project Properties - Hardware Tools
and can be configured via the usual sequence from the Project Properties window.
Current project will use 16F721 and 18F25K50 but I have many boards from past projects
with a wide variety of 12, 16 and 18 variants available.
A second machine has MPLAB IDE 8.76 installed. Everything works perfectly there for
all cases.
 
Neither PICkit2 or 3 work with PIC16s but for brevity I will focus on and document the issues
with the PICkit3 and MPLAB X.
One additonal note: I am powering the targets from the PICkit3 but I've only populated
the passives, a couple LEDs and the PIC16. Nothing drawing power but the PIC however
there is ~100uF of capacitance on the board but power looks pretty good (a little lower than
than the set voltage in MPLAB X and IDE 8.76 but well within part specs.

The problem:
I let MPLAB X download to the PICkit3 the new bootload, RS and AP. The old firmware
on it was 01.26.71. Now it's 01.28.18.
Compile a short program to blink and LED and get this message from PICkit3 window
with voltage set to 5.0V:
Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.28.18
Firmware type..............Midrange
Target detected
Failed to get Device ID
From the Debugger Console tab I get this:
Launching
Could not connect to tool hardware: PICkit3PlatformTool, com.microchip.mplab.mdbcore.PICKit3Tool.PICkit3DbgToolManager
The debugger could not be started.  Terminating debug session.
User program finished
 
Changing volatage to 4.0V and re-trying I get this:
PICkit3 window:
Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.28.18
Firmware type..............Midrange
Target detected
Device ID Revision = 3
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x7ff
configuration memory
Programming...
Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.
... and the Debugger Console window:
Launching
Programming target
com.microchip.mplab.mdbcore.common.debug.exceptions.MDBCommonToolException: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding.
The debugger could not be started.  Terminating debug session.
User program finished

Changing voltage to 3.125V.
PICKkit3 window:
Connecting to MPLAB PICkit 3...
Firmware Suite Version.....01.28.18
Firmware type..............Midrange
Target detected
Target Device ID (0x0) does not match expected Device ID (0x1c20).
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x7ff
configuration memory
Programming...
program memory
Address: 1 Expected Value: 118a Received Value: 0
Failed to program device
... and the Debugger window:
Launching
Programming target
Failed to program the target device
The debugger could not be started.  Terminating debug session.
User program finished
 
Initial thought was OSC was starting due to config bit problems but that should be ok.
Here's the code:
// CONFIG1
#pragma config FOSC = INTOSCCLK  // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA4/CLKO pin, I/O function on RA5/CLKI)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON       // RA3/MCLR/VPP Pin Function Select bit (RA3/MCLR/VPP pin function is MCLR; Weak pull-up enabled.)
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)
#pragma config BOREN = ON       // Brown-out Reset Enable bits (Brown-out Reset enabled)
#pragma config PLLEN = ON       // INTOSC PLLEN Enable Bit (INTOSC Frequency is 16 MHz (32x))
// CONFIG2
#pragma config WRTEN = OFF      // Flash memory self-write protection bits (Write protection off)
#include <xc.h>

If I comment the entire pragma section it behaves the same. BTW the 16F721 only has internal
OSC and external clock options. I supplied an external clock to the proper pin in
despiration but it still doesn't work.
If I go back to 8.76 platform, select the PICkit3 as Programmer it won't work anymore.
It's there and it tries to program/read/verify/erase or whatever I ask but it always
fails. If I go to the programmer menu-Configuration-uncheck the automatic latest box
and push the manual update button it reloads 01.26.71. Simple reconnect and all is well again.
 
This is the same board, MPU and PICkit3 that doesn't work with MPLAB X. I'm literally moving
the USB cable from one machine to another.
 
I also tried a small PICKit2 Low Pin Count Demo board which has a few LEDs and a 20pin PIC
socket. This allowed me to use 16F688s which I had in DIP form. Same resutls however
I only tried it at 5.0V.
Also I have tried 4 different 16F721s and 2 different 16F688s. All the same results.
 
I've spent a day and half trying to get this to work. Normally I'd just go back to 8.76 and
move on but I was really hoping to use the C compiler for the PIC16 work instead of having to
work in assembler. This is the only reason I was willing try a new version of the tool chain.
 
Summary:
Not the OSC or a clock. No other tool errors and if I simply switch to the PIC18 project,
move the PICkit3 to that board, it all works (and the PICkit3 gets loaded with different
firmware for PIC18).
 
No published errata that's relevant to this and I've search the forum and web. I'm going off
to dig up PICkit3 info but what I have here give no indication of an issue related to this
and I used these PICkit3s for the development work on the 16F688 projects sucessfully in
the past.
 
Grasping for straws my next guess will be to try using a lab supply and see what happens.
Any suggestions or ideas would be helpful.
Thanks,
Mike
Mike McConnell
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2012/12/13 23:30:03
Update:
 
After some additional reading I discovered that CX8 will work with IDE 8.1 or later. I had incorrectly assumed that it would only work with MPLAB X.
 
Installed on IDE8.76 machine - created new project - imported .c and .h files and compiled w/o errors. Re loaded PICKkit3 with 1.26.71 firmware (just because I knew it had worked in the past) and bingo. Programmed parts fine, and code blinks the led correctly. Breakpoint worked.
 
Still would like to see 10 work as it hold the promise of a better debug environment and I do have a working PIC18 option there but ... I would certainly test ideas and try things/provide more info if one of the MCHP support people need any data from me.
 
Mike
Mike McConnell
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2012/12/14 17:00:24
Another update:
 
I uninstalled all the MCHP products from the machine and carefully (so I thought) went through the machine deleting anything to do with MHCP to ensure all tracks were gone. Reboot, and then reinstalled MPLAB X, then XC8. Restarted MLPLAB X and it came up with the same list of recent projects so apparently my cleaning was insufficient. Worse yet I still have the same behavior and cannot get the PICkit3 to work.
 
I'm going to replace the *.jam file in MPLAB X with the 01.26.71 version so it can't update with the 01.28.18 code and see what happens. Obviously I'm getting desperate but I'm thinking the problem might be with the PICkit3 itself because if I leave the 01.28.18 code in the PICkit3 and try to use it with 8.76 I get exactly the same failure modes as I do on MPLAB X so this seems like a reasonable guess.
 
Cheers,
 
Mike
 
Guest
Super Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/22 07:46:38
Mike,
 
If you find a solution to this PICKit problem, please post it here.  I'm got the same symtoms.
 
Thanks,
 
Gary
nickoatley
Starting Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/22 09:08:43
I'm using PICkit 3 (with PIC18F47J53) and MPLAB X, and it's fine for me.  PICkit 3 firmware suite shows as v01.28.40, MPLAB X was a clean install of v1.60.  Don't know whether that helps or not...
 
Nick.
Tomw
Starting Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 06:55:15
I have the exact same problem, got no answers here so far.  How did you reload the old firmware?
hamsdybamsdy
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 08:03:27
Hello Mike,
 
Have you PICKIT2 and PICKIT3 at the same time on your USB Ports.
Please remove one of them and check it again.
I have had problems with the MPLAB IPE if both Debugger/Programmer (PICKIT2 AND PICKIT3) was connected to the PC.
 
best regards
Helmut
Guest
Super Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 16:41:35
Thanks Nick,
I too have sucessfully used PIC18F14K22 and PIC18F45K50 in two other parallel projects I'm working on. It seems to me that PIC18's work just fine. The sad thing is that I really like the netbean interface and overall X development platform. Coding is more efficent due to shortcuts and the many other features but .... I still cannot get a PIC16 to work. I would also add that I'm not completely thrilled with XC8 as I had several situations in the PIC18 developments where XC8 flat failed to produce any errors where there clearly were. They get highlighted properly but the complier runs without error. My work around is to open every source file and look at the highlight markers in the right column. Has been a hassle but not a show stopper once I figured out what was happening.
Mike McConnell
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 16:46:56
Tom,
 
I have a couple of machines that have older IDEs installed. My personal notebook has 8.76 and with it I can force it to reload the older firmware on a PICKit3.
 
Also Nick - I noticed that I wasn't logged in so my response was tagged as Guest but it was me.
 
Hope that helps.
 
Mike
Mike McConnell
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 17:03:09
I only have one connected at a time but now have used two different PICKit3s and both have exacly the same behaviour - neither work with PIC16F721. Unfortunately I have already invested more time than I can afford on this problem and that MPU so I swapped it out with a pin compatable PIC18F14K22. That one works just fine. I'm hoping that when development is complete I can simply take the source code back to the 8.71. or 8.88 installs I have and recomplie for the PIC16. I've test it with the code I have thus far and other than config and initialization changes it works fine. Not thrilled but we do what we have to get things done and working.
Tomw
Starting Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/01/23 19:52:45
I pulled my PICKIT2 out of the closet and use that for the 16F parts, seems to be working fine.  The stuff that needs the PICKIT3 will just have to wait until Microchip does something.
Thanks
 
Guest
Super Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/02/27 20:06:41
Thanks for posting!!
I was using MPLAB X (last years version) with HI-TECH PICC compilers and I was going to town with the PIC16F's that I had (PIC16F886 and PIC16F1938, from the PIC-dem board kit). However, I was having heartburn with the PIC18F's (something with the CONFIG syntax). No matter, I did all of my development with the PIC16F's. Then I downloaded XC8 and the newer version of the MPLAB and the PIC18F works great but the PIC16F's act as described above. So, it seems that I need preserve the old computer back in the lab with the old IDE and old compilers on it for the PIC16F's but use the new computer for the PIC18F's. Any guesses on how long it will take for Microchip to fix this??
Mike McConnell
New Member
Re:MPLAB X, PICkit 3 and Midrange devices problem 2013/02/28 12:01:44
Guest

Thanks for posting!!
I was using MPLAB X (last years version) with HI-TECH PICC compilers and I was going to town with the PIC16F's that I had (PIC16F886 and PIC16F1938, from the PIC-dem board kit). However, I was having heartburn with the PIC18F's (something with the CONFIG syntax). No matter, I did all of my development with the PIC16F's. Then I downloaded XC8 and the newer version of the MPLAB and the PIC18F works great but the PIC16F's act as described above. So, it seems that I need preserve the old computer back in the lab with the old IDE and old compilers on it for the PIC16F's but use the new computer for the PIC18F's. Any guesses on how long it will take for Microchip to fix this??

 
With the updated version that recently came out I now am able to get the PCI18Fs to work. I got several project going on using 3 or 4 different PIC18Fs and they all work fine. The lone PIC16F720/1 project still cannot be debugged in X. XC8 seems to produce executable code but the debugger won't connect or work at all. To debug I switched to a PIC18F14K22 which is pin compatible. It works fine and let me debug the application and hardware. I've created two different initialization blocks, one for the PIC18 and one for the PIC16 so I can compile for either target.
 
Here's the weird part with the PIC16Fs: If I run from MPLAB X the debugger cannot detect a target so I cannot even get started. If I load MPLAB IPE and attempt to "Connect" it will fail while programming but will detect the part and revision number (X won't even do that). So from IPE I simply ignore the error message and ask for "Blank Check". That works and comes back not blank which is correct. I hit "Erase" and that works. Point to the production code, load it and hit "Program". Works fine. "Verify" says good. Test the part and it works as expected. This is the only way I can use the new tool set to program PIC16F721s. Painful and more than a little scary. Doubtful I'd get this process accepted by anybodys QA group.