Go Down

Topic: Logic sniffer shield (Read 2 times) previous topic - next topic

Graynomad

Further to some discussions on another thread re sniffing data on an SPI line I got the brilliant idea to use SPI serial RAM chips to do the actual data collection.

As many (all?) these chips have a "sequential" mode whereby bytes are sequentially written to consecutive locations the idea is to let them do the work then read and upload the results using the host Arduino.

Now for $30 you can buy a Bus Pirate so I'm not sure it's worth the effort, OTOH this could also be a 20MHz logic analyser as well and the number of threads I see here with issues that would be solved in 2 minutes if the data could be seen is huge. 

Block diagram below.

Any thoughts from the collective?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

#1
Sep 05, 2011, 08:41 am Last Edit: Sep 05, 2011, 08:53 am by CrossRoads Reason: 1
Need chip selects.
Control concept needs more detail - how differentiate between

register address, read/write, data,
and
start address, read/write, data
or
start address, more address, read/write, data, data, data, data?

Can be made to look like a FIFO. FIFO on the other hand, just catch all writes, read them all back, let the software determine if what went out is what was intended.

Or is that what you were thinking? Just capture everything as bytes, no interpration, and read it back? (Sorry Rob, it's kinda late here)
In which case, just need the chip selects.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

I just gave the data sheet for the 23A256 a quick look over.

It seems that you can send a control byte or two to set the address etc. and put it into sequential mode. Thereafter every 8 clock pulses stores a byte until you stop.

You're right about the FIFO though, it's probably a better choice. At 50MHz you don't need all that shift reg stuff in the design on the other thread I would think, just use it as a 9-ch analyser.

I just had a look at the price for an IDT7208, $30-40, yikes! Still you only need one. The 23A256 is $2 and for the same bit width you need 9 of them, OTOH 4 bits is probably enough.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

With the FIFO you will have to start reading at the same rate as writing once the chip is full if you want to have a "stop on trigger" mode.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Yeah, the big ones are kinda pricey. I only ordered four 4Kx9 (as 28 pin DIPs, wirewrap to start). Build up a bidirectional 4K x 16 to start, see how it goes.

Hadn't thought about how to tell it to start/stop yet. Was only thinking capture whatever came out to start.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

Like all these logic analyser style projects when you start adding real useful stuff like triggers, start on trigger, stop on trigger, trigger in center of data etc it gets much harder.

One problem with SPI is getting synced with the data, one bit out and it's all garbage.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

#6
Sep 05, 2011, 09:37 am Last Edit: Sep 05, 2011, 09:45 am by CrossRoads Reason: 1
For syncing, I would think that as long as you use the SS to clear things & only clock on SCK after SS goes valid, it would go pretty smooth.
Unless you get a clock glitch somewhere, then garbage after that for sure.

Adding a data compare to capture after a specific value could be handy, or maybe a double like that (for say a 16 bit address). Or something external to allow trigging to start, like your Pulse code.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

#7
Sep 05, 2011, 10:36 am Last Edit: Sep 05, 2011, 10:46 am by Graynomad Reason: 1
He he, check this out

http://dangerousprototypes.com/docs/Logic_Shrimp_design_overview

I guess I'll go back to what I was doing :)

Although it's not an Arduino shield and I can see room for some extra features.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Nick Gammon

Interesting concept. Bear in mind SS can go low for quite a while, so syncing might still be a problem.

One of the selling points of the Saleae (bah, I always have to check how that is spelt) is that it can handle massive sample sizes because it uploads them via "bulk USB" protocol (I don't remember it exactly), I think with some sort of data compression. That is, most times the samples are going to be the same, especially at high sample speeds.

Now consider that even using 23A256 chips (256 K bit, that is 32 K bytes) sampling at 20 MHz, you are going to fill up the chip in 1.6 mS, assuming you are sampling 8 channels. Data compression would help a lot (that is, don't record consecutive bytes that are the same) but that requires extra logic, some sort of "smarts" like a CPU can give you.

For that matter, the "SPI sniffer" code I gave in the other thread would run out of RAM really quickly (after all, the Atmega328 only has 2Kb).

For sniffing something highly specific, where you have a nice trigger you can rely on, this could work really well - or even just the Arduino capturing a short burst a 4 MHz.

For more generic debugging, you probably want one of the established logic analyzers.

One other idea is to use a CPLD - something like this:

http://majolsurf.net/wordpress/?page_id=1302

That is fairly cheap, and you could use that to capture SPI and dump to an SRAM chip.

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Graynomad

Quote
I always have to check how that is spelt

Me too, I usually launch the program and look at the title bar :)

Quote
you are going to fill up the chip in 1.6 mS

Yes, I did the maths also, that's not a very long time. OTOH using an external clock for SPI it's a huge amount of data.

Quote
can handle massive sample sizes because it uploads them via "bulk USB"

True, and many is the time I have a high-speed burst of data separated by a long period.

That CPLD board looks interesting. I was an early adopter of PLDs back on the 80s but have got well out of touch. In those days I had to spend a few days down in Sydney working on the Altera CAD system in their offices. Now you can do it at home for $20. Unbelievable.

I guess you could add run length encoding, but that would probably double the hardware needed. Maybe I should look at that CPLD board again.

I know it's been done before and as I just pointed out in almost exactly the same way, but it's such a fun project maybe it's worth doing anyway.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Nick,
I have a counter that creates a Write pulse to the FIFO every 8 SPI clocks to keep in sync.

Sure seems like plenty of hardware options are available, many with the corresponding PC software.

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

I think creating a modern-looking GUI that's easy to distribute might actually be the hard part.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Yes, and that is certainly not my forte!
I'm thinking to start just capture the data, review manually, or write a script to compare to what I expect to see.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

#13
Sep 05, 2011, 07:30 pm Last Edit: Sep 05, 2011, 07:36 pm by Graynomad Reason: 1
I've done a lot of  app/GUI  programming in VB6 and some in VB.NET so I could probably knock up a reasonable UI. .NET apps used to be a real pain to distribute but I think that's all changed. Trouble is all that is Windows only.

Probably a simple dumb terminal prog might be the easiest way to start off.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Guess I better get a board layed out & start wirewrapping then.
Just got back from more taping & painting.  I am sore! Going back in a few hours for 2nd coats.
The kids can have fun tomorrow peeling the tape off the floor!
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up