keyboard multiplexing

That looks interesting. Thank you.
I will have a look at it.

Anyway, what digital oscilloscope did you use?
Especially with all the snapshots.

It was a logic analyzer, not an oscilloscope. I have a digital oscilloscope but it has a memory for a rather pathetic 2.5K samples. The Logic analyzer can save 10000M samples at a sample rate of up to 24MHz. That's a LOT more.

It also has analyzers for I2C, SPI, Serial, one-wire, and a few others. I have no commercial connections with them (apart from buying one) but I have been happy with it. It runs on Mac, Windows and Linux.

For $US 149 I find it an invaluable aid for debugging SPI/I2C connections. At least you can see whether the problem with your code is whether you are sending the right data, and getting a response, and if so, what you are sending and receiving. Without it you are largely guessing.

I've heard prices quoted for mixed-signal oscilloscopes for something like $10000 for something that will handle that many samples.

If you get a cable with the USB interface built into it, you can avoid buying that (expensive) circuitry over and over again, to lie dormant in many Arduino finished projects.

Once you've done that, you can buy Arduino clones like the RBBB for about $14 inc p&p.

Details of cable, etc: The Arduino: A great, inexpensive, microcontroller systems- ele1psa

At these levels, it would be easy to use two Arduinos for your project... one to "digest" the 10+3 inputs, and forward them to the second one over 5 digital lines... or over 1, if you used a serial link....

thx for the info both of you.

Cheers.

@Nick,

As I am thinking of buying some logic analyzer for my debugging purposes, I have few questions for you.

As you said that the one that you used is only 24Mhz, as we know that the arduino runs on 16Mhz,
If I have arm cortex (leaflabs maples) running on 74Mhz, can this logic analyzer be used?

For my case, any logic analyzer that you can recommend?

Thank you.

The problem with a logic analyser is that it has to run many times faster that the circuit it is analysing in order for it to be any good. If it only runs at twice the speed then that is a 50% timing error in any signal it captures. I would go for at least 10 times the operating frequency of the system you want to measure.

Well I have been very happy with the Saleae Logic analyzer (link above). I know about sample rates, but you don't need to sample the processor directly, you need to sample the output of the processor. For every test I have done with the Arduino (including clocking out SPI by the hardware) it has easily kept up. For example, this quick test:

void setup ()
{
  pinMode (8, OUTPUT);
}

void loop ()
{
  digitalWrite (8, HIGH);
  digitalWrite (8, LOW);
}

You can't output pin level changes much faster than that (well, see below) but it captured that with samples about 100 apart (the pulses were about 4 microseconds each). So that is easily twice the rate of the changes.

In fact, the fastest I have seen it clock stuff out is the SPI clock, which (under hardware control) runs at about 125 ns per clock pulse. Capturing that I get a pulse on every 3rd sample, so it is just keeping up. In fact if my arithmetic is right, a 24 MHz frequency means sampling every 42 ns, which sounds about right for those results.

So my point is that, for the Arduino, this device can keep up with SPI clocks, and certainly pulses clocked out under software control. So for debugging SPI/I2C/async serial, it has been fine.

The Atmega328 runs at 8 Mhz doesn't it? So that is easily in range. The 74 MHz processor might be a challenge, I agree with Mike that you need the analyzer to run faster than what you are trying to measure or you get false readings. But again, it depends a bit on how fast the processor actually outputs the data you are trying to measure. For one thing, it depends on how many clock cycles it takes to execute an instruction.

And I should point out that I was trying to analyze USB logic. High-speed USB was just too fast for this particular unit. Low-speed it just kept up. In low-speed USB the pulses are 666 ns, so it was able to sample them. However having said that I wouldn't really recommend trying to understand USB with one of these, it is just too complex. A proper USB analyzer would be more efficient.

"The Atmega328 runs at 8 Mhz doesn't it? " The 3.3V versions do, 5V is at 16MHz. Perhaps you meant a different part?

I meant that part, at 5V. I was wrong. The datasheet isn't the easiest thing in the world to quickly get a summary from. Anyway, that pretty much supports the observed behaviour of clocking out SPI pulses. At 16 MHz one clock would be 62.5 ns, so if I observed the SPI clock rate to be 125 ns, that would mean it clocks out every 2 CPU clock pulses.

It is certainly believable that the SPI hardware needs 2 CPU clock cycles to "do its thing" of setting up data on the data pin, and then clocking it out. Perhaps one cycle to get the data from memory, and the second cycle to set up the SPI pins.

So, does it mean that if I want to test the 74Mhz, I would require about analyzer that can read 350Mhz++ ?

I have searched some and found this http://www.pctestinstruments.com/ - 500 Mhz.
What do you think?

I would like to ask, would it still can read the data if I use the salae, and checking the 74Mhz?
I don't need the actual speed, only to debug certain period. (e.g: when switch is on, delay and etc)

Anyway, have you guys found any logic analyzer that has an extra of analog signal reading as well?
Or do I need an oscilloscope?

Man, that looks like a nice one.

I didn't read all the specs, if it has a way to define an external trigger to set off a digital scope to capture a brief 'glitch' event also that would be awesome.

He is talking about the LA1034 LogicPort which provides 34 channels sampled at 500MHz. Ah, how do I respond? I haven't got that one so I can't say for sure. I would suggest Google "compare LA1034 Saleae". You see some interesting comments.

One point of difference, raised in one of those posts, is that the Saleae Logic samples at 24 Mhz for a simple reason - so it can stream the samples via USB to your PC (or Mac, in my case). Now the faster analyzers have to keep the samples in internal memory, which in the case of the LA1034 is 2K (per channel). Now admittedly they use compression (ie. noting changes, not just every sample) but if you have at least one channel that is "clocking" (eg. an SPI clock) then the compression won't do much, and you run out of samples after 2K.

By comparison, the Saleae Logic can stream 10000M samples (ie. 10G samples) to your PC. That's a lot. And it means you can set a trigger on something early (like, turning the gadget on), and look for things which happend 10G samples later.

If you want to see what I have done with the Saleae Logic device, check out my posts here:

Most of them have screen captures from the Logic. Things like switch bounces are clearly visible. You can see the SPI clock. And as I said before I could follow low-speed USB. Now high-speed USB is too fast, but then, 2K samples is not enough for high-speed USB (for any serious analysis), so the faster unit wouldn't be much of a help.

That raises another point, the Saleae Logic runs on Mac and Windows (and Linux I believe). So if you are a Mac user that might influence you.

Anyway, have you guys found any logic analyzer that has an extra of analog signal reading as well?
Or do I need an oscilloscope?

It's called a mixed-signal scope, and I would love to have one. :wink: In fact, I have a Bitscope which does that:

http://www.bitscope.com/

However personally I just find the Logic really easy to use. It is small, it just sits on the disk virtually unnoticed. The software is pretty easy to use. It does the job.

But, don't take my word for it. Try Googling "compare logic analyzer" and see what other people think.

The other thing that the Logic analyzer does is let you set triggers. You can choose one channel (eg. SPI SS) to be the trigger on a raising or falling signal. Plus other channels can be and'ed in with the requirement that it is high or low. So you might trigger on channel 1 falling if channel 2 is high and channel 3 is low.

When I was testing keypresses I just put a trigger on the button itself. And bearing in mind that it has a memory, I can see what happened before the trigger.

"If I have arm cortex (leaflabs maples) running on 74Mhz, can this logic analyzer be used?"
Sampling at only a third of the speed tho doesn't help much even if one can store a lot of data.
Just need to be careful about setting up the trigger point you want to start from.

If you're trying to look a long string of serial data going back & forth, then a protocol analyzer is really the way to go.

Looks good.
Gammon Forum : Electronics : Microprocessors : Connecting a graphical LCD via a I2C/SPI using a 16-bit port expander What software did you used to draw the circuit? (with lcd etc)

Anyway, now I am confused with which one to go. =)
For the bitscope, it also can work as the logic analyzer? Isn't it?
Tell me if I am wrong, as it stated 'n logic'

I am willing to spend $500-900, I would like to have both application. (if possible, the logic,and analog).
How about DSO? (digital signal oscillator?)

Any suggestion/comparison to those analog/ logic kit?

I am looking at http://www.rigolna.com/products/digital-oscilloscopes/ds1000d/ for the digital oscillator. It has both analog and digital channels, Bandwidth 100Mhz.

What do you guys think? (sorry for asking many question, as quite new with this oscilloscope things.)

Protocol analyzer? that looks like a new thing to look on.
But as for now, I will start from a basic monitoring/ analyzing first.

Might comes in handy if going to experiment the wireless data streaming, packet send/receive.
Thanks for the info anyway. :wink:

aminbahar:
What software did you used to draw the circuit? (with lcd etc)

Photoshop lol. Have to lift my game there.

As for the Rigol, yes it looks tempting. Still I notice the memory depth in "common" mode (whatever that is) is only 8K. I have a scope which has a memory depth of 2.5K. And really, the low memory depth is what makes it fairly useless for analyzing logic.

If you want to spend more than around $150 I would take a look at the EEVblog review of the new Agilent 2000 series...

(edit) I didn't really mean to have the show appear in the forum posting - I just posted a link. The forum turned it into an imbedded video.

His other stuff (most of which is very interesting is here):

http://www.eevblog.com/

Dave Jones' basic point is that the new Agilent series are priced very competitively indeed, especially for a "top" brand (rather than a clone). These scopes have a big memory depth, and a mixed-scope option.

I have to admit the sky is really the limit with scopes, and you can spend $10000+ for one with lots of features.

But a word of warning - my digital scope, which was really quite expensive, is useless for analyzing things like SPI because of the memory size. When it only captures 2500 points, hey, that time might elapse while the switch is debouncing! And remember, the higher the speed, the faster those points get gobbled up! Say you are sampling at 50 Mhz. Right, after only one second, you need memory to save 50M points, right? So if you can only capture 8K points, well that is a tiny fraction of a second.

But the good thing that is coming out of this is that you are thinking of the right questions to ask. The right answers is for you to decide, but at least you know what to look for.

Photoshop? hehe. Anyway, it looks good. Wonder if you use any software which can drag and drop like fritzing =p

I think agilent is too expensive for me, and especially for a new starter like me.

My short list would be rigol mixed channel, 100 Mhz: $1000+ , and bitscope.

Anyway, before I made the decision, how's the bitscope?
Do you purchased the network, or usb type? Is it reliable and does it have external interrupt?

Nice video.