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
  • "i haven't tried it on simulator, instead i am trying this code directly on hardware each time i proramme it"

    And you say it's driving you crazy - so don't do it!
    Unless you have a chip with on-chip debug - in which case, use it!

    IF you can reproduce the problem in the simulator, it will be much easier to debug; if you can't, it most likely means that you have a hardware fault, misconfiguration, or your interfacing is bad.

    "you have any suggestion?"

    I'm still waiting for your response to my previous questions & suggestion:

    Have you looked in the map file & verified that the code constants are being placed in a sensible location?

    Are you getting any errors or warnings during the build?

    Post the smallest complete program that illustrates the problem.

Reply
  • "i haven't tried it on simulator, instead i am trying this code directly on hardware each time i proramme it"

    And you say it's driving you crazy - so don't do it!
    Unless you have a chip with on-chip debug - in which case, use it!

    IF you can reproduce the problem in the simulator, it will be much easier to debug; if you can't, it most likely means that you have a hardware fault, misconfiguration, or your interfacing is bad.

    "you have any suggestion?"

    I'm still waiting for your response to my previous questions & suggestion:

    Have you looked in the map file & verified that the code constants are being placed in a sensible location?

    Are you getting any errors or warnings during the build?

    Post the smallest complete program that illustrates the problem.

Children
No data