Author Topic: Programming a PIC with a PICkit2 clone  (Read 7389 times)

0 Members and 1 Guest are viewing this topic.

Offline rubenvannTopic starter

  • Newbie
  • Posts: 7
  • Country: nl
Programming a PIC with a PICkit2 clone
« on: December 06, 2016, 06:19:54 pm »
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).
« Last Edit: December 06, 2016, 06:34:31 pm by rubenvann »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16865
  • Country: lv
Re: Programming a PIC with a PICkit2 clone
« Reply #1 on: December 06, 2016, 06:31:58 pm »
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)?
 
The following users thanked this post: rubenvann

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Programming a PIC with a PICkit2 clone
« Reply #2 on: December 06, 2016, 06:48:55 pm »
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 PK3
I'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=pg164120
PICkit 2 V2.61 Install A
« Last Edit: December 06, 2016, 06:50:53 pm by JPortici »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16865
  • Country: lv
Re: Programming a PIC with a PICkit2 clone
« Reply #3 on: December 06, 2016, 07:02:13 pm »
AFAIK 'X doesn't support the pickit 2, at all,
Pickit 2 was certainly supported at least in older versions of MPLAB X.
Quote
nor  the PK2 have a "MPLAB Mode". I think you're confusing it with the PK3
This might be true.
 
The following users thanked this post: rubenvann

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Programming a PIC with a PICkit2 clone
« Reply #4 on: December 06, 2016, 07:26:30 pm »
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.
 
The following users thanked this post: rubenvann

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Programming a PIC with a PICkit2 clone
« Reply #5 on: December 06, 2016, 07:33:26 pm »
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
 
The following users thanked this post: rubenvann

Offline pelule

  • Frequent Contributor
  • **
  • Posts: 513
  • Country: de
  • What is business? It’s other people’s money
Re: Programming a PIC with a PICkit2 clone
« Reply #6 on: December 06, 2016, 11:09:23 pm »
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).

You will learn something new every single day
 
The following users thanked this post: rubenvann

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Programming a PIC with a PICkit2 clone
« Reply #7 on: December 07, 2016, 01:01:41 pm »
http://microchip.wikidot.com/mplabx:view-and-set-configuration-bits
Select 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);
 
The following users thanked this post: rubenvann

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Programming a PIC with a PICkit2 clone
« Reply #8 on: December 07, 2016, 01:28:32 pm »
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.
 
The following users thanked this post: rubenvann

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Programming a PIC with a PICkit2 clone
« Reply #9 on: December 07, 2016, 03:00:50 pm »
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.
 
The following users thanked this post: rubenvann

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Programming a PIC with a PICkit2 clone
« Reply #10 on: December 08, 2016, 04:55:08 pm »
Baseline and standard Midrange PIC ports are somewhat idiosyncratic.  See RMW and solutions for it @ Microchip Forum
 
The following users thanked this post: rubenvann


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf