i am using keil microvision 2 . i want to interface 64kb sram with 8051 suggest me code . i know hardware interfacing but i am confused among xdata ,compact,small,large memory models suggest me how to use this with example.
It seems that you want to use this 64kb SRAM as your external ram.If you have connected it to your MCU in hardware.You can just use it and just need a little setting: Open your project with uV2.Enter project/options for target 'target 1' (for example,replace 'target 1' with your own target name) set the Off chip XDATA memory option according to your hardware connection. Then you can set the Memory model to anyone of the small,compact,large. Their differs in memory allocation during compiling.You can refer to the c51.pdf or gs51.pdf to get a cleaner understanding.
"i am confused among xdata, compact, small, large memory models" XDATA is not a memory model - it's an address space. Keil uses "XDATA" to mean "memory accessed by using the MOVX instruction" So your external SRAM will be all XDATA. To have the compiler put variables into XDATA (and, thus, into your external SRAM), define them with the xdata keyword. For details, see the C51 Manual compact, small, and large are Memory Models. The Memory Model defines the default location for variables when you don't explicitly state a memory space. It's also where the compiler will put function parameters, etc. Again, this is describes in the the C51 Manual
http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm
Andy, what a nice post. Now I wonder, when will Pranam be back with a question "where in the manual ios?" Erik
"when will Pranam be back with a question 'where in the manual is?'" Here: http://www.keil.com/forum/docs/thread7377.asp And here: http://www.keil.com/forum/docs/thread7410.asp#msg34248