Electronic – How does an oscilloscope buffer work

androidbufferoscilloscopepicram

I am making a simple 1MHz oscilloscope with an embebbed system based on ARM and Android. I have an ADC with a speed of 12MSa/s that takes the samples. I need it to send the samples to a PIC microcontroller, to send them via USB to my Android system.

I cannot send 12MSa/s of data through USB so I investigated and I think I have to use a RAM buffer. I have done some research on the internet, but I can't understand how they work.

As far as I can understand:
Lets suppose I have 2 RAM ICs. I start filling RAM 1 with samples from my ADC, then, when it is filled, I start filling RAM 2. My microcontroller will start reading data from RAM 1. The USB transfer speed is not fast enough to read all the RAM content before RAM 2 is filled, so the ADC will have to wait until RAM 1 is empty, thus I will loose samples from my ADC.

Is there any way to prevent this? My development board is a PandaBoard. I am running Android 4 on it and it is working perfectly, but I have this problem regarding hardware buffering.

Best Answer

You can't sample continuously.
However, this isn't too much of an issue usually with scopes as most don't do this (at least at the higher speeds) Even an analogue scope does not display continuous information as you have the beam sweep back period.

A typical digital storage scope waits for a trigger, fills it's buffer at high speed, then sends the data at a lower speed to the microcontroller (or android in your case) for display. As Photon mentions, this happens fast enough (e.g. above 15 frames of data a second) for it to look continuous to the user.

Obviously the larger RAM buffer, the more samples(time) can be captured. This is why you will see DSOs advertising large capture buffers. At high speed this can make a big difference - at 2 Gigasamples per second and a 10KB capture buffer you are only going to get 5us of information. Some with larger buffers can only use part of it at the highest speed - for instance my DSO has 10MB of buffer up to 1 Gsps, but can only use 10KB at 2Gsps.

In your case you could switch to continuous capture at speeds the USB is capable of (e.g. < 1 Msps) You could maybe look at using compression also.
Either that or look at using high/super speed USB.