Pickit2 clone and 3.3v pic microcontrollers - Page 1
Forum section: electronics / general

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 02:33:33 am
content: Hello, I have a DIY Pickit2 clone, and I want to use it to upload a firmware into a PIC24FJ256GB106-I/PT.since this microcontroller works with 3.3v , I can make an external power system for it, but the other problems that I have is logic level from pickit2 " clock, and data"and finaly vpp/MCLR volage connected to this microcontroller. I don't want to fry it, can you give a solution please

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 02:50:02 am
content: Maybe I can use level shifter 5v to 3.3v but I'm not sure that will work "in real word senario", and my bigest problem is VPP/MCLR voltage for 3.3v microcontroller, what is supposed to be?regards

author: fchk
author_rank: Frequent Contributor
timestamp: November 09, 2020, 07:31:09 am
content: PICKIT3 uses 74LVC1T45 level shifters, but you will need the Direction signal for PGD from somewhere.MCLR is 3.3V - PIC24 doesn't use High Voltage Mode for switching into programming mode, but a special bitstream on MCLR.The PICKIT's firmware must be adapted to be able to program PIC24 and PIC32 since the programming commands are very different from PIC16/PIC18.A Pickit 3 clone costs 20$. I recommend buying one of these unless you have lots of time to waste.fchk

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 09:11:54 am
content: The PIC24FJ256GB106 is supported for debugging and programming with a PICkit 2 under MPLAB v8.92, or with the PICkit 2 standalone utility v2.61 so it depends on how accurately your DIY clone follows the genuine PICkit 2 schematic. Normally there are three areas of concern:Substitute parts in the target Vdd supply section may not allow the same range of Vdd as the original or may be incapable of supplying 30mA without loss of regulation, or variable Vdd support may be completely omitted.Substitute parts in the Vpp generator may fail to provide the correct programming voltage, or it may be unstable under load.The clamping circuit for PGC, PGD and AUX may be missing or non-functional, which will over-volt the signal lines of the target's ICSP interface.If the target is externally powered, (1) is irreverent. If your PICkit 2 clone doesn't have 3.3V Vdd support don't connect PICkit 2 target Vdd to the target ICSP interface. Assuming 'fchk' is correct and that PIC24 doesn't use HV programming (I haven't checked its datasheet), then (2) is irrelevant, (but see clamping below).If your PICkit 2 clone omits the clamping circuit for reduced target voltage support, it can be added externally, copying it from the PICkit 2 schematic. For non-HV programmed PICs you'll need another instance of the per line part of the clamping circuit to limit Vpp/MCLR to 3.3V.However I would suggest taking the opportunity to fully upgrade your clone for variable Vdd support. If you run into issues, note that many clones have problems with poor choice of substitute OPAMP U2 in the target Vdd regulator which *must* be true RRIO, and handle a supply voltage range of 4.5V to 6V, P-MOSFET Q1, the Vdd pass transistor which must have a low Vgs threshold, and the Vdd switch dual MOSFET U5 which again needs low threshold voltages, and a low enough Vds_on for its PMOS half to avoid excessive voltage drop under load. Its also possible to FUBAR the Vpp generator by a poor choice of inductor with too high DC resistance.

author: Lindley
author_rank: Regular Contributor
timestamp: November 09, 2020, 09:22:22 am
content: Have built diy pickit2s before and if you power the whole circuit from a 3v3 regulator it will run and program 3v3 chips ok.

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 09:51:40 am
content: That will only work if you are lucky with your PIC18F2550, as its not rated to run below 4.2V Vdd. It also won't meet specs for its USB transceiver as the internal 3.3V regulator for Vusb needs some headroom. If you use a PIC18LF2550, at 3.3V its only rated to run at 25MHz, (see datasheet fig. 28-2) which isn't fast enough for the PICkit 2 firmware, so you are over-clocking it 90%!Microchip used clamps rather than dropping the programmer MCU Vdd supply for a reason, and the extra parts required aren't special or expensive, so there's no need or reason to bodge it!

author: Lindley
author_rank: Regular Contributor
timestamp: November 09, 2020, 10:28:54 am
content: Would not dispute what Ian says, but it did work ok for us when we programmed a couple of pic24s, probably just lucky at the time; way back in 2007!Did eventually purchase one of the China based Pickit3 clones, cheaper than buying the diy parts, worked ok.

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 01:13:30 pm
content: Thank you Fchk, thank you Ian , and evryone.My pickit2 clone doese not have clamping block,and I don't know if VPP can be changed by th programmer, and then we can get different VPP levels ie:3.3v for pic24f, finaly it can only give 5vas VDD. I want to solve this problems by making a external MOD circuit for this programmer which contains :1-Bi-directional level shifter, for both clock and, data pins.2-"if" Vpp only can be 12v with my clone, I will make voltage devider for it. to reduce 12v to 3.3v whenever it is activated by the programmer.3-external 3.3v voltage regulation.DID I miss something here?Thank you for your help.regards.

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 02:11:57 pm
content: See FIGURE B-2: PICkit 2 SCHEMATIC DIAGRAM (PAGE 2 OF 2) in the PICkit 2 user guide. The top half is the clamping circuit which is a PNP transistor for each line with its emitter to the line, collector to ground and its base held one diode drop below target Vdd. That will do nicely for PGC, PGD and AUX,using any 'jellybean' PNP you have handy, with another, diode connected (join base and collector, and call it the cathode) replacing D1 to provide the base bias voltage.Clamping Vpp is more problematic. Its preferable to figure out if you can mod the programmer to isolate the feed to L1 from the programmer's 5V target supply and re-connect it (with associated decoupling caps) to an appropriate regulated supply or even target Vdd if the target is externally powered.You can use the Pickit 2 utility Tools: Troubleshoot... dialog to check if your programmer is capable of variable Vpp, which it sets depending on the device family selected. It also lets you check Vdd and PGC, PGD outputs. If you want to check the ICSP lines as inputs or check the AUX as outputs, use Tools: Logic tool. Thus you can be 99.9% sure your mods are good before you even have to connect to a target chip.Post good closeup photos of both sides of your programmer's PCB, and we may well be able to suggest a circuit you can build on protoboard to upgrade it to full PICkit 2 hardware compatibility, and the points you'll need to patch into.

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 07:01:03 pm
content: thank very much Ian , foor your help. I really apreciate that.Now I'm tracing a mod circuit with easyeda. in a couple of minutes I will post it here, and then please tell me what do you think about it. for my Pickit2 this is its picture . I just traced with sprint layout6 from a freind's already made pickit2 clone.As I told you ,VDD is 5v.VPP I measure it using DMM max voltage feature, I've got 12.42v.for Data and clock pins, I measure max voltage I've got 1.38v when there is no reading or erase or programming operation . and in those operation . it stayt as max voltage value for those pins . I don't know if my multimeter "Aneng 780" really record max voltage or, missed it.

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 07:45:54 pm
content: OK, that will be possible to mod to full PICkit 2 compatibility. The 8R2 resistor behind the USB port feeds the top end of L1 in the Vpp pump circuit - remove it and feed its right pad from the variable target Vdd supply, As the resistance of L1 is important to the Vpp charge pump output characteristic, it may not pass self-test if its much different from the approx 35 ohms of a genuine PICkit 2, hence the 8R2 resistor to bring the value up a bit. Measure your actual L1 and if required, add a series resistor to get the total in the 32 to 35 ohm range.The fixed 5V Vdd is supplied via the BYT51 diode on the left - remove it and patch in a regulator based on the original schematic (page 1 bottom right section round U2, Q1), and the Vdd switch (page 2, top section round U5)There will be a few other points that need to be connected to, namely ground and some PIC pins to control the Vdd circuit.Don't attempt to substitute the dual MOSFET U5 (FDC6420C). That's where most clone builders go wrong. Its Rds_on has to be within fairly tight limits for the Vdd over current protection, which works by monitoring voltage drop to function. Finding a through-hole PMOS substitute for its bottom half is more work that I care for for a one-off, (the top NMOS half is trivial as it only pulls down via a 1K resistor). Its readily available from most major distributors, and can easily be put on a breakout board if you are doing a through hole build. The MCP6001 OPAMP is less critical. Most 5V single supply RRIO OPAMPs will be suitable, though you might as well get the exact part one and use another breakout.

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 08:17:34 pm
content: hello Ian , thank you for your feedback.maybe I made an attempt to make logic levels, VDDand VPP voltages suitable for pic24f.here is my mod circuit.what do think about it?best regards

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 08:27:03 pm
content: That's based on the old Philips I2C MOSFET level shifter appnoteAN97055. The problem with it is that its logic one drive is extremely weak so its unsuitable for fast digital signals like PIC24 ICSP. As the PICkit 2 controller MCU doesn't have a direction control output for PGD to control a bidirectional level shifter with push-pull outputs, your best bet is, as I said earlier, to copy the PNP clamping circuit from the original schematic.I don't think an external Vpp limiter will work as I suspect the PICkit 2 control MCU will detect Vpp overvoltage and error out. You'll need to mod your programmer to feed L1 a regulated 3.3V.

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 08:42:29 pm
content: I make this MOD because it is simple and it doesn't require too much components. but since it will not work, so I have to add removed components to make my pickit2 clone looks like the original one. Ian the logic onne is weak for this level shifter , in which side? voltage, current or rise and fall edge" timing or slew rate? and finaly, is this because of the mosfet characteristics?For this level shifter is desined to be bi_directional by its nature.thank you for your precious information bro .best regards .

author: Ian.M
author_rank: Super Contributor
timestamp: November 09, 2020, 08:51:30 pm
content: Quote from: ifrenide on November 09, 2020, 08:42:29 pmRisetime. Its only source of current to reach a logic '1' level is via the 10K pullups. 1K *might* work better, but you cant reduce their value too much as that would compromise the logic '0' level. The MOSFET Rds_on makes some difference, but most of the limitation is the PIC18F2550 Vol vs Iol characteristic, which you are stuck with.

author: ifrenide
author_rank: Regular Contributor
timestamp: November 09, 2020, 10:06:29 pm
content: Many thanks to you Ian . I apreciate your help. thank you bro I'm happy with I've learned from you.