Electronic – How to determine how much flash/RAM you need for a microcontroller

designembeddedmemorymicrocontroller

Let's say you are starting an embedded project with some known functionality. When you select a microcontroller how do you select how much RAM you need?

Do you use a developer board and code your project first and then see how much memory you have used and then select an appropriate microcontroller that fits that memory?

Do you just pick a beefy microcontroller for a prototype and then scale down after you have a working product?

Do you just pick something that you are sure will be enough and if you run out of space, just upgrade to a higher memory density one otherwise, you just keep the existing microcontroller?

What is considered to be good practice?

Best Answer

Personally for hobby projects I tend to use the most powerful microcontroller in the family with the right footprint. I then develop the PCB, write some code and produce a prototype.

This has the advantage that I know the small number of microcontrollers fairly well, so I can rapidly prototype without having to read a whole datasheet. I also have breakout boards and code templates for them.

If it works and I'm making more than a handful I then buy the cheapest microcontroller that has the right peripherals and enough memory for whatever I coded previously. This can be annoying if internal registers change (happens on the PIC) or if either microcontroller has extra peripherals which need to be disabled to make code work.

However for production purposes this would let you shave off a fair amount from each unit.