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,
I'm wondering if I am doing something wrong here. I am trying to store an array for a large 256 byte look-up table.
I have a pretty small 8051 MCU of 8 KB flash memory (IROM), 256 bytes internal RAM (IRAM) and 256 bytes on-chip external RAM (XRAM).
Prior to adding this look-up table, my current build from Keil reports:
"Program Size: data=54.1 xdata=0 code=1984"
I take that to mean I am using 54 bytes of IRAM, 0 bytes of XRAM, and 1984 bytes of IROM?
Here is the variable declaration I am using:
code unsigned char CRC8LookupTable[256];
When I define the CRC8LookupTable and populate values, I get the Segment Too Large error.
If you use "code" doesn't that store the values in ROM, which I should have plenty of space for?
Is there something else I need to add to that variable declaration?
Thanks -Tim
You mean a tentative definition.
A tentative definition is a declaration that may or may not act as a definition.
YOU'VE NOW FINALLY READ ABOUT THEM MR NEIL? SEE EXTERN IS ***NOT*** NEEDED. WELL DONE.
@Andrew
You are correct, I mistyped all that. Tenative definitions -- that are in my header declarations (there is a mouthful).
What a language C is. I have a brother who was a decent web programmer, and now is a very good securities lawyer. Frigging exact same thing, very technical language with exacting logic. Except securities contracts are written in English vs. C.
I miss the good old days of PHP & Python -- now that is an easy language compared to C.
I appreciate the help. Seriously.
I TREAT C AS A TOOL. I THINK I KNOW ENOUGH TO GET THE JOB DONE BUT SURE OF COURSE SOME PEOPLE WILL ARGUE I DON'T KNOW ENOUGH.
IT IS GOOD TO KEEP GOOD MANUALS TO HAND TO CHECK THINGS RARELY USED OR EASILY FORGOTTEN.
ALWAYS GOOD TO LEARN FROM OTHERS AND ACKNOWLEDGE ***GOOD*** ADVICE.
C IS NO MORE DIFFICULT THAN MANY OTHER LANGUAGES. JUST LIKE OTHERS, PRACTICE IS IMPORTANT.