Programming a PIC with a PICkit2 clone - Page 1
Forum section: electronics / beginners

author: rubenvann
author_rank: Newbie
timestamp: December 06, 2016, 06:19:54 pm
content: Hi there,I recently bought a PICkit2 clone. I also have some 10F220's laying around that I want to program. I downloaded the MPLAB X IDE (newest, v3.45) and the compiler for 8-bit microcontrollers, the XC8. I can compile an empty generated project to a hex file succesfully, but MPLAB IPE won't let me select my PICkit2 (the 'tools' dropdown menu stays empty). Is this because PICkit2 is not longer supported? Should I download an older version of IPE?The user guides are not very helpful (though I have just skimmed through them). There are lots of tutorials out there, but they are all for different, older versions of the IDE and IPE. I was hoping someone with more experience could give me some advice. I probably didn't read something that I should read, but for now I'm just trying to program a 10F220 withn empty or simple program (like blinking a LED).The PICkit's power light lights up when I plug it in, otherwise nothing happens. I remembered that I installed drivers but nothing is showing up in my device manager (windows 10).

author: wraper
author_rank: Unknown
timestamp: December 06, 2016, 06:31:58 pm
content: Please don't confuse people by writing MPLAB, as what you downloaded is MPLAB X. Although not very likely, it might be set into old MPLAB mode (it can be switched by some sort of utility IIRC). Did you check if the driver is actually installed, if it is detected by PC at all (Device manager)?

author: JPortici
author_rank: Super Contributor
timestamp: December 06, 2016, 06:48:55 pm
content: AFAIK 'X doesn't support the pickit 2, at all, nor the PK2 have a "MPLAB Mode". I think you're confusing it with the PK3I'm pretty sure that the only way to use the PK2 with MPLAB X is by programming the micro using the PK2 standalone app.http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=pg164120PICkit 2 V2.61 Install A

author: wraper
author_rank: Unknown
timestamp: December 06, 2016, 07:02:13 pm
content: Quote from: JPortici on December 06, 2016, 06:48:55 pmPickit 2 was certainly supported at least in older versions of MPLAB X.QuoteThis might be true.

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2016, 07:26:30 pm
content: I have MPLAB X v3.15 under Windows with a PICkit 2 - it works OK. The v3.45 device support matrix still has columns for PK2D and PK2P so it should still be supported both as a debugger and a programmer. Its never been supported by IPE, so for simply programming pre-built hex files its best to use the PICkit 2 standalone app.

author: JPortici
author_rank: Super Contributor
timestamp: December 06, 2016, 07:33:26 pm
content: it might be because i've never seen the yellow/green dots beside the PK2, that i've tought it was not supported (just another way for microchip to push the PK3 at the time)can you give me a device or two you know that works with PK2 under X? all the pics i'm using that were supported by the PK2 are not on X

author: pelule
author_rank: Frequent Contributor
timestamp: December 06, 2016, 11:09:23 pm
content: PicKit2 is supported only until the latest version of the "old" MPLAB.You can still download that older MPLAP version and the older compiler CCxx (MPLAB does not support XC compilers).

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2016, 01:01:41 pm
content: http://microchip.wikidot.com/mplabx:view-and-set-configuration-bitsSelect the type of oscillator you are using, disable the WDT (critically important), and click the [Generate Source Code to Output] button to create the #pragma config statements you need. Either save as a .c file and add it to your project or copy the whole lot and paste them in above #include <xc.h>.You should load CMCON with 7 to disable the comparators._delay(1000); only waits for 1ms @Fosc=4MHz so you wont see the LED flash - it will be PWMed at half brightness. Try _delay(500000);

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2016, 01:28:32 pm
content: Disable LVP and make sure you have a 10K pullup from Vdd to /MCLR. Also, with BOR enabled Vdd must be 4.5V or greater.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2016, 03:00:50 pm
content: That means MPLAB isn't releasing /MCLR. You shouldn't need to use MCLRE OFF, if MPLAB X is properly configured to release /MCLR (release from reset) when you run the project. If you use /MCLRE OFF, internal oscillator and also set RB6 and/or RB7 as outputs, or enable T1OSC, you may have problems reprogramming the PIC.

author: Ian.M
author_rank: Super Contributor
timestamp: December 08, 2016, 04:55:08 pm
content: Baseline and standard Midrange PIC ports are somewhat idiosyncratic. SeeRMW and solutions for it @ Microchip Forum