For my work, I need to acquire data at a high sample rate (>100kSa/sec) using Arduino Portenta H7, which has 3 X 16-bit ADCs. Portenta H7 has STM32H747XI microcontroller. I don't want to use Serial.print command as I came to know that this command takes much time to execute, which makes achieving the targeted sample rate impossible. What are the other possible ways to store the data from Arduino while maintaining this high sample rate? For example, saving the data and then printing them all at once at the end of testing( 3-5 second testing period). e.g. using an SD card or through saving in Arduino internal memory? Can you suggest techniques employed for high-sample rate data acquisition from Arduino?

  • How big is a "sample"? How many samples before "end of testing"? – Elliot Alderson Feb 2 at 13:50
  • Thank you. I want to acquire 2 analog signals - 16 bit each- at a rate of 100kSa/sec. Probably 3-5 seconds testing period. – Basit Ali Feb 2 at 13:53
  • So about 2 megabytes. What kind of Arduino? "Arduino" is a brand name, not a product. Why does it have to be an Arduino? – Elliot Alderson Feb 2 at 14:07
  • @ElliotAlderson that lowercase "portenta" seems to be Arduino Portenta H7 which uses STM32H747XI, with 1 MiB of RAM, of which most should be accesible via DMA. That's an amazingly powerful MCU with lots of memory, the Portenta seems like a neat little devkit. Basit please edit relevant details into your question. – Jan Dorniak Feb 2 at 14:53
  • @JanDorniak Thanks, my brain completely skipped over that. – Elliot Alderson Feb 2 at 15:12

The Portenta has a beast of an STM32H7 Cortex M7 and a minimum of 8M bytes of external SDRAM in addition to the 1M on-chip.

You need to capture 2channels x 2 bytes x 100K/s x 5s = 2M bytes of data, so storing it on the on-board RAM and spitting it out later seems like a viable and low-risk approach.

A slow serial link might take a few minutes to transmit 2M bytes of data, but you have various other options if that is objectionable.

  • Thank you Spehro. My apologies if it's too basic a question, as I have no previous experience with these microcontrollers due to my mechanical background. Could you please suggest some reference or sample code I can take guidance from, for storing the data and later retrieving it from Portenta's RAM? I really appreciate your help.I am currently using Arduino IDE for my sketch. – Basit Ali Feb 2 at 15:36
  • I don't know what Arduino ecosystem code is available. There are H7 ADC examples available in the STM32Cube IDE. The ADC will be what you want examples for. – Spehro Pefhany Feb 2 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.