Hi,
I am in very confusion.
Please tell me when to use xdata, pdata in keil.
I searched on the internet but not getting satisfaction.
I am creating program in that i need 100 unsigned character variables.
Can i use xdata for storing these 100 variables?
If yes then how? I am using 89s52 microcontroller.
Is the 89s52 supports xdata,pdata.
Please provide any sample program.
pdata The pdata memory type may be used to declare variables only. You may not declare pdata functions. This memory is indirectly accessed using 8-bit addresses and is one 256-byte page of external data RAM of the 8051. The amount of pdata is limited in size (to 256 bytes).
Variables declared pdata are located in the PDATA memory class.
Declare pdata variables as follows:
Code:
unsigned char pdata variable;
xdata The xdata memory type may be used to declare variables only. You may not declare xdata functions. This memory is indirectly accessed using 16-bit addresses and is the external data RAM of the 8051. The amount of xdata is limited in size (to 64K or less).
Variables declared xdata are located in the XDATA memory class.
Thanks embpic for ur valuable reply.
Please tell me one more thing that you said external data ram means interface another ram ic to microcontroller OR microcontroller itself external data ram.
I am using microcontroller at89s52 is this ic supports for xdata and pdata?
Thanks embpic for ur valuable reply.
Please tell me one more thing that you said external data ram means interface another ram ic to microcontroller OR microcontroller itself external data ram.
I am using microcontroller at89s52 is this ic supports for xdata and pdata?
Unfortunately some previous suggestions are misleading.
AT89S52 has only 256 Bytes of built-in RAM. It will be accessed as data and idata respectively. Some X51 chips have additional internal RAM that can be used as xdata memory, but not AT89S52. If 256 Bytes aren't enough, you have to connect external memory through the databus ports as explained in post #4.