Pickit 3 Mini

Previously, I made a Pickit 3 clone – (See previous Blog Post). It works well, but I have often wondered just how little of its circuitry was needed to program and debug the boards I make. For instance – I primarily use the newer 3.3V PIC32 processors, so I really don’t need the ability to alter the voltage like the standard Pickit 3 can. I also have no real need for programming on the go, or even to provide power to the target MCU to program. Knowing this – I decided to see what I could do to remove the circuitry I didn’t need, yet still have a functioning programmer/debugger.

After a little research and looking at what Microchip had done with their starter kits, I arrived at the following schematic, which is based on their Pickit On-Board:

PKOB

Here is a link to a PDF of the schematic: PDF Schematic

In the top left of the schematic is the 25LC256 EEPROM. Working our way down we see the main MCU the PIC24FJ256GB106 – and it’s programming header to the left, and below that is the USB Mini-B connector and the 3.3V regulator. Just above that and to the right is the target MCU programming header. To the right of that is a transistor that controls the target MCU master-clear line. Above that are a couple of voltage dividers that mimic the programming and target mcu voltages, and above that are the target MCU clock and Data lines.

This circuit looks to be the same basic underlying Pickit 3 circuit, but with some “faking” of inputs to mimic missing circuitry. For instance – the OTG programming switch would normally be on pin 21, but instead it is simply pulled high as there is no switch to pull it low. VPP_SENSE and VDD_SENSE are simply fed to the PIC by way of voltage dividers, as is the 2.5 volt reference at pin 16.

As it appeared I had everything I needed, I went about laying out the PCB. Since my ultimate goal with this project is to simply include these parts on my prototype development boards so that I can program and debug with an on-board device, I did not spend a lot of time routing the board. It is a quick and dirty that I am using as a proof of concept. If I intended to make these for long term use, I would have spent some time laying it out properly. Having said that, here are some photos of the PCB layers:

TOP LAYER:

PKOB_TOP_LAYER

LAYER 2:

PKOB_LAYER_TWO

LAYER 3:

PKOB_LAYER_THREE

BOTTOM LAYER:

PKOB_BOTTOM_LAYER

Here are some 3D renderings of what the board will look like:

PKOB_Top

PKOB_Bottom

PKOB_Iso

The board is decently small at 40 x 15 millimeters, but could be a bit smaller. I used 0805 passives, and left things a bit spread out, just to make it easy to solder by hand, so using smaller passives and moving them closer together could easily reduce the size even more. Here is a link to the Kicad project files: KICAD Project Files

Satisfied with things, I ordered the boards and the parts. Here is what the board will look like according to OSH Park :

OSHPARK_PKOB_TOP

OSHPARK_PKOB_BOTTOM

Fast Forward about 10 days, and all my boards and parts have arrived. Here is the actual board:

IMG_1063

IMG_1064

Here is the board after I built one:

IMG_1061

IMG_1062

IMG_1059

IMG_1054

IMG_1051

IMG_1053

After finishing the prototype board, I used the MPLAB IPE and flashed the PIC24 to program it as a PICKIT 3. Once that was done, I connected the PICKIT Mini to MPLAB X and attempted to program one of our project boards. Here is MPLAB X loading the relevant firmware for the PIC:

IMG_1048

and then the PICKIT Mini programming my board:

IMG_1049

IMG_1050

So – now that I know this works, I can set about doing what I originally wanted to. My next prototype board I create for a new PIC project will have its own programmer and debugger built right in. From the above schematic, I can remove the power section and the target programming header, so that I am just left with the PIC24, the EEPROM, and some passives. The prototype board will power the PIC24, so I no longer need the power section here, and the PGED/PGEC lines and MCLR will just be directly connected to the target MCU on the prototype board, so I won’t need the connector. If I place the PIC24 and EEPROM on one side, and the Crystal and Passives on the other side of the PCB, it should take up very little room and give me all the functionality I need.

 

 

Making A Pickit 3 Clone

After using the Microchip tools to program and debug the projects I work on, I wondered about creating my own programming/debugging module that I could put on my own boards – just like Microchip does with their starter kits and such. As I became more interested in that idea, I began to search the web to see if anyone else had already done something similar. Initially, I found lots of posts regarding the 2nd version of the Pickit – the Pickit 2, but not as much regarding the latest version – the Pickit 3 – which is what I need to program the 32 bit pic processors that I am using. After a while I came across a post –¬†From this blog

This Individual had created his own version of the Pickit 3 and had posted his method for doing so. I was excited to see some real information about the process, and set about determining how I would do the same, now that I knew someone else had verified that it would work.

The version that was built on the blog linked above, was done so on a protoboard using a variety of components, and was completely hand-wired. As impressive as that is, I was looking for something a bit sleeker – especially since I was looking at some point to modularize it and use it on other designs. I decided that I would design my project to use surface mount components and a purpose designed PCB. With that in mind, I set out to create my schematic. After looking at the one from Hendrik’s blog post above, and also studying the actual Microchip pickit 3 schematics that are publicly available in the documents released by Microchip, I came up with the following schematic. It is pictured below, and here is a link to the full-sized PDF: My Schematic

Schematic

 

This schematic is very similar to the one Hendrik used, with a couple component changes and a fix for a PNP transistor that was shown backwards on his schematic. I’ll briefly talk about the different sections that I have labeled above. First – in the upper left corner is the pic24 processor that controls this device. It is a PIC24FJ256GB106 mcu. There are the requisite capacitors and 12MHz crystal attached, as well as a programming header to load its firmware. In addition to these components, the USB connector is shown, as well as the status LEDs and OTG Button connections. Directly below the MCU is the MCP1727 voltage regulator. At the bottom is a LTC4411, a MAX893L, and associated circuitry that among a couple other things, controls the power to the programming target, if it is not self-powered, and this device is supplying power to it. Above that is a MCP601 op-amp and voltage boosting circuitry. In the middle of the page is a MCP1525 voltage reference chip and the Target programming header. Top center you will see the three 74LVC1T45 voltage level shifters, and to the right are the 25LC256 EEPROM and also the SST25VF040B serial flash chip used for the Code image when doing OTG programming.

After carefully checking my schematic against the one used on the Blog and also against the one published by Microchip – I was satisfied that it was accurate and I moved on to laying out the PCB.

I decided to use a 4 layer board for this design with the following layer stack:

Layer 1 (Top) – Signal and components

Layer 2 – Ground Plane

Layer 3 – Power Planes

Layer 4 – Signal

I decided to use the open-source EDA program Kicad to design a 4 layer SMD project. I had only used it for 2 layer PTH designs previously, but wanted to see how it would do in something a little more complex than the ones I had already done. Here is a link to the completed Kicad project files – Kicad Project Files

Here are some images of the project in the PCB editor:

PCB_1

The above image shows the front and back signal layers after routing was completed.

Here is an image of the Ground Plane:

PCB_Ground_Plane

An image of the 4 zone power plane I used:

Power_Planes

And an image of just the footprint placement:

Footprints

The 4 zones I used for the power plane were for 3.3V, 5V, and then VDD_INT and VDD_TAR – just to make it a little easier to place components where I wanted without having to route a bunch more traces.

Kicad has a really nice 3d viewer. Here is a rendering of the completed design fully populated with 3d component models:

Pickit

I didn’t have models for a couple of the components like the Inductor or the PTCs that I used, so I just filled them in with resistor models, but you get the idea.

Now that I had everything designed, it was time to send my Gerber files off to get the board made. I uploaded my files over at OSHPark and here are a couple of renderings of what the board would look like based on their interpretation of the Gerbers –

The top of the board:

PickKit3-Top

and the Bottom of the board:

PicKit3 - Bottom

I like using OSHPark because anytime I order boards at OSHPark, the order price includes 3 copies of the design, and also, the boards are really decent quality. I have shared this as an open-source design on their site, so if you are interested in trying this out for yourself and don’t want to have to deal with creating the board, you can just order it from them. Here is the link: Shared Board Files

Now that my board was ordered, I turned my attention to the BOM and getting my parts ordered. Here is an Excel CSV file that contains everything I used – complete with Digikey part numbers. Take notice of the NOTES column where the design has specified Tantalum caps, and also one in particular that needed to have < 1 ohm ESR.

While waiting for my items to arrive, I thought I might try getting a stencil made for this project to make it easier to paste the board prior to component population. So РI ordered one using these files at www.OSHStencil.com. The stencil turned out great Рhere is what I got:

504

Fast forward about 2 weeks……

Now that everything had arrived, it was time to build. I used a table-top vacuum device to place the components manually, but a decent set of tweezers and a steady hand would probably work just as well. Here are a couple photos of the board in various stages of completion-

The bare board as received from OSHPark:

503

The board pasted and components being placed:

507

The pasted and populated board ready for reflow:

508

After the board was pasted and populated, it was time to reflow the solder. I was fortunate to have access to a production reflow oven, but any other method should work just fine – toaster oven, hot-plate, skillet, etc… If you are more adventurous than I am, I’m sure you could solder the whole thing by hand. I used 0805 or larger components for everything, and I also used the “Hand-Soldering” footprint variants in Kicad when laying out the PCB, so there is a lot of pad available to solder on if you want to give hand-soldering a go.

Here is the board after the solder reflow oven completed. Note that I have also soldered on some leads to extend the programming header:

516

 

Now for the moment of truth – let’s see if it works:

509

Success!!

Once it powered up, it was time to load the firmware and see if it would program another board. Here is a photo of my new programmer/debugger programming another device – in this case, a PIC32MX795F512L:

511

Here is the MPLABX output window loading in the new firmware for this target:

512

and after a successful programming of the target device:

514a

There you have it – a successful project in every regard. Throughout this post, I have linked everything that I used to complete this project except for the firmware for the Pickit3. Microchip has publicly released the schematics for this device, but I’m not sure what their stance on the firmware is, so I will not host it here. It is easily discovered with a minimum of effort.

Some items of note:

I have tested the ability to program and debug several different pic processors with this device. It works – plain and simple. What I have not yet tested is the OTG programming mode where you can load an image into the serial flash and take it around and program with it that way. I will test that shortly and edit this post to reflect my results.

EDIT – 2/9/2016 – OTG Programming mode worked fine. I was able to load an image and program from the on-board image without any problems. After the test, MPLAB X gave me the option to return to programmer/debugger mode the next time I connected.

Since everything worked so well, I may do a revision of this board and use 0603 or smaller parts, and may place components on the bottom to shrink it down to a smaller size. the current board is 3.58×1.85 inches (90.91×47.09 mm). It’s not all that much larger than an actual Microchip Pickit3, but I’d like to see if I can make it something more along the lines of a USB Thumb Drive sized device.

I am going to see if a colleague of mine will create a CAD file of an enclosure for this device and then 3d print it. If so, I will post pictures and the file(s) here as well.

If you download the files for use in Kicad, you will get an error message that says you are missing component symbols, etc… However, it will still open and work – using the lib-cache file. At some point in the near future, I will create a separate library file with the actual symbols I used and place it in the download directory as well if it is needed, but I think you should be ok to use it as it is.