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
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!!!
 

IanP

Advanced Member level 7
Advanced Member level 7
Joined
Oct 5, 2004
Messages
7,929
Helped
2,311
Reputation
4,624
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
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 ..
 

suromenggolo

Advanced Member level 4
Full Member level 1
Joined
Feb 25, 2005
Messages
107
Helped
9
Reputation
18
Reaction score
0
Trophy points
1,296
Activity points
2,240
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
 

dinesh322

Newbie level 3
Newbie level 3
Joined
Mar 27, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
external i/o interfacing of 8051

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

elchula

Member level 3
Member level 3
Joined
Mar 16, 2005
Messages
66
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,846
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....
 

SISWANTO

Advanced Member level 4
Full Member level 1
Joined
May 14, 2001
Messages
107
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
Nirwana
Activity points
877
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
 

bsiswoyo

Member level 5
Member level 5
Joined
Jul 27, 2001
Messages
86
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
INDONESIA
Activity points
1,123
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top