Tag Archives: logic analyzer

Improvising a logic analyzer with an ATtiny2313

Joonas Pihlajamaa wasn’t having much luck debugging his PS/2 keyboard interface. Wishing he had a dedicated logic analyzer, Joonas ultimately decided to combine an ATtiny2313, breadboard and FTDI for unlimited-length logic capturing with a PC.

As the HackADay crew notes, the ATtiny2313-based logic analyzer is capable of capturing at 50+ kHz, more than enough for a PS/2 port.

“The 2313 has eight input ports on one side of the chip, making attaching the right logic line to the right port a cinch. The highs and lows on each logic line are sent to a computer over the FTDI chip, converted into OLS format and piped into Open Sniffer to make some fancy graphs,” explained HackADay’s Brian Benchoff. “Joonas was able to capture PS/2 signals with his logic sniffer, so we’ll call this project a success.”

As previously discussed on Bits & Pieces, Atmel’s high-performance, low-power 8-bit AVR RISC-based ATtiny2313 microcontroller boasts 2KB ISP flash memory, 128B ISP EEPROM, 128B internal SRAM, universal serial interface (USI), full duplex UART and debugWIRE for on-chip debugging.

The ATtiny2313 also supports a throughput of 20 MIPS at 20 MHz, operating between 2.7-5.5 volts. By executing powerful instructions in a single clock cycle, the MCU achieves throughputs approaching 1 MIPS per MHz – neatly balancing power consumption and processing speed.

Interested in learning more about Atmel’s extensive lineup of versatile tinyAVRs? You can check out our complete device breakdown here.

A tiny low-cost logic analyzer

When I was at Maker Faire this year (2013), my friend Phil Sittner came up to the Atmel booth and told me that I had to see something on the other side of the show floor. Phil is the guy that built a $400 network analyzer kit a few years ago. So he takes me over to the Saleae Logic booth. Lo and behold he had managed to find a small, inexpensive logic analyzer housed in a beautiful billet aluminum case.


The Saleae logic analyzer hooked to an Arduino. It’s cross-platform and will display on your Mac, PC, or Linux box.

Saleae makes two versions—the $300 Logic 16 has 16 channels. You can sample two of them at 100MHz, or 4 channels at 50MHz, 8 channels at 25MHz, or all 16 channels at 12.5MHz.  The Logic 16 has an input voltage range of -0.9V to 6V, and works with 1.8V, 2.5V, 3.3V, and 5V systems. The original model, the $150 Logic, has 8 channels that you can sample at 24MHz. Logic accepts voltages from -0.5V to 5.25V, and has standard CMOS thresholds of 0.8V for logic low, 2.0V for logic high.


Nathaniel Lozier handles marketing for Saleae while Jonathan Georgino is the hardware and firmware engineer that made the magic.

Nathaniel and Jonathan were clearly proud of the beautiful job they did with Saleae products. An engineer from Gould Biomation told me designing test equipment is a real challenge since it has to be better than whatever it is testing. He confided that Gould designed to typicals and just swapped boards until they got a machine that met the spec.


You can troubleshoot your Arduino system with a Saleae logic analyzer.

At the Maker Faire booth Nate and Jonathan had the Saleae logic analyzer hooked to an Atmel-based Arduino. Any working engineer can appreciate the tiny footprint of the Saleae Logic analyzer. I remember consulting at Teledyne 15 years ago where we had the classic and expensive HP 16500 mainframe. It was nice because you could stuff a 2GHz scope card in one the slots, but the thing was gigantic. Since it was so big you had to push it way back on a shelf out of the way. That meant you had to reach out and lean to touch the screen or spin the accursed single-knob user interface. Our solution was to get a mouse for it so we could interact with it no matter how far back it was on the bench. Even the pods were big, larger than the entire Saleae Logic 16. As Russell Crowe said in Master and Commander “What a fascinating modern age we live in.”


The Saleae Logic 16 is not just pretty on the outside—the cross-platform user interface is sleek and modern.

Speaking of fascinating and modern—check out a screen shot of the Saleae Logic analyzer. It’s obvious the device can sort through basic logic problems. But Nate told me you can also capture higher-level protocols to help you figure out what is going on in your SPI ports. My consultant buddy John Haggis says any serial port will eat up 6 person-months of time to get working. That is not just hooking up the wires, but getting all the low-level and high-level protocols and error conditions figured out. He was half-joking, but I suspect he is closer to the truth than far from it.


Google’s Eric Schlaepfer, Consolidated Electrical Distributors’ Phil Sittner, and Atmel’s Eric Weddington are all smiles while they check out the Saleae Logic products at Maker Faire 2013.

Nate told me he would send me a Logic 16 to try out. You can bet I will be showing it off to Eric, Phil and my other pals at the next eFlea breakfast. My mechanical engineer pal Dave Ruigh will be especially delighted to scope out the Saleae, since he was the guy that made a billet aluminum Palm case years ago. I hope Nate realizes that my maniac friends will whip out tiny tools and have his beautiful Logic 16 in pieces on the table—that’s what happens when you toss cool hardware at a group of engineers. It’s like raw meat to hungry lions.