Author Topic: Help - Selecting microcontroller for high sample rate  (Read 7698 times)

0 Members and 1 Guest are viewing this topic.

Offline jappieTopic starter

  • Newbie
  • Posts: 3
  • Country: nl
Help - Selecting microcontroller for high sample rate
« on: December 05, 2018, 10:51:19 pm »
Hi,

New here (not sure if this should go into the newbie section), and i need some help!
I've taken on a project that out of my comfort zone and i have trouble selecting a microcontroller that can handle that data throughput.

issue:
4x 16bit ADC @ 1MSPS (ad7980, or similar. using 3-wire spi)
Continues sampling, into buffers (4* 640 data points) threshold trigger on 1 buffer.
Then offloading to other micro (open to changing that) , for data processing.


Ive looked at DMA (mainy stm32 on the lower Mhz scale), i am just lost.
Can you guys help me select a microcontroller? (maybe even FPGA)


Jappie

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #1 on: December 06, 2018, 12:51:41 am »
The FPGA could process all the ADCs in parallel into BlockRAM and the data could be downloaded by any scheme you want but I would use USB serial.  In fact, I would buy a board that had a USB serial port on it.  Most do because they use the port for programming the platform flash (which, in turns, programs the FPGA at startup).

Your total data is fairly small, a serial stream at 115,200 baud wouldn't be bad at all.

I'm not sure you can find a uC board with 4 hardware SPI channels.  Maybe something in the STM lineup.  The problem with that is that STM development boards tend to use a lot of pins for other things precluding the use of the peripheral you actually want.  I also don't know how you synchronize 4 channels with a uC.

I like the FPGA approach.  I'm not sure what you are doing about sending trigger patterns or if that is a constant.  If it gets very involved, you don't want to do it in HDL.  You would want to drop in a soft core and write some code in C.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Help - Selecting microcontroller for high sample rate
« Reply #2 on: December 06, 2018, 01:57:48 am »
There are quite a few STM processors in the F4 range that have 4 (or more) spi channels.
The F411CC for example. 5 SPI chanels, all can be hooked up to a DMA for fast and very low overhead transfers.

Alternately:
If you can do with 0.9MSPS you could go for one of the STM32H7 series.
They include a 16-bit adc with up to 20 channels that runs at 3.6MSPS@16-bit or 4MSPS@14-bit.
They that is a super simple setup where you can setup the ADC to do continuous transfers using DMA, and just read the memory when you need!
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: ca
Re: Help - Selecting microcontroller for high sample rate
« Reply #3 on: December 06, 2018, 02:14:13 am »
Figure 41. Chain Mode with Busy Indicator Connection Diagram
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7980.pdf

May be 1 or 2 SPI would be sufficient.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Help - Selecting microcontroller for high sample rate
« Reply #4 on: December 06, 2018, 02:40:59 am »
The easiest way is to find an MCU with buit-in ADCs.

For 4 AD7980 you'll need 4 SPI modules which can run at about 20 MHz. Not all MCUs can go that fast, so you'll need to pick ones that can. You also can chain your ADCs, so other options are 2 SPI modules at about 40 MHz or one SPI module at 80 MHz. You also need the corresponding number of DMA channels. That's it. Not quite sure why you would need a second MCU.

The biggest problem with MCU is to synchronize everything. Your ADC requires acquisition pulses from MCU, which have to be synchronized with SPI. You can produce the pulses with PWM. You also may need to produce some gaps between SPI bytes, which may be difficult to do with DMA. How easy it is to accomplish the perfect synchronization (or if it is possible at all) depends on the peculiarities of the specific MCU and you probably need to read datasheet very carefully or do some experiments to see how well can you synchronize your SPI with acquisition pulses.

Of course, it's all very easy to do in FPGA - it has enough pins and speed to do ether of the three speed variants, and it'll take only few hours to program.

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #5 on: December 06, 2018, 02:55:36 am »
Figure 41. Chain Mode with Busy Indicator Connection Diagram
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7980.pdf

May be 1 or 2 SPI would be sufficient.

Even 1 channel would be fine because the conversion for all units is controlled by a single digital output from the uC.  There are no 'programming' commands so chaining the devices together makes all the sense in the world.
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: ca
Re: Help - Selecting microcontroller for high sample rate
« Reply #6 on: December 06, 2018, 03:16:06 am »
Figure 41. Chain Mode with Busy Indicator Connection Diagram
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7980.pdf

May be 1 or 2 SPI would be sufficient.

Even 1 channel would be fine because the conversion for all units is controlled by a single digital output from the uC.  There are no 'programming' commands so chaining the devices together makes all the sense in the world.
I was thinking two SPI if OP needs 1 MHz sampling rate sharp, than SPI clock jumps up >64 MHz, and I don't know any uCPU that could handle such high rate.  Wait, seems stm32H7 could get 150 Mb/s, but non of F3, F4 or F7.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1472
  • Country: au
Re: Help - Selecting microcontroller for high sample rate
« Reply #7 on: December 06, 2018, 04:56:19 am »
I've taken on a project that out of my comfort zone and i have trouble selecting a microcontroller that can handle that data throughput.

issue:
4x 16bit ADC @ 1MSPS (ad7980, or similar. using 3-wire spi)
Continues sampling, into buffers (4* 640 data points) threshold trigger on 1 buffer.
Then offloading to other micro (open to changing that) , for data processing.

Where does all this ultimately end up ?  4 * 640 points, sounds like a simple scope ?
As already mentioned, 1 MSPS is not particularly fast, so a MCU's ADC's might get close.

If you do need external ADCs for noise/speed/location reasons, then a small FPGA with good RAM may be ideal for you.
The Lattice iCE40UP5K-SG48I has a decent 128kBytes SRAM, and comes in a QFN48 package - it could do any manner of SPI-ADC buffering.

google finds
More standard breakout board    ICE40UP5K-B-EVN

More compact version HM01B0-UPD-EVN

Both boards include FT2232H, so you have a 12MBd PC link, if you need that too.

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #8 on: December 06, 2018, 07:14:05 am »
Figure 41. Chain Mode with Busy Indicator Connection Diagram
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7980.pdf

May be 1 or 2 SPI would be sufficient.

Even 1 channel would be fine because the conversion for all units is controlled by a single digital output from the uC.  There are no 'programming' commands so chaining the devices together makes all the sense in the world.
I was thinking two SPI if OP needs 1 MHz sampling rate sharp, than SPI clock jumps up >64 MHz, and I don't know any uCPU that could handle such high rate.  Wait, seems stm32H7 could get 150 Mb/s, but non of F3, F4 or F7.

Number crunching will clearly be required.  The maximum clock rate will just about handle 4 devices on one SPI channel.  But...  What about the rest of the latency?  DMA requests, SPI overhead, framing requirements and so on.  While we're on the subject, can an IO line really toggle at 1 MHz to start the samples?  Is that signal going to come from a timer?  We have just 1 uS to start the conversion   What is the limit of the uC SPI clock.

As it turns out, the AD7980 has a cycle time of 1.2 uS or 833 kHz.  It can't do 1 Msps.  See tcyc on page 6 of the datasheet.

I like the idea of a single conversion start signal for multiple ADCs.  Bringing the data in via 4 separate SPI gadgets makes sense and using 4 DMA channels also makes sense.  What I don't know is the maximum data rate for the DMA channels (assuming all 4 go ready at the same time).

As I said, somebody is going to need to do some number crunching.

One thing that hasn't been discussed is whether the data is sampled in burst mode where 640 samples are taken and the process stops for some long period of time or is the sampling continuous and attempting to capture 4 @ 640 samples for some large number of iterations.  This matters with the USB->Serial approach if the data capture is done in an FPGA.  I don't know what the maximum throughput is for the USB->Serial channel.  More numbers...

I think I would lay the timing out in a spreadsheet along one line.  Use a column for each step of the process.  Finally, add up the row and see if the 1 Msps requirement is met.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Help - Selecting microcontroller for high sample rate
« Reply #9 on: December 06, 2018, 08:07:07 am »
While we're on the subject, can an IO line really toggle at 1 MHz to start the samples?

Absolutely. Even basic STM32F0's can do this. If you jump up into the F4/7/H7 range you can probably expect to toggle an i/o at 40MHz.

What is the limit of the uC SPI clock.
Quite a lot of simple micros can do 15MHz +, a lot of mid range ones can do 40MHz.

A single chip solution like the STM32H7 Series with two built in 3.6MSPS 16-bit adc with up to 20 channels each should be quite adequate as a simpler one chip does all solution.
(i had earlier though it was only one, however now i realise there are two that can both operate at 3.6MSPS, you should be able to read 4 channels at up to 1.8MSPS @16-bit, )
With the ADC's in DMA reception mode, all the processor will have to do is read the raw conversion data out of memory and do the math on it.
Which the H7 should be more than capable of, 400MHZ core with hardware single and double floating point units.

Then depending on the data rate required to a host, either use the inbuilt USB FS device in Virtual com port mode. Or if higher data-rates are required, hook up an external USB HS PHY.

Now so as i am not seeming biased to stm products (they are just what I use day to day!) here are a couple of other options:
PIC24FJ128GC006 - 2x differential 16-bit adc's @1MSPS, and a 10MSPS 12-bit 50 channel ADC. quite a bit slower processor speed (32MHz)
ATSAM4E16C        - 2x 16-bit @ 1MSPS
LPC55S6x            - new, not much info but seems to have a 16 bit 1MSPS adc, not sure on channels etc.
« Last Edit: December 06, 2018, 08:35:16 am by lucazader »
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1626
  • Country: nl
Re: Help - Selecting microcontroller for high sample rate
« Reply #10 on: December 06, 2018, 08:23:50 am »
As it turns out, the AD7980 has a cycle time of 1.2 uS or 833 kHz.  It can't do 1 Msps.  See tcyc on page 6 of the datasheet.

For 1.71V < VIO < 3.3V.
For 3.3V < VIO < 5V the tcyc value is 1us.

I don't think the DMA on the internal memory bus is going to be a problem. I guess any MCU that wants to take a look at 4MSPS of ADC data is going to be 100MHz++, so eating a multifold of 4 million cycles per second from the shared memory bus is not going to kill the MCU's performance. It could slow things though, it can highly depend which SRAM blocks you map the DMA buffers onto. The STM32 parts, for example, have TCM memory that is inaccessible from DMA etc. so that the CPU always has a RAM access without contention. Of course the firmware has to be written such that it mainly uses TCM memory (linker file settings).

I also wouldn't go to serial, that is a bus from the stone age when it comes to these higher information throughputs. I would rather look at USB2.0HS (either integrated into MCU or using a parallel memory-style connection), or 100Mbit Ethernet (added bonus: electrical isolation). The latter is particularly easy with modern MCUs, because many high-speed parts have integrated ethernet MACs and only need a 2$ phy and a 5$ connector. But it's perhaps less easy to connect to a PC, as it needs to go over the network (less "discovery")
 

Offline jappieTopic starter

  • Newbie
  • Posts: 3
  • Country: nl
Re: Help - Selecting microcontroller for high sample rate
« Reply #11 on: December 06, 2018, 08:39:43 am »
I've taken on a project that out of my comfort zone and i have trouble selecting a microcontroller that can handle that data throughput.

issue:
4x 16bit ADC @ 1MSPS (ad7980, or similar. using 3-wire spi)
Continues sampling, into buffers (4* 640 data points) threshold trigger on 1 buffer.
Then offloading to other micro (open to changing that) , for data processing.

Where does all this ultimately end up ?  4 * 640 points, sounds like a simple scope ?
As already mentioned, 1 MSPS is not particularly fast, so a MCU's ADC's might get close.

If you do need external ADCs for noise/speed/location reasons, then a small FPGA with good RAM may be ideal for you.
The Lattice iCE40UP5K-SG48I has a decent 128kBytes SRAM, and comes in a QFN48 package - it could do any manner of SPI-ADC buffering.

google finds
More standard breakout board    ICE40UP5K-B-EVN

More compact version HM01B0-UPD-EVN

Both boards include FT2232H, so you have a 12MBd PC link, if you need that too.

In the end the buffers are used for cross correlation and then a algorithm that does dispensation compensation and localisation.
But the idea is that this processing can happen at a later time, and the buffered data can be stored on a sd-card.

The external ADC where chosen for noise.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Help - Selecting microcontroller for high sample rate
« Reply #12 on: December 06, 2018, 08:42:04 am »
Actually just found that the STMM32H750 value line series has 3 of the 3.6MSPS 16-bit adc's. And they can also differential or single ended capable.
Along with 1MB of ram, it does have comparatively small flash of 128KB though.
And it's in stock at digikey for $7.32@1qty and is less than $4.66@540qty

That is less than 1/3 the price of a single AD7980 (on digikey for $15.73@500qty and $19.98@1qty.

Seems like a bit of a no-brainer to me unless I am missing something..?
Please correct me if I am wrong
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19274
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help - Selecting microcontroller for high sample rate
« Reply #13 on: December 06, 2018, 09:14:57 am »
I've taken on a project that out of my comfort zone and i have trouble selecting a microcontroller that can handle that data throughput.

You should also consider all the other activities that the controller might need to do at the same time as sampling the data. With all but one microprocessor family, any other activity could "get in the way" of the sampling. Such unpredictability is a prime reason for offloading sampling and first level processing to FPGAs or other hardware.

The only processor family that does not suffer from that problem is the XMOS xCORE family. It dedicates one of many cores to each input channel, has "FPGA-like" I/O with times guaranteed to a 250MHz/4ns clock, and excellent multicore communications.

The IDE will guarantee exact loop times, so you can predict whether your design will keep up with the input. With all other processors you have to measure, and hope you have caught the worst case in your meaurement.

Buy the xCORE processors and dev boards at DigiKey. The IDE is free and the timing guarantees can, of course, be tested without hardware :)
« Last Edit: December 06, 2018, 01:46:56 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline jappieTopic starter

  • Newbie
  • Posts: 3
  • Country: nl
Re: Help - Selecting microcontroller for high sample rate
« Reply #14 on: December 06, 2018, 11:27:19 am »
Figure 41. Chain Mode with Busy Indicator Connection Diagram
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7980.pdf

May be 1 or 2 SPI would be sufficient.

Even 1 channel would be fine because the conversion for all units is controlled by a single digital output from the uC.  There are no 'programming' commands so chaining the devices together makes all the sense in the world.
I was thinking two SPI if OP needs 1 MHz sampling rate sharp, than SPI clock jumps up >64 MHz, and I don't know any uCPU that could handle such high rate.  Wait, seems stm32H7 could get 150 Mb/s, but non of F3, F4 or F7.

Number crunching will clearly be required.  The maximum clock rate will just about handle 4 devices on one SPI channel.  But...  What about the rest of the latency?  DMA requests, SPI overhead, framing requirements and so on.  While we're on the subject, can an IO line really toggle at 1 MHz to start the samples?  Is that signal going to come from a timer?  We have just 1 uS to start the conversion   What is the limit of the uC SPI clock.

As it turns out, the AD7980 has a cycle time of 1.2 uS or 833 kHz.  It can't do 1 Msps.  See tcyc on page 6 of the datasheet.

I like the idea of a single conversion start signal for multiple ADCs.  Bringing the data in via 4 separate SPI gadgets makes sense and using 4 DMA channels also makes sense.  What I don't know is the maximum data rate for the DMA channels (assuming all 4 go ready at the same time).

As I said, somebody is going to need to do some number crunching.

One thing that hasn't been discussed is whether the data is sampled in burst mode where 640 samples are taken and the process stops for some long period of time or is the sampling continuous and attempting to capture 4 @ 640 samples for some large number of iterations.  This matters with the USB->Serial approach if the data capture is done in an FPGA.  I don't know what the maximum throughput is for the USB->Serial channel.  More numbers...

I think I would lay the timing out in a spreadsheet along one line.  Use a column for each step of the process.  Finally, add up the row and see if the 1 Msps requirement is met.


Hmm the "featured" Throughput: 1 MSPS, is kinda misleading.
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 782
  • Country: ca
Re: Help - Selecting microcontroller for high sample rate
« Reply #15 on: December 06, 2018, 01:35:09 pm »
Quote
////////

I like the idea of a single conversion start signal for multiple ADCs.  Bringing the data in via 4 separate SPI gadgets makes sense and using 4 DMA channels also makes sense.  What I don't know is the maximum data rate for the DMA channels (assuming all 4 go ready at the same time).

////////

I think I would lay the timing out in a spreadsheet along one line.  Use a column for each step of the process.  Finally, add up the row and see if the 1 Msps requirement is met.

Hmm the "featured" Throughput: 1 MSPS, is kinda misleading.

 DMA shouldn't be a problem. Recently, I've done a few experiments with nucleo-F303re board ( less than $14 CAD).
It has 4 adc ( stm32F303re  there only one has 4, that I know), capable to sample 5 msps each at 12-bits resolution. 
DMA throughput becomes an issue if all adc running at full speed, doing 20 msps in total. Than I could not get 12-bits, board does 20 with lower 8-bits resolution. And about 16 msps at 12-bits.
uCPU is 72 MHz.
Though I'd expect SPI->DMA throughput  close to 45 mega 16b words on something like stm32F446 core running at 180 MHz.
 
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19274
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Help - Selecting microcontroller for high sample rate
« Reply #16 on: December 06, 2018, 01:49:28 pm »
I've taken on a project that out of my comfort zone and i have trouble selecting a microcontroller that can handle that data throughput.

issue:
4x 16bit ADC @ 1MSPS (ad7980, or similar. using 3-wire spi)
Continues sampling, into buffers (4* 640 data points) threshold trigger on 1 buffer.
Then offloading to other micro (open to changing that) , for data processing.

Where does all this ultimately end up ?  4 * 640 points, sounds like a simple scope ?
As already mentioned, 1 MSPS is not particularly fast, so a MCU's ADC's might get close.

If you do need external ADCs for noise/speed/location reasons, then a small FPGA with good RAM may be ideal for you.
The Lattice iCE40UP5K-SG48I has a decent 128kBytes SRAM, and comes in a QFN48 package - it could do any manner of SPI-ADC buffering.

google finds
More standard breakout board    ICE40UP5K-B-EVN

More compact version HM01B0-UPD-EVN

Both boards include FT2232H, so you have a 12MBd PC link, if you need that too.

In the end the buffers are used for cross correlation and then a algorithm that does dispensation compensation and localisation.
But the idea is that this processing can happen at a later time, and the buffered data can be stored on a sd-card.

The external ADC where chosen for noise.

Have you considered shoving it up a USB link or over ethernet as fast as those links allow?

A classic use-case for the xCORE processors is to have some cores dedidcated to the USB/ethernet, and others to your specific i/o devices.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #17 on: December 06, 2018, 03:05:45 pm »
Do the samples have to be correlated in time?  I wouldn't be surprised if they do.

A single ADC with multiple channels, even if very fast, won't sample two or more signals simultaneously.
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Help - Selecting microcontroller for high sample rate
« Reply #18 on: December 06, 2018, 05:48:36 pm »
Actually just found that the STMM32H750 value line series has 3 of the 3.6MSPS 16-bit adc's. And they can also differential or single ended capable.
Along with 1MB of ram, it does have comparatively small flash of 128KB though.
And it's in stock at digikey for $7.32@1qty and is less than $4.66@540qty

That is less than 1/3 the price of a single AD7980 (on digikey for $15.73@500qty and $19.98@1qty.

Seems like a bit of a no-brainer to me unless I am missing something..?
Please correct me if I am wrong

Ok, I don't mind correcting you  :)

The STM32H7 has 12-bit ADCs. Higher resolutions are achieved by oversampling which is done in H/W by averaging. To get 16 bit resolution you need to average at least 16 samples so the maximum sampling rate would be 225kSPS.

To match the AD7980 noise performance you might need to average rather more than 16 samples depending on the noise characteristics of the STM32H7 ADC (which is only specified at 12bits and 2MSPS so presumably it will be worse at 3.6MSPS). If the noise is correlated to any degree then the amount of improvement with oversampling will be less than predicted by the usual 1 bit improvement in noise performance by averaging 4 samples (ie. 4X oversampling).
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Help - Selecting microcontroller for high sample rate
« Reply #19 on: December 06, 2018, 05:54:42 pm »

As it turns out, the AD7980 has a cycle time of 1.2 uS or 833 kHz.  It can't do 1 Msps.  See tcyc on page 6 of the datasheet.

It can do 1MSPS - the reduced rate is if VIO < 2.3V or < 3.3V, depending on temperature. See tcyc on page 5 of the datasheet.

[EDIT] Ooops - just noticed that hans already pointed this out, but it looks like jappie also missed the correction!
« Last Edit: December 06, 2018, 05:59:16 pm by splin »
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 708
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #20 on: December 06, 2018, 07:16:42 pm »
Actually just found that the STMM32H750 value line series has 3 of the 3.6MSPS 16-bit adc's. And they can also differential or single ended capable.
Along with 1MB of ram, it does have comparatively small flash of 128KB though.
And it's in stock at digikey for $7.32@1qty and is less than $4.66@540qty

That is less than 1/3 the price of a single AD7980 (on digikey for $15.73@500qty and $19.98@1qty.

Seems like a bit of a no-brainer to me unless I am missing something..?
Please correct me if I am wrong

Ok, I don't mind correcting you  :)

The STM32H7 has 12-bit ADCs. Higher resolutions are achieved by oversampling which is done in H/W by averaging. To get 16 bit resolution you need to average at least 16 samples so the maximum sampling rate would be 225kSPS.

To match the AD7980 noise performance you might need to average rather more than 16 samples depending on the noise characteristics of the STM32H7 ADC (which is only specified at 12bits and 2MSPS so presumably it will be worse at 3.6MSPS). If the noise is correlated to any degree then the amount of improvement with oversampling will be less than predicted by the usual 1 bit improvement in noise performance by averaging 4 samples (ie. 4X oversampling).

To obtain 16 bits of resolution, you need to downsample by >= 256x, not 16x.  Each factor of four gives you one bit, in the best case, if the noise is white and the signal is sufficiently dithered.  Also, the simple averaging provided by most MCUs is not really proper downsampling; it is a very loose low-pass filter (sinc^1) followed by the decimate-by-N stage.  Better would be something like the DFSDM peripheral on some STM32 MCUs.
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 708
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #21 on: December 06, 2018, 07:18:35 pm »
Don't forget that you can run the MCU SPI peripherals in slave mode and orchestrate the timing/synchronization using MCU timers, if that makes life easier.
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Help - Selecting microcontroller for high sample rate
« Reply #22 on: December 06, 2018, 11:01:48 pm »

Please correct me if I am wrong

Ok, I don't mind correcting you  :)

The STM32H7 has 12-bit ADCs. Higher resolutions are achieved by oversampling which is done in H/W by averaging.

Mea culpa - you were right. Which is odd as I bought the STM32H743 Nucleo card for the express purpose of testing the 16-bit ADC performance (but not had time to do it yet)!  :palm:

They are specified as 16 bits at 3.6MSPS with noise performance of 13.5 ENOBs at 2MSPS. So oversampling will be required to match the AD7980 noise performance.
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Help - Selecting microcontroller for high sample rate
« Reply #23 on: December 06, 2018, 11:33:04 pm »
To obtain 16 bits of resolution, you need to downsample by >= 256x, not 16x.  Each factor of four gives you one bit, in the best case, if the noise is white and the signal is sufficiently dithered.

No, averaging 16 samples will give 4 extra bits of resolution but it will only reduce the noise by 2 bits (assuming there is sufficient dither and the noise is Guassian and uncorrelated).

Quote
Also, the simple averaging provided by most MCUs is not really proper downsampling; it is a very loose low-pass filter (sinc^1) followed by the decimate-by-N stage.  Better would be something like the DFSDM peripheral on some STM32 MCUs.

It is 'proper' downsampling. 'Better' depends on what you are trying to achieve. There are many different digital filter types that could be used with varying tradeoffs including complexity, BW, sharpness, flatness, group delay etc.  Averaging and decimation doesn't have a sharp rolloff but it the *optimum* filter in some cases. From page 6.6 of "Mixed Signal and DSP Design Techniques, 2002" by Walter Kester:

https://www.analog.com/media/en/training-seminars/design-handbooks/MixedSignal_Sect6.pdf

Quote
Notice that the moving average filter has no overshoot. This makes it useful in signal processing applications where random white noise must be filtered but pulse response reserved. Of all the possible linear filters that could be used, the moving average produces the lowest noise for a given edge sharpness.

The 'better' filters, eg. SINC3, have longer settling times which is a particular problem for multiplexed systems.
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 708
  • Country: us
Re: Help - Selecting microcontroller for high sample rate
« Reply #24 on: December 06, 2018, 11:36:22 pm »
They are specified as 16 bits at 3.6MSPS with noise performance of 13.5 ENOBs at 2MSPS. So oversampling will be required to match the AD7980 noise performance.

That is still amazing for an MCU ADC, and one of my favorite things about STM32.  Even the ~ 11 ENOB @ 5 MSPS in the STM32L4 is better than most.

I think the H7 series also has the DFSDM with built-in connection to the ADC.  This lets you downsample by up to 80x in one go (sinc^3 CIC filter).
« Last Edit: December 06, 2018, 11:38:55 pm by mark03 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf