zunzun
Posts: 3
Joined: Thu Jan 23, 2014 3:30 pm

New how-to A/D chip oscope and spectrum analyzer

Thu Jan 30, 2014 5:32 pm

I have written a how-to for creating an oscilloscope and spectrum analyzer using a Pi and a cheap MCP3002 or MCP3202 A/D converter chip.

URL is http://zunzun.com/downloads/scope.html

with photos and screen shots.

Please contact me by email if you have any questions.

James Phillips
zunzun@zunzun.com

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: New how-to A/D chip oscope and spectrum analyzer

Sat Feb 01, 2014 7:25 pm

What sort of sample rate does the oscilloscope give?

I have not looked closely but seems its running on spi so i assume is less than MHz.

I was thinking about making a cheap oscilloscope but did not bother looking too deep yet as there seem too many problems.

One of the main problems seems to me the gpio layout, as there are not any contiguous gpio bits that would make simple translation of adc bits (If only there was gpio26 brought out onto the headers then could have a 10 bit data shift in?)

I started looking at panalyser which seems to give 20MHz sample rate using dma, and if there were 8 contiguous bits on gpio could attach a high freq adc (ADC08060CIMT for about £3) for a very cheap oscilloscope.

I also remember some post from a chinese developer suggesting there was work being done on a 60MHz addon board which would retail for around $100.

With the work being done on videocore fft and vector math could allow something fast and good real soon?

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: New how-to A/D chip oscope and spectrum analyzer

Sat Feb 01, 2014 7:57 pm

mung wrote:What sort of sample rate does the oscilloscope give?

I have not looked closely but seems its running on spi so i assume is less than MHz.

I was thinking about making a cheap oscilloscope but did not bother looking too deep yet as there seem too many problems.

One of the main problems seems to me the gpio layout, as there are not any contiguous gpio bits that would make simple translation of adc bits (If only there was gpio26 brought out onto the headers then could have a 10 bit data shift in?)

I started looking at panalyser which seems to give 20MHz sample rate using dma, and if there were 8 contiguous bits on gpio could attach a high freq adc (ADC08060CIMT for about £3) for a very cheap oscilloscope.

I also remember some post from a chinese developer suggesting there was work being done on a 60MHz addon board which would retail for around $100.

With the work being done on videocore fft and vector math could allow something fast and good real soon?
I thought Panalyzer sampled at 1MHz not 20MHz.

Given that you can read 32 gpios in the same time it takes to read 1 I don't see why you're worried about contiguous bits. Just grab the data and reorder the bits later.

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: New how-to A/D chip oscope and spectrum analyzer

Sat Feb 01, 2014 10:15 pm

joan wrote: I thought Panalyzer sampled at 1MHz not 20MHz.

Given that you can read 32 gpios in the same time it takes to read 1 I don't see why you're worried about contiguous bits. Just grab the data and reorder the bits later.
I have no real idea how fast panalyser samples, I never actually used it only skimmed a thread about it a few months ago I think maybe I am talking about this post:
http://www.raspberrypi.org/forum/viewto ... 4&#p120014

I think that says about 20MHz is theoretical maximum for dma reads of gpio(maybe I misinterpret?)

Now I assume you are being facetious and just want to have a discussion saying something nonsensical just to spur some banter?

Do you really want me to explain?.

Considering I know nothing about how an arm processor or the videocore works so I am probably wrong, how many instruction cycles does it take to mask and shift n bits from random positions into a set order as opposed to shifting a register of bits already in the correct order x bits?

I dunno if it would be done by the arm or the vc and does the vc have vector operations for reordering bits?

I think it depends on how it is to be used, data storage is not infinite and sometimes you may want to process the data, scanning for a particular signal or error, reordering bits will cut down available processing capacity.

Most things are so complicated its not possible to quickly describe them in a simple forum thread, I sort of think I know most of what I am talking about, but don't expect me to spend too much time describing every minutia for something that I am just making idle enquiry about.

If the item the original post in this thread mentions samples at 1MHz then its worth looking at for my purposes (the original query I made), I suppose my other comments were irrelevant other than passing thoughts that may encourage or spur others to try developing something I would be interested in.

Is speed and efficiency not particularly important for oscilloscopes, its not something I know much about, as I said this is just an idle passing interest.

What is your experience on panalyser joan, does it work well, would it be suitable for scanning i2c or spi data, or high frequency pwm?

User avatar
joan
Posts: 14959
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: New how-to A/D chip oscope and spectrum analyzer

Sat Feb 01, 2014 10:40 pm

I'm simply pointing out that Panalyzer samples at 1MHz according to https://github.com/richardghirst/Panalyzer and that although the data capture is real-time the visualization is a separate post-processed operation.

Given that the data is post-processed you have all the time in the world to rearrange gpio bits in any configuration you want.

Return to “Automation, sensing and robotics”