GARTHWILSON wrote:
Small correction there: The LM339 is a quad, open-collector comparator, not an op amp. It's not very fast as comparators go, but it's quite a lot faster than the LM324 op amp. Op amps don't do very well as comparators because they're designed to stay in the linear region and it takes them longer to come out of saturation after the output has gone as positive or negative as it can.
Oh, that just made things a boatload more clear! I'd not really understood that comparators are not exactly op-amps. (They sure look the same on schematics, until you read the text. :-))
I'd also not considered the speed, though I'm guessing that's probably not an issue for an LED display that humans will be observing. But I also guess that could certainly could be an issue for a logic analyzer running at typical microprocessor speeds.
Within a few weeks the the major problem I have with the LM339 should be solved (i.e., that I don't have any. :-)). It seems cheap enough: under a buck for ten in DIP-14 packages. (Sadly, it has a different pinout so I can't just pull the 324s from my board and plug in 339s.) I also poked around a bit and found some
interesting application notes giving all sorts of uses for this quad comparator. But would it be fast enough to run a bus analyzer at 1-2 MHz?
And also, after a bit more reading I see that these have open-collector outputs, which I'd never heard of on an op-amp and I'm still kinda trying to wrap my head around. This means that bus pullups will be necessary, and the speed will be limited by those as well, right? Obviously that's not an issue in my LED design, where the comparators' job is just to bring the LED cathode low, but would be if connected to, say, a shift register. It's kinda feeling like a different part might be wanted when building a logic analyzer.
Chromatix wrote:
One could even go a step further here, and test against three voltage thresholds: TTL/CMOS low, TTL high, and CMOS high.
These could be processed into a 2-bit code, synchronised with a clock and trigger, and recorded into a sample buffer, which is the essence of a logic analyser, but with some basic analogue-domain information included.
My design already has the ability to change the two voltage thresholds being used; plop in the appropriate resistors into the sockets, calibrate using the test points on the right and then you should just be able to flip a couple of (well, four) switches and now you're using CMOS instead of TTL thresholds.
So are you suggesting doing both TTL and CMOS high just because there's an extra value available in what one's recording anyway (i.e., because we have to use two bits to record three values, so might as well record four)? That's no problem on the recording side, but seems it would require adding a whole 'nother set of comparators, increasing cost and complexity. If I'm going to add more comparators, I'd personally rather use them to add more inputs.
Quote:
If the thresholds can be adjusted by hand, this can also be made useful in an LVCMOS context.
My thresholds are developed via voltage dividers using VCC, so one can just change Vcc and and work with whatever levels you like, within reason. I think the current op-amps are spec'd to work between 3.0 V and 12 V. And if you replace the LEDs with a typical AVR MCU, that should run fine at 3 .3 V as well (so long as you're not clocking it above 8 Mhz), so no issues there.
__________________________________________________________
So, I guess my main question here is, does it make sense to build a logic analyzer this way? Will the comparators provide significantly higher impedence inputs than going directly into an AVR MCU, and is that really helpful? Is this sort of threshold detection really going to be useful in practice, or am I just a nervous Nellie?