Arduino Logic Analyzer

I've been putting some thought into a cheap logic analyzer using easy to acquire chips (except for the sram) so that anyone with an arduino can put one together. Using HC components this circuit should easily handle 16mhz for arduino analyzing and with AC it could go up to 50mhz.

The basic schematics are here, in block form:

The probe circuits are split into two halves so the clock line can be fed into one half, then inverted and fed into the other to double the sampling rate.

A Mux enables clock selection either from source, arduino or an oscillator. For perfect arduino debugging you could pull the signal from
XTAL1 or 2. This is followed by a trigger circuit stage, which will probably be a simple rising edge trigger with a SR flip flop, but could easily be expanded with a mux to do other triggers (falling, change, bit sequence using an external clock + data line with a shift register + 8-bit comparator).

The XOR can act as a either a buffer or an inverter.

The counters act as an address counter for the SRam. The clock signal and the clock/2 are fed into the control logic. It's basically

  1. Advance counter + latch data 2. Write enabled 3. Nothing 4. Write disabled.
    Easily implemented with a couple of logic chips

The SRam selection is important, I'm looking at the CY7C199 from cypress. It has a 10ns write time from valid address to finished write and is fairly cheap ~$2-4. 36k x 8bit means 64kbit samples for each probe line. For slower SRams you will be limited to a max clock of 500/write time MHz.

17-bits of counting are necessary 1 for the control logic, 15 for the address counter + 1 more to disable the clock once the address overflows.

Each probe input circuit is made up of only 4 chips and is stack-able, which is nice I think. It's limited by the fanout of the selected logic family at high frequencies though. However the circuit is exceedingly cheap, about $6 for parts, and that's per 4 probes.

74AHCT374 is my first choice for the flip-flops, the output enable is necessary to prevent interference when the arduino is reading data and it accepts ttl logic levels and 3.3v cmos. Plus it's nice and fast.

For all other components, if they are in the clock line they need to be able to withstand your max clock, for the arduino control chips (595s for mux selection etc, and 165s for reading the srams) they just need to be arduino compatible.

After both the clocks have been disabled the arduino can then shut off the clock, reset the counters, disable the latches, select output instead of input for the SRams and then increment the address counter, shift in the data and pipe it to the computer. Once it's finished it can reset the circuit, enable to clock etc.

I plan on prototyping this next week so, thoughts? suggestions?

I'm interested, how many traces are you contemplating? Can you see your way to doing 20?

although I have no hands on experience with these devices it sounds very interesting and is something I am looking to add to my tools, keep us well posted :slight_smile:

Will do. Just waiting on the damn sram to start testing. Tomorrow I'll throw a the basic circuit together and check that the control circuit I have in my head is correct.

As far as the number of probes goes, if one circuit works it can easily be scaled, since the hc165's are chainable, the arduino just needs to know the extra data is there

The circuitry works perfectly. The correct control signal is easily produced by using a single NOR gate, fed through a buffer so it can be disabled by the arduino.

One issue I can see is that the control signal will lag the clock and the address counter by the propagation delay of the counter + the NOR + the buffer. The simple solution is to produce the control signal without interfering with the address counters, using a t flipflop to produce clock/2 instead of the first stage of the address counter. Then the control will slightly lag the address counter which will slightly lag the clock, which is perfect.

I've been putting some thought into a cheap logic analyzer using easy to acquire chips (except for the sram) so that anyone with an arduino can put one together.

Have you seen what they've been doing lately on http://DangerousPrototypes.com? They've managed to wedge some minimal logic analyzing into their existing (PIC-based) Bus Pirate board, and now they're working on a cheap dedicated board, all using the free SUMP front end app.

You may want to try the same approach: First, bare-bones software-only Arduino capture; Then, optional performance-boosting add-on hardware. You can even use SUMP, it runs on Java, uses a simple serial protocol, and already has some nice protocol decoding features.