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.

how to access memory location in embedded c?

Status
Not open for further replies.

hiren_dave

Member level 1
Joined
Jul 3, 2012
Messages
40
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
AHMEDABAD,INDIA
Activity points
1,535
hi.

i want to know that how to access memory location in embedded c?

i have 1 register a and i want to store this in memory location 0x501 than how should i defined??
 

Joined
Jul 25, 2012
Messages
1,192
Helped
171
Reputation
342
Reaction score
162
Trophy points
1,343
Activity points
0
Do you mean writing to eeprom? Which mcu are you using?
 

Joined
Jul 25, 2012
Messages
1,192
Helped
171
Reputation
342
Reaction score
162
Trophy points
1,343
Activity points
0
Are you writing 8-bits?

I think you can write like

Code:
unsigned char *ptr = 0x501;

*ptr = ADCON0;

writing ADCON0 register to address 0x501.
 

Kurenai_ryu

Advanced Member level 2
Joined
Jun 10, 2006
Messages
671
Helped
159
Reputation
316
Reaction score
99
Trophy points
1,308
Location
Bolivia
Activity points
5,911
mmm i think you need to define which memory is it...
0x501 for a 8051 seems external ram so you should define your pointer as xdata...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top