juani_c 66 Posted July 20, 2014 Share Posted July 20, 2014 Suppose you have an application like SimpliciTi that says:" low memory needs(<8kB flash and 1kB RAM depending on the configuration)", you also have in your program the Petit FAT file system: "Very small RAM consumption (44 bytes work area + certain stack), Very small code size (2K-4K bytes)", finally you have some inertial sensors to calculate some angles, like in Nine-Axis Sensor Fusion Using the Direction Cosine Matrix Algorithm on the MSP430F5xx Family AppNote, where you need RAM ~ 0.75 kB, Flash ~ 11.7 kB. Summarizing: flash 8kB + RAM 1 kB flash 4kB + RAM 44 B flash 11.7kB + RAM 0.75 kB How do you choose the memory requirements for the microcontroller. The flash should be big enough to acomodate all the applications. Is the same case with the RAM? should I add together those values? Is the RAM used only when I'm using that particular app, for example I need 0.75kB only when I'm doing the math for the sensor fusion? Thanks! Quote Link to post Share on other sites
igor 163 Posted July 20, 2014 Share Posted July 20, 2014 In general probably depends on the application. Some RAM may need to be in use continuously (to retain values - e.g. what was the last sector used in file system, previous sensor values used in averaging, etc.) Look at the libraries to see what global variables they use - it is easiest to figure you need space for all of those values. (If a library only needs the global while it is in operation you might be able to do overlays and make it share space with something else, but coding and maintaining may be challenging.) juani_c 1 Quote Link to post Share on other sites
greeeg 460 Posted July 21, 2014 Share Posted July 21, 2014 Often for prototyping it's easiest to just buy the largest family member of the microcontroller you wish to use. MSP430's make this esspecially easy because the code is compatible between all devices. (may need some device specific module changes) Once you're satisfied your code is performing to your application needs you could run a simple memory analysis. Fill memory with known values 0xDEAD and 0xBEEF are common filler values. Run your program long enough to have run though all your code, while connected to a debugger. pause with the debugger, and examine the internal memory. You can find the point where the memory was used and no longer is still a 0xDEAD value. If you can see that you have plenty of space free in RAM, you could decide if you want to purchase a cheaper device. juani_c 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.