Microcontroller oscilloscope project - Page 1
Forum section: electronics / general

author: yalect
author_rank: Regular Contributor
timestamp: June 08, 2018, 01:07:30 am
content: Hi,Can I build or simulate an oscilloscope of high range response 100Mhz or more with microcontroller like Atmega or other?Regards

author: FrankBuss
author_rank: Unknown
timestamp: June 08, 2018, 01:52:14 am
content: 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/wikiand then using a fast external ADC chip.

author: yalect
author_rank: Regular Contributor
timestamp: June 08, 2018, 06:27:35 am
content: I mean by response the range of frequency that the oscilloscope can work on maybe there is some fast simple usb oscilloscope

author: FrankBuss
author_rank: Unknown
timestamp: June 08, 2018, 07:35:01 am
content: 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.

author: David Chamberlain
author_rank: Frequent Contributor
timestamp: June 08, 2018, 08:08:51 am
content: Quote from: FrankBuss on June 08, 2018, 07:35:01 amLast one i brought had a bandwidth of 700THz, not too shabby

author: ebastler
author_rank: Super Contributor
timestamp: June 08, 2018, 09:01:21 am
content: Quote from: yalect on June 08, 2018, 01:07:30 amWhat do you mean by "simulating" an oscilloscope?

author: FrankBuss
author_rank: Unknown
timestamp: June 08, 2018, 09:38:12 am
content: Quote from: David Chamberlain on June 08, 2018, 08:08:51 amDo you have alien technology? 700 THz is the wavelength of purple light

author: ebastler
author_rank: Super Contributor
timestamp: June 08, 2018, 09:48:57 am
content: Quote from: FrankBuss on June 08, 2018, 09:38:12 amWhich seems entirely plausible for "USB microscopes", which you started talking about.

author: FrankBuss
author_rank: Unknown
timestamp: June 08, 2018, 09:56:49 am
content: Oops

author: Ian.M
author_rank: Super Contributor
timestamp: June 08, 2018, 10:13:22 am
content: Quote from: ebastler on June 08, 2018, 09:48:57 amActually, the visible spectrumbandwidthis 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?(seehttps://en.wikipedia.org/wiki/Visible_spectrum)

author: ebastler
author_rank: Super Contributor
timestamp: June 08, 2018, 10:17:40 am
content: Quote from: Ian.M on June 08, 2018, 10:13:22 amMaybe you could switch your microscope input to DC Coupling?

author: David Chamberlain
author_rank: Frequent Contributor
timestamp: June 08, 2018, 10:20:47 am
content: Quote from: Ian.M on June 08, 2018, 10:13:22 amHey 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

author: Ian.M
author_rank: Super Contributor
timestamp: June 08, 2018, 10:46:19 am
content: 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.

author: David Chamberlain
author_rank: Frequent Contributor
timestamp: June 08, 2018, 10:58:34 am
content: 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/hardwareOr for video pleasure, daves teardown of a Uni-TOr a low end (from The Signal Path perspective)

author: FrankBuss
author_rank: Unknown
timestamp: June 08, 2018, 11:04:07 am
content: Quote from: Ian.M on June 08, 2018, 10:13:22 amThe Wikipedia article you quoted says violet: 668-789 THz.

author: Ian.M
author_rank: Super Contributor
timestamp: June 08, 2018, 11:42:55 am
content: Quote from: FrankBuss on June 08, 2018, 11:04:07 amI just took the approximate limits from the first paragraph of the article:Quote from: WikipediaOscilloscope 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%.

author: David Hess
author_rank: Super Contributor
timestamp: June 08, 2018, 12:23:20 pm
content: 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.

author: b_force
author_rank: Super Contributor
timestamp: June 08, 2018, 12:53:16 pm
content: Quote from: David Hess on June 08, 2018, 12:23:20 pmI agree, PCB and layout is very important at these speeds

author: NorthGuy
author_rank: Super Contributor
timestamp: June 08, 2018, 01:10:38 pm
content: Quote from: David Hess on June 08, 2018, 12:23:20 pmThe 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.

author: David Hess
author_rank: Super Contributor
timestamp: June 08, 2018, 05:19:10 pm
content: Quote from: NorthGuy on June 08, 2018, 01:10:38 pmThe 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.

author: daybyter
author_rank: Frequent Contributor
timestamp: June 09, 2018, 08:48:06 pm
content: http://www.stm32duino.com/viewtopic.php?t=107Read this thread. Lots of info in it.

author: FrankBuss
author_rank: Unknown
timestamp: June 10, 2018, 11:16:58 am
content: Quote from: daybyter on June 09, 2018, 08:48:06 pmNot 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.

author: daybyter
author_rank: Frequent Contributor
timestamp: June 10, 2018, 11:07:49 pm
content: You can get higher sampling rates by overclocking the stm32, it seems...