I have variable called ADC0 which is assigned to AN0. Value of AN0 is divided by 5 so 0 - 255 = 0 to 51 so that means LUT from pos 0 to pos 51 will be read.
all Lut (pos 0 to 50 ) are read ok. Problem is for some reason if looking up the value of pos 51 LUT, then the look-up table of a different Variable is always returned.
eg if got
Code: Select all
rom char* std155_rpmf1 =
{
117,122,127,132,137,142,146,149,152,155,158,160,163,166,169,172,174,177,180,183,186,189,192,195,198,201,204,207,209,212,215,218,222,226,229,233,236,240,244,247,251,254,26,26,26,26,27,27,27,27,28
};
rom char* std155_rpmf2 =
{
108,110,115,120,125,130,134,137,140,143,146,148,151,154,157,160,162,165,168,171,174,177,180,183,186,189,192,195,197,200,203,206,210,214,217,221,224,228,232,235,239,242,246,246,248,250,254,26,26,26,26
};If ADC0=51 then the next look-up value table is retrieved in this case 108 is retrieved.
Even if I add more numbers on to the end of rom char* std155_rpmf1, 108 is still retrieved.
I have followed ASM in a simulator and for some reason when ADC0 is 51, W reg which is moved to PCL makes the PC jump to label of rom char* std155_rpmf2 hence retrieving the first value, instead of pointing to pos 51.
Any ideas why please or even how to solve this issue?
Thank you