We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Ken, I understand that the 8051 has 256 bytes of internal data. Well, after declaring variables and array's, I get the error
*** ERROR 107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: _DATA_GROUP_ LENGTH: 0062H Target not created
GetMACInput(strSrcDest); printf("MAC Address......... "); printf("%02X:", strSrcDest->SrcMAC1 >> 8); printf("%02X:", strSrcDest->SrcMAC1 & 0x00FF); printf("%02X:", strSrcDest->SrcMAC2 >> 8); printf("%02X:", strSrcDest->SrcMAC2 & 0x00FF); printf("%02X:", strSrcDest->SrcMAC3 >> 8); printf("%02X", strSrcDest->SrcMAC3 & 0x00FF); printf("\r\n");
Hi, I am programming in C. I've never looked at registers or Memory space. Is there a way to figure it out in C, without actually looking at registers and Memory space? In order for me to use the maximum amount of internal ram, Maybe I can somehow figure out how much ram space my code is actually taking without debugging and looking at memory space? I don't exactly know how to figure out how much space the stack is taking? How much memory does each call to a function take up? Does it make a difference if the function returns a int, rather than a void? Thanks for your help,
"Maybe I can somehow figure out how much ram space my code is actually taking without debugging and looking at memory space?" Have the linker process output a memory map file. The memory map will show you how much of what memory space is used.
"I am programming in C. I've never looked at registers or Memory space." To program a microcontroller in any language, you MUST fully understand the hardware. You need to read the datasheet for your device. "Maybe I can somehow figure out how much ram space my code is actually taking without debugging and looking at memory space?" If you take a look at the .cod or .lst file assembler outputs in conjunction with the function call tree in the .map file I think you could figure out worst case stack usage by adding two bytes per function for the deepest level of nesting, than adding all the registers pushed in each ISR. Stefan