I am beginner.Can you help me with using XRAM memory in this microcontroler? Can you write mi easy and objective example how write to XRAM and read from XRAM in C language? Or existing any routine with any methods for this operate?Than you very much! Ales
Can you write mi easy and objective example how write to XRAM and read from XRAM in C language? I could, but not half as well as the manual
Erik
I am study datasheet, but I am not know about well. There is not it what I whant. I would like example in C language.(I am beginner). Thanks
You don't need the datasheet for this; the datasheet is the definition of the chip's physical behaviour.
What you need it the Compiler Manual; specifically:
http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm
http://www.keil.com/support/man/docs/c51/c51_le_extdatamem.htm
http://www.keil.com/support/man/docs/c51/c51_le_xdata.htm
Note that plenty of examples are provided in the Keil\C51\Examples folder as part of your C51 installation
Please also be sure to study the Getting Started guide and work through the examples provided:
http://www.keil.com/support/man/docs/gs/ http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm http://www.keil.com/support/man/docs/uv3/uv3_examples.htm
You should probably also get yourself a good book (or books):
http://www.keil.com/books/
So, my test with XRAM is functional on example code (Keil\C51\Examples\FarMemory\3 XData Areas on T89C51RD2), but why I can use only max 1024B XRAM in this example? I look on datascheed and there is any AUXR register which this max value change, but I dont know use it in example. Can you help me how change on max value XRAM (1792B)? Thank you very much!
You don't need Far memory for this at all!!
Did you read those manual sections? All you need is the xdata keyword and, possibly, to set the necessary SFR bits to physically enable the XDATA RAM.
OK. When I use e.g. unsigned char xdata test[1024], so compilation pass OK. When I use e.g. unsigned char xdata test[3000], so compilation pass OK too. But XRAM has max value 1768B or no??. How I know that is OK?? I am sorry, that I have trivial questions, ale I am begginer :-(
The Compiler knows nothing about your target hardware - so it has no idea how much XRAM it has. Also, the Compiler sees only 1 source file at a time - so it doesn't know what else may or may not be consuming RAM. That's why the Compiler can't give you any warnings about things like whether or not your code will actually fit into your particular target.
The Linker is what actually assigns addresses to code & data items; so the linker can warn if you overflow your physical capacities - but only if you correctly tell it what those capacities are!
You tell the Linker what your target's capacities are via its command-line options - or via your Project Configuration, if you're using the GUI.
The tutorials cited earlier walk you through the process of configuring a project - have you done the tuorials yet?
I want using internal XRAM (as classic RAM memory), no external XRAM.
Note that it doesn't matter if the extra memory is internally or externally - the processor still has different instructions to access different classes of memory. XDATA will requre other instructions than DATA.
That doesn't actually make any sense in the 8051 architecture!
For details of the 8051 architecture, see the links here to the so-called "bible" for the 8051: www.8052.com/.../120112
Tutorials here: http://www.8052.com/tutorial
Books here: http://www.keil.com/books/8051books.asp
Also see this thread: http://www.keil.com/forum/docs/thread15878.asp
giving you "example in C language" would get you going for about 2 minutes.
till you have read "the bible" (several times) and worked through (I did not say 'read') the "getting started guide" 'helping' you will be futile.
OK, thank you for information....I go to studing and studing and testing and testing...
testing and testing...
do not maske the mistake of "testing to find out what works" that is NOT 'testing' that is bungling your way through. By that method you will never find out if something is right, only if "it works under these specific circumstances". I can't count the posts "why does this working design not work"
The purpose of testing is to see if you have made a mistake in implementing something you, based on what you have learned, know works if implemented right.