Pic 18f4685 RAM Memory

Status
Not open for further replies.

nimm

Newbie level 3
Joined
Dec 1, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
Hi all,

please help me, I want to write some values in ram in a specific location.

like ( x=4 in specific location)

I'm using Mplab with c18 compiler

thanks
 

Hi,

For that purpose "pragma" directive is used.

As an example;

#pragma udata specific_loc_var=0x100
char user_c1,user_c2;
int user_i1,user_i2;

This will start allocating variables from ram location 0x100,
2 single-byte variables (user_c1 and user_c2)
then 2 double-byte variables (user_i1 and user_i2)
All those are in consecutive manner. (ie start in 0x100 end at 0x106)

Thank you,
 
Reactions: nimm

    nimm

    Points: 2
    Helpful Answer Positive Rating
to DineshSL thank you, it is helpful
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…