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.

C5505 SPI

In all my previous usage of SPI ports they were all implemented as full duplex devices so you could transfer data in both directions at the same time using one charter worth of clock. When the master wanted to transfer data to the slave in also transferred the same number of bits from the slave. This is due to the circular shift registers used in the SPI implementation.

 

In the C5505 DSP the SPI implementation suggests that it is a half duplex device. Looking at Application note SPRUFO3 there are only two commands for transferring data across the SPI device command 1 for READ and command 2 for WRITE command 3 is reserved. Also the software examples for transferring data, Figure 10 on page 17, are written to only read or write data not do both on the same frame.

 

When using devices like a SPI EEPROM it is true that a half duplex exchange of data is all that is needed but when transferring data between two processors a full duplex exchange can double the data transfer.

 

When the SPI is used as an inter processor port and both device want to transfer data it is unclear to me how the slave device knows the difference between a master write and a master read. I also do not understand the functional differences between command 1 READ and command 2 WRITE with the respect of the three SPI lines MOSI, MISO and SCLK    

  • Hi Russell Barr,

    I am sorry for the confusion. The SPI in the C5505 supports full duplex data transfer. It wrires and reads data at the same time. There is no difference between the read and the write command. You can use either of them and they will do the same thing. Please note that the SPI in the C5505 has only one data register for both writing and reading. In other word, the data you write to the data register will be replace by the data the SPI bus reads from the MISO line after each data transfer, so you need to make sure you read before writing new data to the data register at each SPI data transaction.,

    Please let us know if you have further quesitons.

    Best Regards,

    Peter Chung

     

  • Hi peter

    I have some questions about SPI peripheral

    1) For transmitting data should i use read or write command in a for loop?  For example sending and receiving 8 bit character  should i have  two read command one for shifting read command second for receiving bits from eprom?

    2) How many seconds should we wait for read command?

     

    Thanks

  • You need one command for sending and receiving one word (it can be a 8-bit character). Liike I said earler, read command and write command are the same basically, so you can use either one. Word size can be programmed and one command is required to send or receive one word. It is hard for me to answer the for loop question, it will be depening on your programming style and your applicaiton. What I am saying is it is up to you.

    How long should wait? It depends on your clock rate. You should set up the SPI interrupt or monitoring BUSY bit rather than just waiting.

    Thanks

  • Thank you very much for your helping i solved my problem