Showing results for 
Search instead for 
Did you mean: 

Choosing right CPU in STM32

Associate III

Hello, I would like to ask you as a beginner in STM32 what product (the best case is the product that is possible to buy with Nucleo kit) I should target to for the application I will describe here:

I need to use two ADC channels with 1 MHz each and at least 10-bit range, save the value to some arrays (A[] and B[]) and every approx. 10ms make calculation:
1) apply offset fo each value and make a multiplication of each record in new array C (int32), like C[x] = (A[x] - offsetA) * (B[x] - offsetB)
2) calculate an average value for all arrays like avg(A), avg(B) and avg (C)
3) every 10ms send the average data to some periphery like serial bus and save to external FRAM memory (in circle when full)

I am now not sure how to make this but now I need maily chose the processor (best case with Nucleo kit available) that can work for my application.

Thank you very much for help

ST Employee

Hello @Stastny.Petr 

I suggest you to use our STM32 Finder here the link below:

From the description of your application, it seems that your needs can be largely covered by a mainstream STM32 family:
One thing you don't mention is whether your application needs to go into low-power mode between ADC acquisitions and calculations.
In this case, you should also consider the STM32L ultra low-power family, which is optimized for static and dynamic low power consumption.

If your application requires more performance, connectivity and more memory then you will need to look at the STM32 High performance:

Concerning the ADC, all STM32 families feature one or more multichannel ADCs with up to 12bit resolution and from 2.5 to 5Msps. STM32C0, G0 ADCs operate in single-ended mode. The STM32G4 also has differential ADC inputs.
All ADCs can be triggered by a timer.

For the acquisition and calculation of your arrays, if you're using integer representation, the C0 and G0 will be perfectly able to compute coefficients and offsets. If, on the other hand, you need floating numbers representation, the STM32G4 offers an FPU to do this more efficiently (Cortex-M4 CPU)
All STM32s, without exception, have several serial communication channels, such as UART, I2C or SPI, enabling you to log your data in the external memory of your choice.

Each of the STM32 families all have a Nucleo or Discovery board available as well.

I hope it will help you. Let me know?

Best regards,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Chief II

Main constrain is 10ms and memory. 16bit for one sample 1MHz = 120kB RAM for ABC.

Then any MCU with more as this DMA capable is ok. But i dont see idea of your explain. Send to external FRAM for what??? Code control nothink... Every 10ms can you lost samples over calc or not?

Associate III

Hello, the application is logger for current on pulsing circuit for checking the dielectric stability of the materials. So the idea is to send to PC actual value and store to FRAM last measurement in 10ms range. Because I need to measure the energy during pulsing, it is why I need current and voltage every 1us and multiply actual values.

My other question is - should I make the caltulation every 1us or after whole period by FOR cycle? It is possible to switch two arrays for example A1[] and A2[] every 10ms, store to A1 and calculate the average of A2, then store to A2 and calculate A1, then store to A1 etc...?

Yes my calculated ram is for double buffer, but C calculated maybe require more bytes for float results... One store second calc. When you plan MCU speed without lost sample, then you can calc both method , but with DMA.