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

Regarding 8051 RAM Memory and SFR memory

In 8051 RAM size is 128 bytes which is divided in to 3 areas like register bank ,Bit addressable are and scratch pad area. what is the location for SFR ? many literature stating that 8051 has 256 byte memory in it 128 byte for general purpose and rest 128 for special purpose which one is true ? i am confused about
(1)what is the RAM size of 8051 weather 128 bytes or 256 bytes?
(2) if the RAM size is 128 bytes what are location for the SFR ?

Parents
  • While there exists 8051 chips that might have 64 or 128 bytes of internal RAM, the majority of 8051 models have 256 bytes of RAM.

    It looks like below:

            SSSSSSSS = 128 byte SFR on top of the upper address range of RAM
    RRRRRRRRRRRRRRRR = 256 byte RAM
    


    The address range 0x80..0xff has overlapping RAM + SFR.
    So indirect accesses will reach the RAM "under" the SFR region.
    Direct accesses will reach SFR addresses.
    And for the address range 0x00..0x7f you can use byt direct and indirect accesses.

    To make life even more interesting, some 8051 chips also has multiple pages of SFR because they have too many timers, UART, ... to control with just 128 bytes of SFR region, in which case the code must first "bank-switch" the correct SFR page before accessing some of the SFR functionality.

Reply
  • While there exists 8051 chips that might have 64 or 128 bytes of internal RAM, the majority of 8051 models have 256 bytes of RAM.

    It looks like below:

            SSSSSSSS = 128 byte SFR on top of the upper address range of RAM
    RRRRRRRRRRRRRRRR = 256 byte RAM
    


    The address range 0x80..0xff has overlapping RAM + SFR.
    So indirect accesses will reach the RAM "under" the SFR region.
    Direct accesses will reach SFR addresses.
    And for the address range 0x00..0x7f you can use byt direct and indirect accesses.

    To make life even more interesting, some 8051 chips also has multiple pages of SFR because they have too many timers, UART, ... to control with just 128 bytes of SFR region, in which case the code must first "bank-switch" the correct SFR page before accessing some of the SFR functionality.

Children