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.

read write particular location on External RAM

Status
Not open for further replies.

ermtariq2

Newbie level 4
Joined
Sep 8, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mumbai
Activity points
1,324
Hi all,

can any body help me how to write and read the particular location on external RAM (accessing the memory address ).

I am trying the Code:

#define POSITION 0X12000

void main()
{
unsigned char xdata chr;
unsigned char str;

chr='A'
ram_writep0(POSITION,chr);

str=ram_readp0(POSITION);

}

void ram_writep0(unsigned char posi,unsigned char writechar)
{
SRAMA16=0;
SRAMA17=0;
SRAMA18=0;

DATAPORT=posi;
SEL573L=1;
// _nop_();
SEL573L=0;

DATAPORT=0;
SEL573H=1;
//_nop_();
SEL573H=0;

DATAPORT=writechar;
SELK6=0;
WR=0;
//_nop_();
WR=1;
SELK6=1;
}
unsigned char ram_readp0(unsigned char posi)
{
unsigned char tempdata;
SRAMA16=0;
SRAMA17=0;
SRAMA18=0;

DATAPORT=posi;
SEL573L=1;
//_nop_();
SEL573L=0;

DATAPORT=0;
SEL573H=1;
//_nop_();
SEL573H=0;

DATAPORT=0XFF;

SELK6=0;
RD=0;
// _nop_();
tempdata=DATAPORT;
RD=1;
SELK6=1;
return tempdata;

}

I want to write 'A' on specific location and read it from there....
does i m doing write

Any new method is also welcomed.

Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top