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.

8051 interfacing with external Ram written in C

Status
Not open for further replies.

taday

Newbie level 6
Joined
Sep 7, 2004
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
93
8051 interfacing to external memory

Dear friends!

I'm using at89c52 & I want to know how can I interface it with external memory .

I'm looking for examples written in C language.

thanks in advance!!!
 

external ram 8051

For writing to external RAM location you can always use the following sequence:

#asm
MOV DPTR, xxxxh ; memory address
MOVX @DPTR, A
...
#endasm

and for reading from external RAM the following:

#asm
MOV DPTR, xxxxh
MOVX A, @DPTR
...
#endasm

DPTR is the microcontroler data pointer, and the MOVX istruction operates with external RAM ..
 
external ram interface with 8051

if you use Keil with xdata parameter like

unsigned char xdata b;

main();
{
ACC = b;
}

result compiler is

MOV DPTR, xxxx
MOVX A, @DPTR
 

external i/o interfacing of 8051

Can somebody please tell me the circuit of interfacing the external RAM to 89c52 .
Thanks
Dinesh
 

external memory ram circuit, 8051

It's a simple circuit. You can use 74HC373 (or 273....hic, I don't understand clearly) to latch DATA from 89C52 to write or read data to/from IC RAM - 6264....
 

how to know ram memory in c language

Hi dinesh322,
please take a look the attachment, it is a minimum system of AT89C51 and I using that board togather with EPROM Emulator. Hope this can help you.



Sis
 
external ram of 8051 using c

taday said:
Dear friends!

I'm using at89c52 & I want to know how can I interface it with external memory .

I'm looking for examples written in C language.

thanks in advance!!!

if you need to write/read external memory without asm pragma please test this sample:

/* test i/o 8255 mapping to 8000H - 8003H */
char xdata PA _at_ 0x8000;
char xdata PB _at_ 0x8001;
char xdata PC _at_ 0x8002;
char xdata CR _at_ 0x8003;

/* dummy data port at external ram from 0000h */
char xdata PA_dummy;
char xdata PB_dummy;
char xdata PC_dummy;

void initPPI()
{ /* set all port for output */
CR = 0x80;
}

void main()
{
/* read port a */
PA_dummy = PA;

/* read port b */
PB_dummy = PB;

/* read port c */
PC_dummy = PC
}

thx
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top