10 meg sample home made scope project. - Page 1
Forum section: electronics / general

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 26, 2019, 06:51:11 pm
content: Got my prototype pcb through today for my 10 mega sample USB PC scope.Had a few problems getting it going.Crystal not close enough to PIC so was struggling to start.Insufficient decoupling on USB power supply stopped USB running.I changed my mind about the clock for the A2D and clocked it from the PIC microcontroller instead.

author: TheHolyHorse
author_rank: Regular Contributor
timestamp: July 28, 2019, 02:36:15 am
content: What exactly is your question?

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 28, 2019, 02:04:12 pm
content: Funky layout job.

author: thinkfat
author_rank: Unknown
timestamp: July 28, 2019, 08:00:20 pm
content: Quote from: SiliconWizard on July 28, 2019, 02:04:12 pmFunky soldering job, too..Gesendet von meinem Nokia 6.1 mit Tapatalk

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 28, 2019, 09:19:48 pm
content: No question, just sharing my latest project.Its just a prototype pcb so has been hacked around a bit.Strange mix if SMD and through hole.I got the SMD soldered on by my pcb manufacturer.Its a pain to do by hand. Not cheap though.The fun part has been the software which was basically taken form a previous similar much slower 2MHZ sampling project.I managed to get 10MHZ sampling with an external A2D.With a bit of help from the Microchip forum I managed to get the speed up to 14MHZ sampling rate.To clock data out of the A2D I used the PIC PWM generator. That made my code much simpler and much faster.Next step is to speed up the analogue front end. The op amps are a bit slow so buying in some faster ones about 12MHZ bandwidth.

author: thinkfat
author_rank: Unknown
timestamp: July 28, 2019, 09:39:01 pm
content: For a 10 Ms/s sampling rate, your analog bandwidth needs to be limited to 5 MHz anyway.Gesendet von meinem Nokia 6.1 mit Tapatalk

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 28, 2019, 09:48:39 pm
content: Quote from: thinkfat on July 28, 2019, 09:39:01 pmThe problem with digital scopes is while the sampling rate can be high you need many samples to make a waveform.So something like 100 megs sampling would only be good for 1MHz sine or square wave.A good analogue scope will blow the digital storage scopes out of the water.However, you can pick up low sampling rate USB scopes for peanuts.

author: thinkfat
author_rank: Unknown
timestamp: July 28, 2019, 09:56:58 pm
content: I was more referring to the sampling theorem.Gesendet von meinem Nokia 6.1 mit Tapatalk

author: james_s
author_rank: Super Contributor
timestamp: July 28, 2019, 10:34:37 pm
content: Quote from: SiliconWizard on July 28, 2019, 02:04:12 pmTraces running around at weird angles is a classic rookie mistake. Set up the PCB program to only let you use 45 and 90 degree angles and the result ends up much cleaner.

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 28, 2019, 11:11:30 pm
content: do not underestimate the bug free software, its the least to moderately neat path algorithm...

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 28, 2019, 11:42:43 pm
content: Pro's usually suggest 90 degree bends is not good.The shortest distance between two points is a straight line.However, that makes layouts messy.I tend to use 90 and prefer 45 degrees.Going around components often forces 90 degree bends.I should have added that pcb was pre new track functions in my software.I now have two control keys.1/ Snaps back to previous pin in a straight line with pin2/ Snaps forward to next pin in a straight line with pin.See picture of new better pcb.

author: james_s
author_rank: Super Contributor
timestamp: July 28, 2019, 11:58:04 pm
content: When I need a 90 degree bend I always use two 45 degree bends unless circumstances absolutely mandate a single 90 degree. Regardless of bends, you want to keep the trace angles to multiples of 45 degrees.

author: NorthGuy
author_rank: Super Contributor
timestamp: July 29, 2019, 12:48:11 pm
content: Quote from: nigelwright7557 on July 26, 2019, 06:51:11 pmYou should have capacitors to the ground from both legs of the crystal. I cannot see them on your PCB. Also, 1M or so resistor might be needed parallel to the crystal.Modern designs usually use MEMS oscillators instead of crystals.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 29, 2019, 03:58:42 pm
content: Quote from: NorthGuy on July 29, 2019, 12:48:11 pmMy picture got clipped a bit, the crystal capacitors are directly above it.The crystal circuit is directly from Microchip datasheet.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 29, 2019, 04:23:55 pm
content: Yeah nothing wrong with using a crystal... especially for this kind of designs. You're not using an external oscillator anyway, just the one integrated in the MCU.Getting back to the PCB: I hadn't figured you had used your own software, which was a work in progress. So yes that explains things.Free-angle traces look weird (or "funky") but are not necessarily bad signal-wise. That's mainly a cosmetic issue (and would just raise questions about how you proceed, especially when no visible density issue would justify them)Now just a note: you still seem to be using a lot of 90° bends. Even if the corners are rounded on the outside, those are still 90° bends with a sharp angle inside the bend. That's not very good (for both manufacturability and EMC reasons...)When you need a trace to bend 90°, insert a corner - a small piece of trace - so you have two successive 45° bends instead. That's what you will see on most (I'd say all) modern PCB layouts.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 30, 2019, 12:08:16 am
content: Quote from: SiliconWizard on July 29, 2019, 04:23:55 pmMy software has a corner function where you can replace 90 degree bends with rounded off corners to any radius you like.I don't use it until the pcb is finished or it gets messy to edit.

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 30, 2019, 02:37:02 am
content: Quote from: nigelwright7557 on July 30, 2019, 12:08:16 amexactly! imagine you are designing 100 components and you have to redo when prototype confirmed working.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 30, 2019, 03:29:14 am
content: Quote from: Mechatrommer on July 30, 2019, 02:37:02 amOne simple command does the whole pcb. Its not difficult.

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 30, 2019, 04:24:03 am
content: demo on a densed board will be helpfull. Nobody bother to read on youtube age now esp if they already have a tool to do the job. An entertaining demo video will give courage to learn more.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 30, 2019, 05:57:14 am
content: Quote from: Mechatrommer on July 30, 2019, 04:24:03 amI did have a demo video on my website.There is a demo video in the demo version and the retail version of the software to get people started.I keep a track of website hits over a period and hits dropped off dramatically when I had the video up.So I removed it. If you want to have a look its here:

author: Mechatrommer
author_rank: Super Contributor
timestamp: July 30, 2019, 06:40:59 am
content: Quote from: nigelwright7557 on July 30, 2019, 05:57:14 amyour statements doesnt make sense to me (pray i will not speculate). why every time you put advertisement materials such as manual/guide, videos, screenshots/examples the hit dropped is a 8th wonder of the world to me. and time spent to keep track hit counter better spent on improving the SW further. just publish the materials and forget about it, let the audiences decide to hit buy now button or not. or are you saying those introductory materials will jeopardize your sale? by removing them you will increase hit and sale?anyway kudos for your effort in making the video but 2 resistors circuit is hardly practical.talking about competitors... few years back, i've attempted to make an eda designer, i called it Chromeera Project. took half a year to code just few data structures/gui etc, that was really heavy and difficult task, and i may say, wasteful as it occupied and took me away from other ee hobby /part time stuffs. thinking i only moved very little in half a year, and my VB6 IDE is rotting so not worth the effort, i decided to stop until i have better modern IDE proficiency (Qt was choosen) and time allocation for it. attached is what have completed so far (still on half breed GUI development, zero functionality) if only i can clone myself into 2 or 5 other persons, i'll command one of them to spend entire life on this task. but joke aside, no i dont want to compete with you, i only hope some day some people will come up with better and modern EDA yet affordable, this EDA will include EM solver, RF, integrated SPICE simulator, differential/length match/impedance control interactive bus routing, MCU/FPGA embedded C/C++/VHDL built in and simulator/debugger everything that a modern electronics design will require, fwiw...

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: July 30, 2019, 06:49:47 am
content: The problem with PCBCAD software now is the number of free packages and also the number of paid for packages.Its pretty much given away on ebay.So now for me its now just a hobby.Before December 2017 I was doing ok selling it on ebay for about £20 a go, sold thousands of copies.Then suddenly from nowhere came about 100 listings on ebay selling for peanuts.It killed the job really.For me its just a waste of time now but I continue to sell cheaper than the rest just to spite them and a sale I get is one they don't get.There really are much better ways of making money than scraping around on ebay for pennies.

author: JPortici
author_rank: Super Contributor
timestamp: July 30, 2019, 07:18:21 am
content: Quote from: nigelwright7557 on July 28, 2019, 11:42:43 pmvery old farts maybeso this is the famous project i see mentioning over the microchip forums?

author: hans
author_rank: Super Contributor
timestamp: July 30, 2019, 07:39:27 am
content: Quote from: nigelwright7557 on July 28, 2019, 09:48:39 pmNot really, with sin(x)/x interpolation you only need a factor of 5-10 times to properly reconstruct sine waves from digital samples. For square waves, you obviously need more because of the harmonics.If you want the analog design part to be reasonable, you also need a reasonable oversampling ratio between analog bandwidth and digital sample rate. This introduces a much lower order anti-aliasing filter. The Nyquist theorem is in that purely theoretical, almost nobody is crazy enough to build a 10+ order filter (with preferably a constant phase) so you can save a factor of 2x sampling rate of the digital domain. With a little bit of oversampling, you can get 2nd to 4th order anti-alias filters requirement.Although an analog scope doesn't suffer from this sampling drama, they also have cons. For example, being able to single-shot waveforms, which depending on your work is the single most used feature of a digital oscilloscope considering today's bursty nature of communication systems. This is a big hurdle with older digital scopes, which in fairness were horrid to use. I recommended that if you want to build an usable scope, to take care your sample buffer is as large as possible.

author: thinkfat
author_rank: Unknown
timestamp: July 30, 2019, 10:01:44 am
content: Quote from: hans on July 30, 2019, 07:39:27 amI think 5 times oversampling is somewhat the minimum for sin(x)/x for a somewhat reasonable waveform reconstruction. In the case of the OP, at 10 Ms/s it doesn't really make sense to have an analog frontend with a crazy-high (in relative terms) bandwidth. We're looking at 1-2 MHz analog bandwidth maybe.Of course the sampling theorem states that "perfect reconstruction" of the signal is only possible if the total power (energy?) of all signal components beyond fs/2 is zero, but in practice this is hardly achievable and you only need to keep it below the noise introduced by quantization anyway. That reduces your requirements quite a bit.Nevertheless, the sampling theorem does not impose just some theoretical limit. The effect is quite real and if you goof up enough, it will be clearly visible on the screen of your scope.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: August 06, 2019, 09:55:27 am
content: I did a bit more work on the scope and with some software changes I managed to get 18.5MHZ sampling.I just used more inline code and cached the scope buffer.I have moved on to a cheaper design now that uses same A2D but just a cheap through hole PIC.This one runs at 15MHz sampling. It works very well.I put the A2D on an SMD to through hole adaptor pcb.It was fun to solder on the small pcb as everything kept moving around when I tried to solder it.So I put some flux paste beneath the A2D and that helped hold it in place while I soldered it.

author: BravoV
author_rank: Super Contributor
timestamp: August 06, 2019, 10:12:40 am
content: Quote from: JPortici on July 30, 2019, 07:18:21 amNope, even a relic, still a 90 degree bend is a hype.Look how this high power TV RF transmission line used it too, in Dave's tour at EEVBLog Video #569, see that multiple 90 degree bends ?Please don't tell us those RF engineers knew nothing about doing the right thing.

author: Mechatrommer
author_rank: Super Contributor
timestamp: August 06, 2019, 12:32:07 pm
content: bluetooth pcb/rf (antenna) designer, i guess the OP is one of them, may say differently. pun intended

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: August 09, 2019, 05:15:25 am
content: I managed to overclock the PIC32MX a bit and got up to 16.5 mega samples/second.Built up a couple more pcb's and they all behave well.