cancel
Showing results for 
Search instead for 
Did you mean: 

how to collect 50000 data points samples.

manoritesameer
Associate II
Posted on April 22, 2014 at 00:13

I have to store 50000 samples. The information would be stored in an Array. Unfortunately the maximum size my program allows me to allocate the array space is 10000 because it complains could not allocate block. how do I get this information. 

How do I do this.

thanks

#!rocketscience #basic-arithmetic #systems-analysis #filling-a-leaky-bucket #stm32-array #pigs-might-fly
14 REPLIES 14
Posted on April 22, 2014 at 01:05

How do I do this.

Pick a part that has adequate memory provisions for the size and type of data array you're attempting to use.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
Posted on April 22, 2014 at 22:28

hi clive,

     I have no idea how to do that .

Can u please give me an idea how to do that.

Andrew Neil
Evangelist III
Posted on April 22, 2014 at 23:48

Think about it: 

How much memory do you require to store one  single sample?

Knowing how much one sample takes, how much will 50000 take?

You will need at least  that much memory - won't you?

Posted on April 23, 2014 at 00:16

I have no idea how to do that . Can u please give me an idea how to do that.

My ability to help you is seriously impaired by your inability to explain your problem and context in a meaningful way. I'd throw you a life jacket, but I have no idea where to throw it.

''If you have questions please try to formulate them into a coherent thought, assuming I know nothing about you, your board, your development environment, your project or the tests you may have already done.''

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
manoritesameer
Associate II
Posted on April 23, 2014 at 17:57

Thanks again.

  I am using the STM32F407 discovery board. I need to store more than 50000 samples of data by using the ADC. Once I get 50000 samples, I transmit that information over the UART to my PC to analyse the data. I dont know how to store these many data points since I dont know how to place them in a memory.  Additionally all these samples are of type float.

Posted on April 23, 2014 at 18:15

The ADC does not capture floats, it captures 12-bit values stored in 16-bit words, ie 100000 bytes, floats take 32-bits (4 bytes) each, so 200000

Why can' the PC do the conversion? The STM32 is resource limited. You'll have to think about things differently with embedded.

The STM32F407 has 64KB of CCM (No DMA support), 128 KB of SRAM, so a total of 192KB, 196608 bytes if you could use it all, do you see a problem here?

Why can't you do the 12-bit integer to 32-bit float conversion AFTER you have captured all the raw data, as you transmit it via the USART?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on April 23, 2014 at 21:39

''I need to store more than 50000 samples of data by using the ADC. Once I get 50000 samples, I transmit that information over the UART to my PC''

Why collect them all first, and then send them all?

Why not send them as you get them - ''streaming'', if you like...

http://www.catb.org/esr/faqs/smart-questions.html#goal

Posted on April 23, 2014 at 22:09

Why collect them all first, and then send them all? Why not send them as you get them - ''streaming'', if you like...

Presumably because there is a significant disparity of the in-flow and out-flow rates.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on April 24, 2014 at 01:10

Maybe; maybe not.

Even if there is, the buffer requirement would still be reduced if it is constantly being ''drained''...