Arm Microcontroller Memory Structure
by RobotsCraft in Circuits > Microcontrollers
34 Views, 0 Favorites, 0 Comments
Arm Microcontroller Memory Structure
In this tutorial we are going to refer the various Memory sections of ARM controllers
Memory Section
FLASH – A non-volatile memory that primarily stores the program’s instructions, and also any“constant” data values. In general, you only read from this memory, and it is only written when you download new code to the micro-controller.
RAM – It is a volatile memory that is the working data space for storing all variables whilst the program is running. In C, this is static variables, the heap, and the stack.RAM is therefore much more scarce and valuable than FLASH, so it is worth understanding a little about the memory model to help make best use of the memory.
EEPROM – Some microcontrollers have special non-volatile memory that can be erased and writtenbyte for byte rather than in blocks or sectors. This memory is typically used by the application to store special data or configuration. This memory requires special access by a peripheral and is not directly addressable.
C Memory Model
Heap Memory – This is used for dynamic memory allocation. When we create a new instance of an object using ‘new’, or if you allocate a block of memory using malloc and friends, you use memory in the heap.
Static/Global memory – Global and static memory are values that are allocated for the entire lifetime of the program.If for some reason you have data that is fixed (such as a lookup table), you’d be much better making sure the compiler can allocate it in FLASH to save valuable RAM space. We could use the C keyword “const” to tell the compiler the variable will never be changed.
Stack – The Stack is used to store types of variables that have a fixed lifetime based on how C programs run. It is a section of RAM that grows and shrinks as the program runs. When you call a function, its parameters and any variables you have defined in that function (which are not static) are stored on the stack.
For more ARM tutorial and for Purchasing Arm development Board please visit:
www.Robotscraft.com
ARM Development Board with LCD model A
http://robotscraft.com/arm-7-lpc21xx-boards/107-arm7-development-board-with-lpc2148.html
ARM Development Board Model B
http://robotscraft.com/arm-7-lpc21xx-boards/108-arm7-development-board-with-lpc2148-model-b.html
For Blogs and Tutorials please visit