Author Topic: Microcontroller oscilloscope project  (Read 5975 times)

0 Members and 1 Guest are viewing this topic.

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 123
Microcontroller oscilloscope project
« on: June 08, 2018, 01:07:30 am »
Hi,
Can I build or simulate an oscilloscope of high range response 100Mhz or more with microcontroller like Atmega or other?
Regards
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #1 on: June 08, 2018, 01:52:14 am »
What do you mean by "response"? The analog bandwidth? Then you would need a multiple of it as the sample frequency. Forget Atmel, it can do maybe 1 MHz, because the internal ADC is not that fast and the CPU itself is not fast. You could do it with a Parallella board, as I did for my logic analyzer:

http://www.frank-buss.de/parallella/sampler/

or a Beagle Bone, which also achieves 100 MSps:

https://github.com/abhishek-kakkar/BeagleLogic/wiki

and then using a fast external ADC chip.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: NiHaoMike

Offline yalectTopic starter

  • Regular Contributor
  • *
  • Posts: 123
Re: Microcontroller oscilloscope project
« Reply #2 on: June 08, 2018, 06:27:35 am »
I mean by response the range of frequency that the oscilloscope can work on maybe there is some fast simple usb oscilloscope
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #3 on: June 08, 2018, 07:35:01 am »
Yes, there are USB microscopes with 100 MHz bandwidth. But if you want something decent, I would recommend a real oscilloscope. Entry level Siglent scopes are not that expensive, e.g. you can get a Siglent SDS1102CML for EUR 333, which has 100 MHz analog bandwidth, and 1 Gsps samplerate.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline David Chamberlain

  • Regular Contributor
  • *
  • Posts: 249
Re: Microcontroller oscilloscope project
« Reply #4 on: June 08, 2018, 08:08:51 am »
Yes, there are USB microscopes with 100 MHz bandwidth.

Last one i brought had a bandwidth of 700THz, not too shabby ;)
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: de
Re: Microcontroller oscilloscope project
« Reply #5 on: June 08, 2018, 09:01:21 am »
Hi,
Can I build or simulate an oscilloscope of high range response 100Mhz or more with microcontroller like Atmega or other?
Regards

What do you mean by "simulating" an oscilloscope?
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #6 on: June 08, 2018, 09:38:12 am »
Last one i brought had a bandwidth of 700THz, not too shabby ;)

Do you have alien technology? 700 THz is the wavelength of purple light :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: de
Re: Microcontroller oscilloscope project
« Reply #7 on: June 08, 2018, 09:48:57 am »
Last one i brought had a bandwidth of 700THz, not too shabby ;)

Do you have alien technology? 700 THz is the wavelength of purple light :)

Which seems entirely plausible for "USB microscopes", which you started talking about.  ;)
 
The following users thanked this post: ajb, Ian.M, sokoloff

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #8 on: June 08, 2018, 09:56:49 am »
Oops  :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: David Chamberlain

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Microcontroller oscilloscope project
« Reply #9 on: June 08, 2018, 10:13:22 am »
Last one i brought had a bandwidth of 700THz, not too shabby ;)

Do you have alien technology? 700 THz is the wavelength of purple light :)

Which seems entirely plausible for "USB microscopes", which you started talking about.  ;)
Actually, the visible spectrum bandwidth is only about 340 THz, (due to its lower limit of deep red at about 430 THz)  but what's a factor of two between friends?   8)  :horse:

(see https://en.wikipedia.org/wiki/Visible_spectrum )
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: de
Re: Microcontroller oscilloscope project
« Reply #10 on: June 08, 2018, 10:17:40 am »
Actually, the visible spectrum bandwidth is only about 340 THz, (due to its lower limit of deep red at about 430 THz)  but what's a factor of two between friends?   8)  :horse:

(see https://en.wikipedia.org/wiki/Visible_spectrum )

Maybe you could switch your microscope input to DC Coupling?  ::)
 

Offline David Chamberlain

  • Regular Contributor
  • *
  • Posts: 249
Re: Microcontroller oscilloscope project
« Reply #11 on: June 08, 2018, 10:20:47 am »
Actually, the visible spectrum bandwidth is only about 340 THz, (due to its lower limit of deep red at about 430 THz)  but what's a factor of two between friends?   8)  :horse:

(see https://en.wikipedia.org/wiki/Visible_spectrum )

Hey I'm not just going to take an eyeball measurement of the electromagnetic spectrum, anyway I'm well overdue for glasses. Were talking about man made instrumentation here :)
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Microcontroller oscilloscope project
« Reply #12 on: June 08, 2018, 10:46:19 am »
Well we are both making the assumption that the camera in a USB microscope will be a colour one  optimised for visible light, so its bandwidth limits will be set by the RGB filters used on the sensor.  ;)

However this isn't any help to the O.P.

A 100MHz bandwidth implies a 200MHz minimum sample rate, and that's difficult and expensive to do, even if you have fast parallel ADCs sampling direct to fast RAM and a FPGA to provide the sampling clock and manage the RAM's address and control busses.   Forget about doing it in a MCU unless it can do I/O port to RAM DMA at better than 200MHz.  Also a MCU's limited on-chip RAM is likely to limit the maximum  sample memory depth.

Its highly probable that you could put 100 times the price of an entry level 100MHz bandwidth DSO with save to USB storage, and several man years of work into developing your own USB scope platform and *STILL* have inferior performance and capabilities compared to that DSO.
 
The following users thanked this post: ebastler

Offline David Chamberlain

  • Regular Contributor
  • *
  • Posts: 249
Re: Microcontroller oscilloscope project
« Reply #13 on: June 08, 2018, 10:58:34 am »
Yes back on topic.

I would recommend OP have a look at the scopefun design as a basic reference, will at least give an idea of whats involved. It's a pretty minimal design.
http://www.scopefun.com/hardware

Or for video pleasure, daves teardown of a Uni-T


Or a low end (from The Signal Path perspective)


 
The following users thanked this post: ebastler

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #14 on: June 08, 2018, 11:04:07 am »
Last one i brought had a bandwidth of 700THz, not too shabby ;)

Do you have alien technology? 700 THz is the wavelength of purple light :)

Which seems entirely plausible for "USB microscopes", which you started talking about.  ;)
Actually, the visible spectrum bandwidth is only about 340 THz, (due to its lower limit of deep red at about 430 THz)  but what's a factor of two between friends?   8)  :horse:

(see https://en.wikipedia.org/wiki/Visible_spectrum )

The Wikipedia article you quoted says violet: 668-789 THz.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Microcontroller oscilloscope project
« Reply #15 on: June 08, 2018, 11:42:55 am »
The Wikipedia article you quoted says violet: 668-789 THz.
I just took the approximate limits from the first paragraph of the article:
Quote from: Wikipedia
A typical human eye will respond to wavelengths from about 390 to 700 nanometers.[1] In terms of frequency, this corresponds to a band in the vicinity of 430–770 THz.

Oscilloscope bandwidth is DC to max frequency.  Microscope 'bandwidth' is difference between upper and lower frequency limits of the spectrum its image sensor is sensitive to, which, in the absence of a sensor datasheet and the interest of avoiding extreme pedantry and dead horse flogging, I *HOPE* we can agree to take as near enough to the visible spectrum limits:  770 THz - 430 THz = 340 THz.   Taking far visible violet as 789 THz only adds 5%.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16614
  • Country: us
  • DavidH
Re: Microcontroller oscilloscope project
« Reply #16 on: June 08, 2018, 12:23:20 pm »
With equivalent time sampling, a 100 MHz bandwidth or even higher is feasible with some inexpensive ADCs at sample rates that an Atmega or similar can handle but this would require implementing an analog trigger and time to digital converter.  And do not underestimate the difficulty of 100 MHz signal conditioning; 20 MHz would be difficult enough.
 

Offline b_force

  • Super Contributor
  • ***
  • Posts: 1381
  • Country: 00
    • One World Concepts
Re: Microcontroller oscilloscope project
« Reply #17 on: June 08, 2018, 12:53:16 pm »
With equivalent time sampling, a 100 MHz bandwidth or even higher is feasible with some inexpensive ADCs at sample rates that an Atmega or similar can handle but this would require implementing an analog trigger and time to digital converter.  And do not underestimate the difficulty of 100 MHz signal conditioning; 20 MHz would be difficult enough.
I agree, PCB and layout is very important at these speeds

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Microcontroller oscilloscope project
« Reply #18 on: June 08, 2018, 01:10:38 pm »
With equivalent time sampling, a 100 MHz bandwidth or even higher is feasible with some inexpensive ADCs at sample rates that an Atmega or similar can handle but this would require implementing an analog trigger and time to digital converter.  And do not underestimate the difficulty of 100 MHz signal conditioning; 20 MHz would be difficult enough.

The ADCs in small MCUs use sampling capacitors. Also, the ADC will usually have some series resistance. This effectively forms a low pass filter effectively limiting the bandwidth (I guess well below 100MHz). Though you can get any sort of sample rates with ETS, it still won't have enough bandwidth.
 
The following users thanked this post: JPortici

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16614
  • Country: us
  • DavidH
Re: Microcontroller oscilloscope project
« Reply #19 on: June 08, 2018, 05:19:10 pm »
With equivalent time sampling, a 100 MHz bandwidth or even higher is feasible with some inexpensive ADCs at sample rates that an Atmega or similar can handle but this would require implementing an analog trigger and time to digital converter.  And do not underestimate the difficulty of 100 MHz signal conditioning; 20 MHz would be difficult enough.

The ADCs in small MCUs use sampling capacitors. Also, the ADC will usually have some series resistance. This effectively forms a low pass filter effectively limiting the bandwidth (I guess well below 100MHz). Though you can get any sort of sample rates with ETS, it still won't have enough bandwidth.

The sampling time constant for typical microcontroller ADCs limits them to somewhere between 10s of kHz and a couple MHz.  They can actually be driven faster with a low impedance source but they are not suitable for the reason you identify and more (1) unless an external track-and-hold is used which is feasible (2) but there are easier ways now.

Something like an $3 AD9283 can operate down to 1 MHz while providing a 475MHz input bandwidth.  If that sample rate is still too fast, then the parallel output can be decimated.  In the worst case, a fast 8-bit external latch (3) and some clocking logic are necessary to capture the output from the fast ADC for the slow microcontroller to digest but these are just a minor addition to the external logic for the time to digital converter necessary for ETS operation.

(1) Microcontroller ADCs would also have too much sampling jitter limiting equivalent time performance.  An external track-and-hold solves this problem as well.

(2) A track-and-hold made from a diode sampling bridge can easily get into the 100 to 400 MHz range without being exotic and could feed a microcontroller ADC but it involves a lot more design work than the alternative discussed above.  This level of performance is not difficult once you consider a 25 ohm or lower source impedance driving just a couple picofarads through a diode bridge into a JFET or MOSFET gate.  Check out the Tektronix 2230 design for a 100 MHz example.

(3) Fast is relative and what is needed is well within the capability of modern easy to use logic families.  In the past this was only slightly difficult.
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Microcontroller oscilloscope project
« Reply #20 on: June 09, 2018, 08:48:06 pm »
http://www.stm32duino.com/viewtopic.php?t=107

Read this thread. Lots of info in it.
 
The following users thanked this post: edavid

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Microcontroller oscilloscope project
« Reply #21 on: June 10, 2018, 11:16:58 am »
http://www.stm32duino.com/viewtopic.php?t=107

Read this thread. Lots of info in it.

Not even 2 MHz. And I wouldn't like the solutions with the external sample and hold ICs, because this would make sense for repeating signals, only. You couldn't sample e.g. a one-shot high speed digital signal.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline daybyter

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: de
Re: Microcontroller oscilloscope project
« Reply #22 on: June 10, 2018, 11:07:49 pm »
You can get higher sampling rates by overclocking the stm32, it seems...

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf