cancel
Showing results for 
Search instead for 
Did you mean: 

How to choose microcontroller based on its operating frequency?

SSala.3
Associate III

Hi,

I have a project which has following tasks. While going through STM32f4 datasheet and reference manual I couldn't find any details regarding the processor cycle or computing time to judge my requirement.

How can I select the between a 48MHz and 100MHz microcontroller? How to do the calculation based on the tasks?

Interfaces required : UART, I2C, ADC

  • Read multiple (up to 5) sensors connected on RS485 line and two ADC lines.
  • Transfer the data using BLE module via UART.
  • Calculate floating point values
  • store to flash memory
  • Status LEDs and two UI button.
  • Device will be battery operated.

Thank you.

6 REPLIES 6

None of these things strike me as needing 10s of MHz.

O​n chip Flash is very slow, look at parts supporting QSPI, eMMC or SD memory for storage for data logging.

Newer L series parts have lower power profiles.

C​ortex-M parts are common, review and understand their capabilities.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi,

My query is how do I conclude the clock required is 48MHZ or even low. Is there is specific calculation or method to analyse the number of processor clock the tasks will consume approximately?

Try it out and measure, or simulate or think it over. But even an 8 bit AVR with 16 MByte can do a lot. So do not overestimate your processing needs.

Danish1
Lead II

I think your best bet is to choose an evaluation board that includes a CAN interface, and hang a BLE module off that.

Then write your program. Use a high-level programming-language (such as "C") and I/O libraries (such as HAL) so you are not tied to a specific processor.

As Tesla DeLorean said, the slowest step is probably writing-to-FLASH, so you might want other non-volatile storage. Often evaluation boards come with EEPROM and/or an SD or micro-SD connector so those are easy options. I'm a fan of Ferroelectric memory (FRAM) which can be written as quickly as RAM but is non-volatile; something like that hung off I2C or SPI might suit depending how much data you have to store.

Then see how fast the processor needs to be to do what you want.

My guess is even the lowly stm32L0 will be quite fast enough if the program makes sufficient use of buffers so the program does not hang while waiting on slow peripherals. Note that you don't need hardware floating-point unless you have many calculations that you need to do quickly (such as FIR filtering or FFT).

But I think right now the key issue is availability. I have seen it suggested that semiconductor shortages will last throughout 2022. Unless this is theoretical, you need to choose a part you can get.

Hope this helps,

Danish

SSala.3
Associate III

Thanks for the comments. I was making an initial document for the project so I thought I should include some rough calculation to measure the computing requirements before starting anything.

I have seen claims that without fpu, arm cortex m3 or m4 average only 26 cycles to multiply, 31 cycles to add with an efficient library

https://blog.segger.com/floating-point-face-off-part-2-comparing-performance/

So it comes down to:

  • how many floating-point operations do you need to process one set of data? And what type are they - multiplications are quick, divisions slower and trigonometric functions expensive even with fpu
  • how many sets of data do you need to process every second.

I don't see numbers explicitly stated (other than that you have 5 sensors + 2 ADCs).

Arm is risc so think of 1 MHz as 1 million cycles/second (it's not quite as good as that but it's in the ball-park).

Hope this helps,

Danish