MacPKit2 is a console application that runs on OS X and communicates to the Microchip PicKit 2 USB device programmer.
The Pic Kit 2 is an HID class device. That means that OS X will swipe it as soon as it's plugged in. However, that doesn't mean it works out of the box. The HID manager doesn't know what to do with it. Microchip did not provide an application for OS X so I wrote one from scratch that would talk to the HID manager, thru which the Pic Kit 2 is accessed. It was a challenge to get the USB interface working but it was a fun accomplishment.
|Project Status||Last Update|
What you Need
|Read firmware version # from Pic Kit 2||Yes|
|Read program memory from device||Yes|
|Read .hex file||Yes|
|Read config word from .hex file||Yes|
|Read config word from device||Yes|
|Read data memory from device||No|
|Target power on||Yes|
|Target power off||Yes|
|Erase program memory||Yes|
|Erase data memory||Yes|
|Write config word to device||Yes|
|Write pgm memory to device||Yes|
|Verify device with file||No|
|Update Pic Kit 2 firmware||No|
|Order a moo shoo pork||No|
|Runs on OS X.4 PPC||Yes|
|Runs on OS X.3||Yes|
|Runs on OS X.2||Maybe|
|Runs on OS X.1||Doubtful|
|Runs on OS X.0||No|
|Runs on OS 9||No|
|Runs on OS 8||No|
|Runs on OS 7||Heavens No|
|16F877A||Yes (see firmware note below)|
The devices are limited to what the Pic Kit 2 can do. If you'd like a device added, first check what your Pic Kit 2 firmware will support and then let me know and I will add it. It's pretty easy to add them I just have not had a need to so far. For starters, I'll need to know:
The first thing you should do is plug in your Pic Kit 2 and make sure the OS has discovered it by looking in the Apple Profiler which is accessed via the About This Mac menu item.
The next step is to run MacPKit2 with the v option from the Terminal. Note there is no "-" used so the command would actually be "MacPKit2 v". This will connect to the Pic Kit 2 and fetch the firmware version #. Once this is sucessful everything should work provided your target circuit is functioning.
|Fetch the firmware version # of the Pic Kit 2.||v|
|Get the MacPKit2 version #.||V|
|Read config word of device.||c|
|Read config word of device, enhanced device.||ce|
|Read pgm memory.||r|
|Read pgm memory, enhanced device.||re|
|Read Hex file into memory and display contents.||R filename|
|Read Hex file into memory and display contents, enhanced device.||Re filename|
|Write .hex file to device's pgm memory.||w filename|
|Write .hex file to device's pgm memory, enhanced device.||we filename|
|Erase pgm memory||e|
|Erase pgm memory, enhanced device.||ee|
|Erase data memory.||E|
|Erase data memory, enhanced device.||Ee|
|Inquire device, enhanced device.||i|
|Target power off.||0|
|Target power on.||1|
The enhanced device arguments simply bypass the midrange device lookup which results in a slightly faster performance in v1.1.5. You must be using an enhanced device, e.g. 18F series to use these parms. If in doubt, do not use the enhanced device parms.
Note you need to erase a device ("macPKit2 e") prior to writing to it. Here is a sample unix script that I use to copy down a .hex file and then erase, program, and kick off a device:
cp ~/Desktop/Windows\ Share/pic/SPRINKLER.hex ~
macPKit2 w ~/SPRINKLER.hex
MacPKit2 is licensed as freeware for personal use only and is not certified for use at nuclear facilities. It's mission is to help make easy PIC programming a reality for the Mac by providing more options. You don't have to hunt down third party libraries, compile source code, or make projects. If you find it useful, you can make a donation to help pay for web hosting.
There will likely be a GUI interface developed for MacPKit2 to make it easier to use. I have also been working on a compiler and there will probably eventually be a total solution package. In the meantime, you can try gpasm if you need a compiler.
MacPKit2 runs on OS X. Get it now. Full Mac ahead!
When I try to kick it off at a command prompt I get the message "macPKit2: command not found"
When I kick it off, I get the error "Library not loaded: @executable_path/../Frameworks/libHIDUtilities.dylib".
What about building an ICSP interface for a few bucks and run it thru a Keyspan adapter to the Mac?
Why am I receiving a "Couldn't find device with Device ID: 0000" message when it retrieves the firmware version OK?
|Q: OK how do I actually use it?|
|A: MacPKit2 is a console application (for now) and you need to open a Terminal window to use it. Then you simply kick it off with the command you want. See the readme file included in the installation package for more info.|
|Q: When I try to kick it off at a command prompt I get the message "macPKit2: command not found".|
A: It's probably a path issue. You can add a "." to your path statement which will enable you to kick off applications in the current folder:|
path (/bin . /usr/local/bin /sbin /usr/bin /usr/sbin)
Add it to your .cshrc file if you're using tcsh for a shell.
|Q: When I kick it off, I get the error "Library not loaded: @executable_path/../Frameworks/libHIDUtilities.dylib".|
|A: This happens if you move the application but do not move the frameworks folder. The frameworks folder must be located in the folder where the application is.|
|Q: What about building an ICSP interface for a few bucks and run it thru a Keyspan adapter to the Mac?|
|A: I started doing this but ran into some issues. First off not everyone has a Keyspan and who knows how long those will be supported for. Secondly these solutions always rely on software to toggle bits of data into the pic. This is not easy to do on multi-tasking operating systems because of the strict timing conditions that must be adhered to. By the time you build the interface, troubleshoot, etc. you could have ordered a Pic Kit 2 for $34 from digikey.|
|Q: Why am I receiving a "Couldn't find device with Device ID: 0000" message when it retrieves the firmware version OK?|
|A: This should be resolved in v1.1.7. The reason is you are using a more current firmware and the programming voltage level now differs on some Microchip devices. Note that you should not attempt to use an 18J device with MacPKit2. The 18J uses a much lower (3.3v) programming voltage level.|
11/19/07 - Before you download - Check your Firmware. If your PicKit2 has v2.0 or greater, it is not currently supported. v2.0 was a major change and involved MicroChip switching the architecture to .net and changing the command method. It may be awhile before it is supported. I had at least one person successfully reflash their PicKit2 to v1.#. The device he was using did not require v2.0. I do not necessarily recommend this solution but it is an option. You will get some functionality under the 2.0 firmware like power on/off and it will report the firmware version # correctly but anything else will fail with a "Device ID 0000" error.
|MacPKit2 v1.1.7||Resolved a "Check Your Circuit" message when firmware 1.20 is used due to a default pgm voltage level and the fact that the 18J uses a much lower (3.3v) level. The 18J is not supported.||3/09/07|
|MacPKit2 v1.1.5||Fixed a problem that could prevent interrupt handlers from being called due to incorrect starting address. Added enhanced device parms to bypass midrange lookup when working with 18F devices. Fixed a segmentation fault that occured when the .hex file was larger than the input buffer.||9/04/06|
|MacPKit2 v1.1.4||Added support for 16F88 per request. Added "check your circuit" message.||8/18/06|
|MacPKit2 v1.1.3||Added support for 18F452 and 18F4520 per request.||8/12/06|
|MacPKit2 v1.1.2||Modified to accept complete path as argument for file location in lieu of default home directory per request. Modified target power feature so it does not wait for a space bar to be pressed before terminating per request. Note you must now send a "macpkit2 0" command to turn off power.||7/17/06|
|MacPKit2 v1.1.1||Added support for 12F683 and 16F687 per request.||6/29/06|
|MacPKit2 v1.1.0||Added support for 18F2550, a major accomplishment since the algorithm, config register, is a major change on enhanced devices.||6/17/06|
|MacPKit2 v1.0.6||Added support for 16F684 per request.||6/07/06|
|MacPKit2 v1.0.5||Added support for 12F675 per request. Added readme file.||4/15/06|
|MacPKit2 v1.0.4||Added support for 16F877A (note your PicKit must have firmware v1.10 to use this device). Corrected device ID for 16F690.||4/6/06|
|MacPKit2 v1.0.3||Changed to deployment build, tested on OS X.4.5 G4, removed unnecessary frameworks.||3/19/06|
|MacPKit2 v1.0.0||Initial beta release.||1/21/06|
17338 visits since 1/06.