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

c51: accessing absolute memory locations

There are absolute memory macros to access memory addresses in 8051, do we have any such to access externally connected flash through 8051?

I tried using C pointers, it does not seem to be reading the address in flash,
How do we read & write from a memory location?
Please help.

Parents
  • "we write a program in 8051 about accessing the flash. This is stored in 8051 memory."

    Your program is stored in the 8051's CODE address space.

    Your external SST25VF512 Flash chip is connected via SPI; it does not appear in any 8051 address space

    "The addresses where data is to be read & written to in flash is sent through 8051 to flash."

    These addresses refer to locations within the external SST25VF512 Flash chip; they are sent from the 8051 to the external chip via the SPI.

Reply
  • "we write a program in 8051 about accessing the flash. This is stored in 8051 memory."

    Your program is stored in the 8051's CODE address space.

    Your external SST25VF512 Flash chip is connected via SPI; it does not appear in any 8051 address space

    "The addresses where data is to be read & written to in flash is sent through 8051 to flash."

    These addresses refer to locations within the external SST25VF512 Flash chip; they are sent from the 8051 to the external chip via the SPI.

Children
  • Right O boss,

    "they are sent from the 8051 to the external chip via the SPI."

    Could you tell how to send the same via thew SPI,
    is it a different procedure or an extension of the flash program,

    Thanks,

  • "Could you tell how to send the same via thew SPI"

    You already have a separate Thread on that subject.
    Please stick to the subject of the Thread!

    "is it a different procedure or an extension of the flash program"

    SPI is just an interface; you have to write a program to use it - just like you have to write a program to send & receive characters via the UART.

    Your program is stored in the CODE memory space of the 8051.

  • " SPI is just an interface; you have to write a program to use it "

    Could you give some tips as to how to write the same,
    Will this program be different from the one used to access the flash?

  • SPI is a standard interface - so start by looking for the specifications.

    You may well find sufficient detail in the SST25VF512 datasheet.

    Use your favourite internet search engine - there is loads of information already out there!

    There are even examples here:
    http://www.keil.com/download/list/c51.htm

    Once you have worked-out the basics of how to transfer bytes across the interface, then you have to think about what you need to do with those bytes - that is specified in the datasheets for whatever SPI device(s) you are using.

    Again, it's just like using the UART - first you need the basics of how to send & receive a character, then you need to form those characters into whatever commands, responses, etc are required by your application...