Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Physical partions of Microcontroller Ram

Status
Not open for further replies.

ahmedsaber

Junior Member level 1
Joined
Mar 11, 2013
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Al Jizah, Egypt
Activity points
1,449
hey

i know that the ram divided to many sections like .data , .bss , heap , stack

my question so simple

1 - this partition is physically ? and each program allocates as it needs from each partition

or ram physically nod divided

but each program takes it's space of memory and emulate these partitions ?

thanks
 

The only 'physical' separation for the various sections is between RAM and ROM because the ROM parts are set when the microcontroller is programmed and cannot be changed (or you need to use special techniques to change) later whereas the RAM sections will loose their contents when the power is turned off and need to be established as part of the 'power on' initialisation.
Given those section names I'm guessing that you are programming in a high level language such as 'c'. The runtime of such languages typically include initialisation code that sets up the initial values of global variables, the stack pointer and heap structures etc, before the 'main' (or whatever the first function is called in the langage) routine.
Some microcontrollers do have a dedicated stack (e.g. some of the Microchip PIC12 and PIC16 series devices) which cannot be used for general purposes and can only hold return addresses. However my experience is that the compilers for such devices 'hide' these from you as the programmer to a large extent (just don't try recursive functions!).
Susan
 

Hello!

In addition to what Susan said, there is usually a file which aims at configuring the
different "partitions". Usually, the same file can be used for all the programs you write,
but sometimes, you need to increase stack space, and therefore may need to modify
this file. Another possible application is when you want to set a custom bootloader.
If you don't want the compiler to wipe your bootloader everytime, you need a config
file that will leave the bootloader untouched, and set the program area to another
address.

Dora.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top