BeagleLogic: A BeagleBone Based 14-channel 100Msps Logic Analyzer
This is really neat. but it isn&#x27;t a logic analyzer. I realize that is more than a bit pedantic but let me explain.<p>The feature this provides is really a binary oscilloscope. One picks a sample rate, and perhaps a trigger pattern and then once you get triggered you copy the state of the binary bits into memory at the pre-determined rate.<p>What you get is samples of the pins across a period of time, and you have no idea really what the state was of the pins when you &quot;weren&#x27;t looking&quot;. Which is to say between samples.<p>Logic analyzers actually work a bit differently. A logic analyzer is sensitive to the <i>transition</i> of the bit regardless of when it happens. Time is the <i>dependent</i> variable, rather than the <i>independent</i> variable.<p>The reason analyzers work that way is because digital logic is very sensitive to clock <i>edges</i>. That is when the magic happens, falling clocks, rising clocks, either way stuff happens relative to the clock edge.<p>One of the more common problems in logic is a propagation delay causing spurious outputs. Think of it this way, lets say changes in signal A and signal B are racing toward an exclusive OR gate. The change is said to be propagating through the logic. And lets say the change has both signal A and signal B set to the same value, but it opposite their current value. If signal A arrives at its place at the gate 5 ns before signal B does, then when it arrives, the gate output will change from &#x27;0&#x27; to a &#x27;1&#x27; state, and then when B catches up 5ns later, it will change back to 0. Logic down stream of the gate will see a 5ns &quot;pulse&quot;, the output will go high, and then low again 5ns later. This is a &quot;propagation glitch&quot;.<p>If you sample these pins, once every 10ns, you have a good chance of seeing exactly what you expect, the pins are one state, the output is 0, the pins are a different state, the output is still zero.<p>However if you have a free running clock and you capture exactly the time the pins change and you see that the output actually changes twice before your sample period is over. You might imagine an implementation of this as some number of input capture pins each sharing the same 32 bit nanosecond scale clock running. When ever the pin changes you copy the clock value into memory. If the pins don&#x27;t change you don&#x27;t copy anything, and every 4 seconds you push a marker (clock overflow for a nanosecond clock). You read back all of that data, a series of time stamps for the pin changes, and you can line them all up on the display and verify things like setup and hold times, worst case propagation delays, signal skew across different length traces. All the things that help you analyze how the logic is working.<p>That isn&#x27;t to say that a &quot;binary&quot; oscilloscope isn&#x27;t useful, it very much is. But you have to understand what you can&#x27;t see in order to know where your blind spots are. My manager at Intel way back in the day always had an oscilloscope run at 16x the speed of the fastest clock to minimize this effect. And Tektronix made a very expensive instrument called the DAS9000 to try to catch these sorts of glitches in the wild.<p>So whenever you are sampling the signal, rather than capturing the signal, try to keep in mind what is happening when the sampler isn&#x27;t looking. :-)