Using The Parallel Port As A Logic Sniffer

[Fernando] wrote in to share his take on building a logic analyzer. He’s using the parallel port to capture data and feed it to the display software of your choice.

The method depends on a custom kernel which alters the way the parallel port works. The kernel he compiled includes a method of intercepting the signals coming in from the hardware, passing that data to the /dev/parport* as it should, but also sending a copy to /dev/parportsnif*. It also creates a log file which is in the OpenBench Logic Sniffer format for easy use with various display software.

Of course this is easiest to use with a Linux system, but can also be run as a virtual machine under Windows. We’d plan on using a virtual machine within Linux as well since this is a custom kernel and will probably only see occasional use.

26 thoughts on “Using The Parallel Port As A Logic Sniffer

  1. – Very nice, I vote parallel ports get brought back. Jeez, my last build I found the hard way many MB’s don’t even have an IDE bus anymore so I could use a dvd drive I had laying around…

  2. Perhaps a link for the under 20’s as to what a parallel port is might be appropriate.

    Yes I’m saying no computer has those anymore, and in fact unfortunately not even serial ports :/ but damn floppy ports live on though.. so we need hacks to do something with those since currently they are not in use.

    1. Good luck getting access to the parallel port in a modern windows OS (Windows freaks out if you try to read/write from arbitrary IO ports…)

      V-USB and an AVR chip on the other hand will have you up and running pretty damn quickly.

  3. There is no explanation why the Author is removing the existing LP kernal support and using his kernel module. Sounds like a lot of trouble. Why not just use the existing parallel port support?

    1. “It also creates a log file which is in the OpenBench Logic Sniffer format for easy use with various display software”

      Not sure why you couldn’t just write code that watches the port and creates the log file, though.

    2. Well, this is actually a parallel port sniffer, to see what programs do with the parallel port. In fact I was able to analyze a BlueLab program that uses the parallel port to program a bluetooth chip with this kernel module. I didn’t think of it as a logic analyzer as hackaday suggest, but I guess it will work. To use it as an analyzer, you would need to make a small program that keeps reading the parallel port in a loop, and then use any of the data pins.

      1. Oh, weird, yeah I thought HaD was implying something completely different. So this is like Wireshark for your LPT port? O.o Just plain bizarre, especially on a platform that runs mostly OSS.

    3. I’d assumed it was because Linux is not (by default) an RTOS, and you’d want to keep the OS from messing up your timing; in which case this would be pretty cool, just pop the module in, instead of having to recompile your entire kernel (as some CNC software makes you do).

      However, Fernando hit it on the head, methinks.

  4. A very old project like this was to use an 8-bit ADC and read the data thru the LPT port, giving you a way to log analogue data (battery voltages etc).

    An even older project sent the data as 2 sets of 4 bits (via the status lines) as the data lines were output only.

    The parallel port has survived for a surprisingly long time. If your motherboard doesn’t have the connector it may have a header for it on there somewhere, you’ll need to find the cable for it.

    1. You really need an RTOS if you want to do any kind of analog data logging with the parallel port — and even then you’re only going to get 5 bits of precision — since the parallel port only has 5-input bits.

  5. I did this project many years ago, first useing QBasic, Remember that? the i went on to make a graphical version with Borland Visual C++, fine till you get to winXP, no special hacks, just used portIO for winXP to open the ports up, I still use a Compaq evo N6000c for deving from time to time, it has just abou every hardware port you could want

  6. How timely :) I was just browsing some parallel port tricks last week and getting all inspired. Found a lil dell craptop P3 700Mhz that is all linuxed out and ready to play. Love the old stuff :)

Leave a Reply to FernandoCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.