Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC udata initialization

Status
Not open for further replies.

xylon89del

Member level 3
Joined
Jul 18, 2009
Messages
65
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Malaysia
Activity points
1,743
Hi all,

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:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top