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.

Maximum Memory for allocating dynamic memory & Heap ?

Status
Not open for further replies.

agg_mayur

Member level 3
Joined
Feb 25, 2010
Messages
66
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
India
Activity points
1,715
Hi All,

I want to know that what would be the maximum size for allocating the dynamic memory, if i am using any microcontroller for e.g. dsPIC33XXXXXXXXXX?
In addition i want to know that how much i can allocate a heap size?
 

In embedded software usualy it is not used dynamic alocation of memory. Library functions are not supported such as malloc, you have to write them for yourself.
 

Can you please elaborate your answer, i am not getting your point.
 

RAM memory usually is very small (Kbytes) in comparable to computers (Gbyte). Users take's care of every resources very carefully not to wasted. Compiler's for embedded software are build in this manner to optimize code and speed. The connection to hardware is very tide and the user knows exacly where to located his variables.
Memory is organize by linker in sections:
- code sections eg. .text
- ram sections eg. .sda
Concepts such as virtual drivers are not applicable in this conjunction. The only exception that I see is software Java based for mobile phones but this are already high level software. The way I see it, the only standard in embedded software is ANSI C.
 

Actually i read that we should ignore the dynamic memory allocation when we write the software for microcontrollers.. Is it true?
And how we can define the heap size and why we have to define the size for heap. For eg. I have 30K of RAM, then how much size i can allocate to heap and why?
 

Yes, you should ignore dynamic memory allocation.

Provide more information where did you have to set heap size, in what context: compiller, microcontroller and link file.
 

When i am compiling my MPLab(microchip's) code without defining the heap size it gives me the error/linker error, i have to define around 500bytes for heap.
Can you also please tell me what are the advantages & disadvantages for using malloc() function (for allocating dynamic memory) in microcontrollers?
 

When i am compiling my MPLab(microchip's) code without defining the heap size it gives me the error/linker error, i have to define around 500bytes for heap.
Can you also please tell me what are the advantages & disadvantages for using malloc() function (for allocating dynamic memory) in microcontrollers?

It should not give any errors or linker and you do not have to define any heap memory. It is not used in embedded software.
I never used heap memory in embedded. Can you expaint why do you need to define heap memory? You can leave it, learn to use static RAM, are not so many variable in a project.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top