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.

A high-speed ADC which reads upon trigger

Vizier87

Active Member
Hi guys.

I have an application I'm interested to explore with basic microcontrollers and perhaps a high-speed ADC but I'm unsure if my thought process is correct.

Let's say there's a short burst of signal (0-5V) I want to capture, all occurring within 25-30 milliseconds. And the whole window including the baseline signal is 100 milliseconds. I need the full signal, not a part of it, which means I'll need to see the "zero" baseline before actually getting the signal's form.

I'd like at least 2000 data points with the captured signal, which means its 20k samples per second (including the baselines before and after the burst).

Here are the steps that I'm thinking:

1. Set up ADC in the uC.
2. Save the upcoming ADC data in a "stream" style in the RAM. Meaning that actively saving the data for say, 2000 points which represent 100 milliseconds.
3. IF an ADC output exceed a certain value, let's say 1.5V, then the data recording is triggered. This might occur at a third of the 2000-data-point window, so the remaining two-thirds are heaped up to the data pile before saving it as a .txt file in an SD card, perhaps.

Does this sound okay?

Cheers!
Vizier87
 

rjenkinsgb

Well-Known Member
Most Helpful Member
You could do that with various PIC MCUs.

20KHz sample rate is not particularly high, it could easily be controlled in software - though some have DMA so it could be done with little software overhead other than setup.

You only need 4K ram for 2000 16 bit values, so not a problem with a lot of the higher capability devices.

A PIC18F27Q43 would do, that has 8K ram and can run at up to 64MHz clock.

I tend to automatically go for a dsPIC33EP512GP502 for anything like that, as we have plenty of them in stock & they have massive storage - 48K RAM and 768K Flash, plus DMA and lots or peripherals, 16 bit CPU and up to 160MHz or more.

They give plenty of capacity for buffering, communications, file systems or graphics etc.
Both of those are available in normal dual in line IC packages.

There are no doubt many others that could also do the job, but I tend to stick to certain devices I know well, either certain low end or medium memory capacity, or do-anything with large storage & not much in between..
 

Vizier87

Active Member
Thanks for input! It's more on the code flow which I'm not sure of though.

My primary concern is the triggering part. I could be saving a stream of data continuously then polling for a threshold value to save the "burst" but I wonder if that might cost the speed of the ADC and result in a data resolution loss.

Imagine polling for 1000 points in every loop. I imagine that this might affect the data capture?

Cheers!
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Thanks for input! It's more on the code flow which I'm not sure of though.

My primary concern is the triggering part. I could be saving a stream of data continuously then polling for a threshold value to save the "burst" but I wonder if that might cost the speed of the ADC and result in a data resolution loss.

Imagine polling for 1000 points in every loop. I imagine that this might affect the data capture?

Cheers!
Look at any of the multitude of DIY oscilloscope projects out there, which is basically what you're trying to do - and see how they do it - as as already been said, 20,000 samples per second is no big deal, and many PIC's could probably do most of that in hardware with DMA, CLC etc.

Here's one of the many examples:

 

Nigel Goodwin

Super Moderator
Most Helpful Member
Thanks Nigel. Will have a look on it. I've just built a rudimentary burst logger with an Uno but it is pretty raw. Will share here when I've brushed it up.
I would imagine you simply write into a circular buffer, then when you detect the trigger you display starting from earlier in the buffer.
 

danadak

Active Member
Quite doable. Example where 12 bit SAR is used, there is enough BW and speed multi
channel can be done. If 16 bit needed the onboard DelSig will do 48KSPS at 16 bits.

The A/D drives DMA request to handle the transfer to RAM, the counter and ISR handle the
2000 sample frame management.

Single chip (including precision Vref), used small fraction of its resources. If needed signal
path filtering there is onboard digital filter for that purpose. emfile component (in PSOC land
a component is an onchip resource) shown to handle SDCARD and USBUART to interface to
PC if needed, as well as graphic LCD internal component if needed.

1653299848812.png



Other onchip resources (including ARM core) -

1653300014171.png


IDE (PSOC Creator) and compiler free, board for this probably the $ 15 board.

Here is example of an oscilloscope/logic analyzer/function gen done with it. Dont
know why they used a crappy puke lime green display with it. Could have been TFT
or OLED......


Another one -
and a discussion -



Regards, Dana.
 
Last edited:

Latest threads

Top