Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Simultaneous adc sampling

Status
Not open for further replies.

Mosaic

Well-Known Member
Hi all:
I need some advice on an approach to obtaining 6 adc samples( 10 to 12 bit?) which are time synchronized.

The purpose is to feed a 3 pin semiconductor (BJT, FET etc) an AC, sine wave signal and obtain curve tracer data (volt/current) to profile the unit.The AC means I'll need a virtual ground and do some OPA scaling to feed the ADCs.

I'd like to optimize the number of data points to reasonably track the sine wave feed signal and resultant output etc. I'd like to be able to do the audio spectrum => 20Khz sine wave.
I was looking at this:
https://www.medicine.mcgill.ca/physio/vlab/biomed_signals/atodvlab.htm

It seems I need @ least 40Khz of sampling to meet Nyquist requirements.:eek:

If I were to use 10Bit adc, would it be possible to gang 6 ,16F1936's in lockstep and have them do sync'd adc?

Since the input sine wave is repetitive, I believe I can do time shifted sampling.Thus by clocking the sampling based on the perhaps 1/16 period of the signal, after 16 samples I can reconstruct the entire signal (one period) in good detail.

For 16 periods, each cycle of sampling is offset by 1/16 of a period. Thus one sample per period at a cumulative 1/16 period offset. Then by doing this repeatedly I can oversample for better accuracy.

If one complete cycle consumes 16 x 2 = 32 GPR bytes,. Since it's an mcu doing all the sampling I can do a running sum... for each of the 16 sampled points to increase their accuracy. So by doing 64 , (10bit sampling)cycles I can sum the data and get a 10 + 4^3 = 13 bit result, which is quite reasonable,all in 2 byte math.

At a 50 usec period (20khz), sampling should be doable with a 16F1936 @32Mhz, 11usec for a complete sample is possible.

With this method I should be able to overcome the Nyquist limitation. :D

Then I need to figure out how to send the data for a PC in a format that EXCEL can Parse to do graphes. Any resources around for that?:confused:

Once I can get that working, i hope to do DC operating point biasing (and curve tracing) and use small signal inputs to create optimal linear outputs, thereby helping with custom low distortion designs.
 
Tx eric, but how shall I format the data bytes into CSV to be read by USB over rs232 into a PC file?
I guess I need to do:
1) Comms with the PC (serial)
2) Sequentially transmit comma delimited bytes into a PC file x 6: Is this the CSV format?
3) Get the PC to read that data and make a file.
4) Import into EXCEL?
 
You can receive data from rs232 using a good terminal program like PuTTY: https://www.putty.org/
Use the "logging" feature to save the received data into file.

Configure Logging.
**broken link removed**

Configure Connection. Notice the "serial"-connection type radio-button.
**broken link removed**

.. and click "open".
 
Last edited:
I guess i can use a int on PortB pin change to sync the adc samples?
Is there a better way?
 
I guess i can use a int on PortB pin change to sync the adc samples?
Is there a better way?

Maybe.. depends on your budget and how good the system must be. I would use a dedicated ADC chip that can sample all channels simultaneously. They can be expensive.. maybe 20USD and up. Maybe somebody can recommend an IC?

Using 6 microcontrollers can be also expensive, low quality, and "weird" design. Interesting idea though.

There are also "track and hold" chips, that only samples all channels simultaneously.. you can then read each sample with microcontroller ADC. But those are not cheap either.
 
Actually many microcontrollers can do very fast sampling on 8 channels through clever pipeline etc. Resulting on 1 clock cycle propagation delay between channels. Or so I have understood. That would be a very small error. Depending on your specs, you might very well go for something like Atmel ATxmega or dsPIC.

EDIT: Sorry my information is little vague. I'm just trying to throw you some ideas you can research. I don't know or remember enough details about what is out there.
This might interest you:
https://www.electro-tech-online.com/custompdfs/2013/05/doc8378.pdf
https://www.electro-tech-online.com/custompdfs/2013/05/doc8032.pdf

I bet some PICs can also do what the above documents describe.. or even better stuff.
 
Last edited:
I guess i can use a int on PortB pin change to sync the adc samples?
Is there a better way?

Silly me.. now that I think about it, better solution would be to use 6 separate ADC converters with conversion trigger. Sorry for flooding the thread. But, using 6 microcontrollers would not be very good design in my opinion. There are so many better options that you can do.
 
Last edited:
...The purpose is to feed a 3 pin semiconductor (BJT, FET etc) an AC, sine wave signal and obtain curve tracer data (volt/current) to profile the unit.
...

I would just fix the problem at the source by making a better design spec.

There's no need to use "an AC sine wave signal" to do the component curve tracing, and there is no need to sample the 6 ADC inputs simultaneously.

What you could do is use a slower signal, and allow the signal voltage to stabilise, then take 6 normal ADC readings, then adjust the signal voltage again, then take another 6 ADC readings.

Overall it will be plenty fast enough to give you a complete real-time data "curve" for that component.
 
That's interesting @ misterT could u suggest an ADC device pls?

@ Mr RB, the last item about small signal analysis with a DC operating point to verify minimized distortion : is there no advantage in doing that at the op. frequencies?
 
...
@ Mr RB, the last item about small signal analysis with a DC operating point to verify minimized distortion : is there no advantage in doing that at the op. frequencies?

Very little advantage is gained doing the curve tracing at 20kHz, but it causes huge problems with circuit complexity (as you are finding out). Then you may have more problems with actually reading 6 lots of data at >50kHz and storing or processing the data real time.

It would be good to provide more info on EXACTLY what the final device needs to do, and how it would be used.

There's no shame in "going back to the drawing board", actually in a lot of cases it's the best way to fix design problems. ;)
 
Status
Not open for further replies.

Latest threads

Back
Top