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

mapping SFR space

How would I locate a structure to coincide with the beginning of SFR space for the 8051? address 0x80 of directly assessible data memory.

We are using a core8051 (inside an FPGA), and the core8051 lets us map external events to SFR space. So it would be very convienent to define a structure which allows us to more easily access all of SFR space. (we take care not to "stomp" on already defined SFR registers.

How can I do that?

Thanks

Parents
  • Then a FIFO may be the fastest way to read the data. And, you don't need to worry with indexing thru SFRs. For example:

    sfr FIFO_RESET = 0x??;
    sfr FIFO_READ  = 0x??;
    
    unsigned char xdata buffer [0x2000];
    
    void func (void)
    {
    unsigned char xdata *bp;
    
    FIFO_RESET = 1;
    for (bp=buffer;
         bp < &buffer[sizeof(buffer)];
             *bp++ = FIFO_READ);
    }
    

    Jon

Reply
  • Then a FIFO may be the fastest way to read the data. And, you don't need to worry with indexing thru SFRs. For example:

    sfr FIFO_RESET = 0x??;
    sfr FIFO_READ  = 0x??;
    
    unsigned char xdata buffer [0x2000];
    
    void func (void)
    {
    unsigned char xdata *bp;
    
    FIFO_RESET = 1;
    for (bp=buffer;
         bp < &buffer[sizeof(buffer)];
             *bp++ = FIFO_READ);
    }
    

    Jon

Children
No data