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

mapped i/o versus internal ram

I'm using the Philips 89c51RD which has 1KB RAM. I also have some devices mapped from 0x0000 to 0xFEFF, I'm acessing these devices using "XBYTE[DEVICE_ADDR]=DEVICE_DATA" (where DEVICE_DATA is the address of the memory mapped i/o and DEVICE_DATA is the data byte wrote to the specific device).

The questions are:
1) Is there some way of using the entire 1KB extended RAM and not drive the A15 to A8 pins low(I'm using these pins for address decoding)when accessing the extended ram?


2) Otherwise, is it possible to configure the address range of the internal (extended)memory (xram) to start at 0xFF00 (with only 256 length in this case) so I can guarantee that the external pins A15 to A8 never goes low when accessing ram memory? How can do that, just setting startup.a51?

Thanks,
Fernanda.

Parents
  • Yes, but can the device not drive the ports based on the address? The EXTRAM bit looked like all-or-nothing to me.

    I suppose you could write a slightly more complex routine for device access:

    ; U8 ReadHw (volatile U8 xdata* addr)
    PUBLIC _ReadHw
    _ReadHw:
        ; mask interrupts
        PUSH IE
        SETB EA
    
        ; enable external bus
        PUSH AUX
        SETB EXTRAM
    
        ; read external HW byte
        MOV  DPL, R7
        MOV  DPH, R6
        MOVX A, @DPTR
        MOV  R7, A
    
        ; restore original state
        POP AUX
        POP IE
        RET
    

    to flip the bit back and forth as necessary for each access.

Reply
  • Yes, but can the device not drive the ports based on the address? The EXTRAM bit looked like all-or-nothing to me.

    I suppose you could write a slightly more complex routine for device access:

    ; U8 ReadHw (volatile U8 xdata* addr)
    PUBLIC _ReadHw
    _ReadHw:
        ; mask interrupts
        PUSH IE
        SETB EA
    
        ; enable external bus
        PUSH AUX
        SETB EXTRAM
    
        ; read external HW byte
        MOV  DPL, R7
        MOV  DPH, R6
        MOVX A, @DPTR
        MOV  R7, A
    
        ; restore original state
        POP AUX
        POP IE
        RET
    

    to flip the bit back and forth as necessary for each access.

Children