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.

Estimating RAM size of MCUs

Status
Not open for further replies.

ivar

Junior Member level 1
Joined
Jun 29, 2008
Messages
18
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,418
My controller has 32KB flash and a 2KB Ram.

When built on the IAR embedded workbench, my program gave the following outputs:

2 254 bytes of CODE memory (+ 3 absolute )
0 bytes of DATA memory (+ 22 absolute )
211 bytes of IDATA memory

When i see the hex file size, its 7KB.

1.Why doesn't the CODE+DATA+IDATA add up to 7KB?

2.If i am right, all of the 7KB is stored in the flash. How do I decide how much RAM my program would need?i.e if I choose a MCU with only 127bytes of RAM, would my program still run on it?
 

don't forget that any Hex-file is coded in ascii, with an START character ":", 2-char size, 4-char address 2-char reg type, and lastly 2-char checksum... every 16 bytes... (common, could be anything as in 2-char size)

also, the hex file ONLY contains data from CODE section (and eeprom section depending the uc)
...

if you program on assembler, mostly, you control and decide which ram address use, but if you use C or Basic, the compiler decides how and howmuch memory it will use...

if it says 211 Bytes of IDATA, it will not go into a Microcontroller with only 127 Bytes, it can work at first sight, but when it will try to use those higger addresses, it will: rewrite lower addresses, or hang up, or restart by it self...

if you need to put that program in a micro with lower ram, you should compile it for that new micro. if the compiler can re-arrange the memory address and maybe it can fits in... but do not program the hex file directly!!!!!!
 

Hi,

Thanks for the reply. I still have some queries: If the hex file contains only CODE, where is the info about the DATA maintained? All i give to my programmer is the hex file dump.

What exactly is inside a hex file? Is it just the machine code of the assembler mnemonics? or does it contain 'extra info' that a programmer 'understands' and then puts the appropriate machine code into the controller's memory?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top