# Using Pickit3 as a logic analyzer

I need to sniff some legacy SPI hardware and at hand have a Pickit3 and lots of PIC18F2550/4550.

While there is no project out there that builds a logic analyzer out of a PIC18F2550/4550 (I will be glad if you suggested one), I can see that using the PICkit3 scripting tool (PICkit3_GUI_scripting_v03.00beta) it could be possible to run the PK2 logic analyzer feature on the PK3.

Unfortunately, Microchip does not seem to have taken that software forward, nor do I see anyone writing about it.

My questions:

1. has anyone actually used the PICkit3 scripting tool (and specifically the logic analyzer feature)?
2. are there any "good" DIY logic analyzer projects out there that use the PIC18F2455/2550/4455/4550 family?

It might be easier to just buy a logic analyzer. There's a company called Saleae that makes an inexpensive one called the Logic.

• Have you used this yourself? What's the max freq. it can handle without aliasing? Does it have an easy way to write protocol decoders, or does it have some built in? – sekharan Apr 12 '13 at 6:44
• I use it myself. It has built in protocol decoders for things like i2c, spi, etc. I'm not sure about maximum frequencies you would need to check their website. – mjh2007 Apr 12 '13 at 13:54
• There are also much cheaper clones of these Logic analyzers, they are available e.g. on eBay. Just ordered one of these for $7 (vs$100 for the simplest of original devices); according to reviews it should work with the same software. – MarSoft Jul 25 '16 at 16:41

I have a PicKit2 and have used the LA feature, but I'm not sure about the PicKit3 - I'd be surprised if they haven't ported this functionality by now as I recall many complaints initially, but if you have not found anything it's possible they didn't. I would ask over on Microchip forums to see if there has been any progress. I found this thread, there may be more.

As far as a PIC based LA goes, there are many projects out there, and if they are not for the specific PICs you have it's easy enough to port the code if it's in C (this is one of the benefits of using C). It makes for good learning if you have not done such a thing before - as many times you will not find the code for your exact part, this is a common requirement with firmware. In some cases, such as if you use the same compiler and part from the same family, code will port with no changes at all. Others will require a bit more work.
I would take a look at a couple of 16F or 18F based projects and start from there. Here are a couple with PC sftware that look suitable:

1. I havent.
2. Not that I know of.

However, it would be easy to make one. The idea you are talking about would be extremely simple to bread board. All that you would need to do is hook up the SPI lines to the pic, and then create a small program to read in the data. From there you can either, output it over any number of serial protocols to get it to the computer, or simply use the debugger, and break at the points where you want to view the data.

• It's SPI like but not strictly SPI – sekharan Apr 12 '13 at 6:44

I haven't tried one yet but a Bus Pirate could be what you need. By Dangerous Prototypes: http://www.seeedstudio.com/depot/bus-pirate-v3-assembled-p-609.html?cPath=61_68

I'm going to get myself one at some point.