hello, i'm using AT80C31X2 uC. Keil V3.33 i've declared an array as follows:
unsigned char pdata array_1[8][16];
i got an error code "error C241: 'main': auto segment too large" I've tried to work in compact rom code size and declarde the arrat as follows:
unsigned char pdata array_1[8][16]; unsigned char data *p1; p1 = &array_1[0][0]; unsigned char code numerics[] = { 0x00,0x00,0x3c,0x7e,0x66,0x66,0x66,0x66,0x66,0x66,0x7e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x66,0x66,0x7e,0x7c,0x60,0x60,0x7c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x66,0x66,0x3c,0x7c,0x66,0x66,0x7e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x7e,0x60,0x60,0x60,0x60,0x30,0x18,0x0c,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x46,0x06,0x3e,0x7e,0x66,0x66,0x7e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x7e,0x06,0x06,0x7e,0x7e,0x60,0x62,0x7e,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x7e,0x7e,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x42,0x60,0x78,0x38,0x60,0x66,0x7e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x42,0x60,0x30,0x18,0x0c,0x06,0x7e,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x38,0x3c,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x7e,0x66,0x66,0x66,0x66,0x66,0x66,0x7e,0x3c,0x00,0x00,0x00,0x00 }; for (z = 0; z < 16; z++) { // scan all rows *(p1 + z) = numerics[z + sd0]; *(p1 + 16 + z) = numerics[z + sd1]; *(p1 + 32 + z) = numerics[z + md0]; *(p1 + 48 + z) = numerics[z + md1]; *(p1 + 64 + z) = numerics[z + hd0]; *(p1 + 80 + z) = numerics[z + hd1]; } for (z = 0; z < 16; z++) { P1 = *(p1 + 16 + z); }
Only in simulation the values in the array are passed to P1 correctly. I read all the manuals of Keil and search the forum but still can't figure why it doesn't work. in real i recieve an address from 9 to F. any suggesion please.
unsigned char disp[15][25];
That is neither dynamic nor 3D!
And why global "of course" ?
you right. 2D. it needs to be global type variable. still not enough room.
You didn't answer the question: can it go into CODE space?
If not, you'll just have to provide more RAM - either a different chip with (more) internal RAM, or add external RAM.
i'm sorry i didn't see the question.
it can go into CODE space only if i can modify the values there (by tricks or something), if not then i'm guessing external RAM is the only way.
i thank you very much for your help forum. still i have much to learn...
CODE space is read-only
"if not then i'm guessing external RAM is the only way"
Unless you get a processor with sufficient internal RAM...
Start with the so-called "bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Here are some other introductory & reference materials: http://www.keil.com/books/8051books.asp www.8052.com/books.phtml www.8052.com/tutorial.phtml
You will need to read the Data Sheet for your particular processor