This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

XRAM not cleared, variables not assigned

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.

Parents
  • 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.

Reply
  • 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.

Children