Jump to content
robomon

How to send 1MSPS 12bit ADC samples via USB FS

Recommended Posts

I want to implement a USB oscilloscope using my TIVA launchpad http://www.ti.com/tool/ek-tm4c123gxl

 

It has a 12bit ADC with sampling rate of 1million samples per second(MSPS). It also has a full speed (FS) USB.

 

If I set my sampling rate of ADC to 1MSPS with 12bit resolution, one second will have

1MSPS * 12 bits = 12 million bits (12 mega bits)

 

But USB full speed only has a transfer rate of 12Mbps(12 mega bits per second). So transferring these ADC samples via USB is not possible.

 

My questions

1) Other than using high speed (HS) USB, is there a way send these ADC samples? (i.e are there any compression techniques or any other methods to send data via USB ?)

2) Is my above calculation wrong ?

Share this post


Link to post
Share on other sites

I want to implement a USB oscilloscope using my TIVA launchpad http://www.ti.com/tool/ek-tm4c123gxl

 

It has a 12bit ADC with sampling rate of 1million samples per second(MSPS). It also has a full speed (FS) USB.

 

If I set my sampling rate of ADC to 1MSPS with 12bit resolution, one second will have

1MSPS * 12 bits = 12 million bits (12 mega bits)

 

But USB full speed only has a transfer rate of 12Mbps(12 mega bits per second). So transferring these ADC samples via USB is not possible.

 

ADC will collecting data with 1.4 MByte/s, and max USB FS rate (practical, not theoretical) is 1 MByte/s, so it is not possible.

Share this post


Link to post
Share on other sites

Hi,

But take into account you do not need too many samples to take - depending on your viewport, 100 points (samples) may be enough. You cannot compress pixels/points - this is usual the limit of eye resolution (although you may protest to this assertion…) and while you transmit a buffer with 100 samples, another one is to be acquired, so some hardware/software parallel processing. 

 

Tektronix used (at the beginning of DSO era) to take such amount of samples and then to interpolate between points to give some extra resolution. This was until someone developed the 1Gs/s sampler and this is the stage today (interpolation was with problems, many people unhappy with waveform displayed). 

L

Share this post


Link to post
Share on other sites

@Lyon: Could you let me know how this can be done ? If we do 100 samples then when we try to reconstruct the signal, it will be very bad - right ?

 

Or do you mean that at out of 1MSPS take only 100 samples and send it to PC ? But this method will definitly have some data lost. Am I correct ?

Share this post


Link to post
Share on other sites

Consider that the TM4C123gxl has a cpu clock top speed of 80MHz (and the flash memory operates at half that speed).

So you have about 80 clock cycles to process each sample.

 

and while you transmit a buffer with 100 samples, another one is to be acquired, so some hardware/software parallel processing. 

 

Didn't done anything with ARM, so can't be 100% sure, but from MSP430F5xx world, there is no problem at all, working with ADC/USB together or any other hardware module on high rate, in parallel, without (almost) any CPU intervention.

 

ADC write samples directly to USB endpoint buffer (without any memory coping), and when endpoint buffer become full, flush it (one assembler instruction), playing only with pointers (on the fly) to endpoint buffer. MSP430F5xx USB endpoint is limited to 64 bytes, and if I remember right ARM endpoint can be up to 1024 bytes, so even less CPU activity is needed.

 

At transfer start USB need some time to speed-up, so there must some buffering on the transfer begin, and collected data can be ignored on PC side. If only one device is connected to USB port, and PC side is not busy, close to 1 MByte/s is possible, but of course only for personal use, not commercial.

Share this post


Link to post
Share on other sites

Hi,

@@jayfree - usually the sampling at very precise defined time should be performed - it is not needed to get 1Ms and then try to display them - you have no physical media to display and refresh that, either PC, either paper - so the signal is sampled at defined interval and for display it is reconstructed - there is a reconstruction theory behind that (sinc function is ideal, but not used, so linear interpolators can be used instead since the mathematics involved is simple, operating only on adjacent samples). If you take 1Ms, then anyway you must discard many samples (or select from this huge number) in order to have something intelligible for the eye( you want on-two-several signal periods on screen). A minimal number of samples can be calculated, depends on several factors, including the bandwidth of the analog circuits involved. You maybe have used an DSO, so for instance, if you have a 1KHz sine and set the time base at 20ms/div, you will see something weird...

An operating mode (single shot) should use big number of samples and then present on media what was before trigger (pre-trigger) and after.

The package made by TI is a good one to hack - at that time the ADC had 500Ks/s, so with this new micro, some improvement could be made.

Don't know if I was sufficiently clear.

 

@@jazz, saw you are a genius on MSP430 forum - good for you and congratulations -  only thing to note is the Cortex-M4 is somewhat more limited for peripherals than 430 - due to different approach - for 430 some hidden hardware may be in-place to compensate the limitations due to 16MHz clock, while for Cortex now running at 120MHz, some peripherals had odds in use (but here we have a DMA). I had no experience with 430, although I have an F2013 stick ready to be pushed into computer (and waiting for several years) but life says to go other directions...

 

Regards, 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...