infineon4engi@twitter twitter

infineon4engineers Facebook

infineon@linkedin linkedin

infineon@youtube youtube

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    New Member New Member tobit is on a distinguished road
    Join Date
    Mar 2019

    XMC4500 relax kit - Spi communication

    Hello, everybody,

    I want to implement the SPI communication to a serial Falsh Memory.
    I took a look at the example of the SPI communication with the flash memory on the XMC4500 relax kit.
    The example works and can also be used for external flash memory, if you set the pin and channel accordingly.

    My question for this, in the data sheet of the two flash memories the bits are transmitted on rising clock edge and read on falling clock edge.
    However, the settings in the SPI master are inverted (transmit on falling clock edge/ receive on rising clock edge).
    Images of the oscilloscope show that the signals are transmitted correctly. But why is the inverted setting correct?

    I wrote a class that implements the SPI communication with the flash memory.
    For a newly created project writing, reading and deleting works. If I copy the class into my current project,
    which contains several processes and apps, only writing and deleting will work, but not reading. The settings are identical for both projects.
    You can see from the oscilloscope images that the clock of a working project pauses after each word and then continues with the next word.
    For the non-functioning project, the query of the status register is functional. However, the data of the memory cannot be read out.
    The oscilloscope images show that the clock is oscillating over the entire receiving time and that the Slave Select does not increase at the end.
    When debugging, this is reflected in the remaining line:

    Sorry for the long text. I hope you can help me with the problem.

    Many thanks and greetings

  2. #2
    New Member New Member tobit is on a distinguished road
    Join Date
    Mar 2019

    It's works now a little bit better.

    I changed the mode from interrupt (as it is in the example code) to direct.
    Deleting works and reading is done for any number of bytes. But writing doesn't work perfectly.
    Depending on how many bytes I write, message is correct. But there is no pattern recognizable.
    256 bytes can be written without errors. At 8, 14 and 41 bytes, however, an error occurs,
    but 7 and 9 bytes can be written again. On the basis of the oscilloscope pictures it can be seen
    that the slave select line goes high in the middle of the data transfer of the payload to be sent.
    The behaviour is not apparent with the other data sets.

    I hope, you have an idea, why it can be.

    Kind regards


All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.

Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.