xylon89del
Member level 3
Hi all,
FYI, the chip used is PIC18F4550.
The compiler used is C18 Compiler.
I am using a udata variable for example:
then, in the main function, i initialize it :
However, when I want to get the output
of table_ptr[a], which should be table_ptr[57] , since I set a to 57.
The output I get instead is
table_ptr[441], where 441 is 1,1011,1001b
I have spent my whole day debugging this problem.
I am very sure that I didnt set the variable to 441 in anywhere in the codes.
Hope you guys can help!
FYI, the chip used is PIC18F4550.
The compiler used is C18 Compiler.
I am using a udata variable for example:
Code:
#pragma udata LARGE_MEMORY
unsigned char INPacket[512];
#pragma udata
unsigned char *table_ptr=&INPacket[0];
int a;
then, in the main function, i initialize it :
Code:
a=57; //0011,1001b
However, when I want to get the output
of table_ptr[a], which should be table_ptr[57] , since I set a to 57.
The output I get instead is
table_ptr[441], where 441 is 1,1011,1001b
I have spent my whole day debugging this problem.
I am very sure that I didnt set the variable to 441 in anywhere in the codes.
Hope you guys can help!
Last edited: