We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
im using a phillips 89c668 uC with 64k on chip ROM and 8k on chip XRAM. keil has been setup to use the on chip XRAM. AUXR is set to 0. startup.a51 has been modified to include the foll XDATASTART EQU 0H ; the absolute start-address of XDATA memory XDATALEN EQU 1EFFH ; the length of XDATA memory in bytes. this should clear the XRAM, however when i display the contents of a variable that i assign 0 during declaration, it shows garbage. hence neither is the XRAM being cleared, nor is the assignment during declaration taking place.
The physical location of the "external" RAM doesn't matter. It's called "external" because of the design of the original 8051. Often, you have "external" RAM integrated onto the same die as the processor core and sold in a single package, but as far as the processor core is concerned, it's still "external". Xdata really means "not the 128/256 bytes of directly/indirectly addressable RAM that you can only access via the DPTR by using a MOVX instruction.". If you have both sorts of memory, then there's likely some part-specific registers you initialize to select whether you're using the on-chip xdata or the off-chip xdata. Earlier posts discuss that. Since the initializer shown above is { 0, 0, 0 }, it doesn't really matter for this case if you leave out INIT.A51. The memory will be initialized to 0 by the STARTUP.A51 code anyway.
"If you have both sorts of memory, then there's likely some part-specific registers you initialize to select whether you're using the on-chip xdata or the off-chip xdata." Yes - that's why I said earlier, "Note that the memory settings in uVision do not generate any code to configure the target processor. You have to add that manually - and startup.a51 would be a very good place to do it."
thanks all u guys for helping out...started searching for the startup.a51 additions and found this: http://www.keil.com/support/docs/1978.htm solves my problem...also understood the need (or the lack of it in my case) for init.a51 thanks once again