This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI Flash - Data logging.

Other Parts Discussed in Thread: ADS7844

Hi,

I am learning about writing and reading data to/from SPI Flash using the EVM board from LogicPD, with a C6748 SOM. I am using a tutorial example - spiSample_io.c from TI.

I would like to know how those macros definitions such as SPI_CHIPSELECT_SPIFLASH, SPI_FLASH_ADDR_MSB1, etc. that defines the flash addresses, and the SPI Flash opcodes work. I don't find any information how the definitions were derived, e.g. why SPI_FLASH_SECTOR_ERASE is defined as 0xD8? What I see is that this are all nicely setup and passed to the GIO_write() via the dataparam structure.

Could you lead me to some relevant documents to this tutorial? Or you could explain to me here in the forum. Really appreciate it. This exercise is very important as I have a project that requires me to perform data logging onto a SPI Flash.

Thank you and best regards.

Chee-Beng

  • The definitions are derived from the SPI device you are interfacing with. For example, the SPI flash on the SOM has a list of instructions it recognizes. These are listed in the datasheet for the SPI flash (search Google for "m25p64").

    The instructions are pretty universal and are the same for most SPI flash devices.

    Jef

  • Hi Jeff,

    I am terribly sorry for not replying to you early. I had managed to develop my data logger with your help. Thank you so much.

    I wonder would you know where can I get information on how to develop the SPI program to interface with TI's ADS7844? I had run a search in this forum on ADS7844 but came up with nothing.

    Your help is very much appreciated.

    Thanks.

    Chee-Beng

  • You should post this as a separate topic rather than at the end of this one, and we can address it there. Thanks

    Jeff

  • Hi Jeff,

    I had managed to come up with a data logger that logs data into SPI Flash using the C6748 EVM board. However, I had a little problem which I have been struggling to solve. Hope you can help.

    I tested my program that first wrote to the Flash and then read from it. No problem. Everything was perfect. However, when I tested it another way, I didn't work. In this way, I first wrote data to the Flash with one program. Then, I loaded another program which just read from the Flash. It read everything 0xFF (seems like the Flash has been erased). I've already made sure that the memory segment I read from is the same as the one I wrote into.

    I suppose the Flash in the EVM should be non-volatile, and it will store the data previously written permanently.

    I really appreciate you could help me. Thanks.

    Chee-Beng

     

  • Hi Jeff,

    I had found the answer to my problem described above. It was a silly mistake from me. I failed to ensure the ChipSelect was on for the SPI Flash during the read function.

    Thank you anyway.

    Chee-Beng