This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

look up table

i am trying to use code memory space to store some constants patterns. to do this, i have defined an array in code memory space as follows:

unsigned char code A[]={0x00,0x3F,0x50,0x90,0x50,0x3F,0xAA};

it doesn't work at all or sometimes i get unpredicted results. but when i define the array in data memory and initialize the array as follows. can anyone help me? thanks

A[1] = 0x00;
A[2] = 0x3F;
.
A[6] = 0xAA

Parents
  • dear Andy Neil
    i am so thankful to youR attention, i checked startup.A51 to see if there is any option to manipulate the enternal code memory of 8051 for initialization, and there is no such option so far as i can see, so tell me if i am making a mistake, and then, this code is perfectly working well when i am initializing the array element by element in AT89C52 internal RAM, but because of the volume of data, i have no other option except using the code space. i even translated the C51 code i had written to assembly all by hand and it worked, but because of some complexities, it's not possible to wtire the entire code in assembly, i am looking forward to hear from you, thanKs.

Reply
  • dear Andy Neil
    i am so thankful to youR attention, i checked startup.A51 to see if there is any option to manipulate the enternal code memory of 8051 for initialization, and there is no such option so far as i can see, so tell me if i am making a mistake, and then, this code is perfectly working well when i am initializing the array element by element in AT89C52 internal RAM, but because of the volume of data, i have no other option except using the code space. i even translated the C51 code i had written to assembly all by hand and it worked, but because of some complexities, it's not possible to wtire the entire code in assembly, i am looking forward to hear from you, thanKs.

Children