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.

TMS570LS1224: MIBSPI how to receive multiple bytes from slave

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Hi, all. I am working on the Microcontroller access the Micro SD card. And I have 2 questions :

  1. This is a general SPI question, please check whether my understanding is correct for this board :

       SOMI is pulled high during the SIMO transmission. Slave is supposed to transmit its data after the SIMO is end. Master should generate extra clocks to allow slave transmit its data. Is this correct?

  2. For the MIBSPI

      If slave transmit back multiple bytes of data, say, 6 bytes, then, master is supposed to generate 6 * 8 = 48 clocks after SIMO ends. However, when I read the SPI module, the received data goes to RX-BUF and SPI-BUF, which are just 4 bytes. I know MIBSPI has a RAM area that stores data, we could access it through TG start address. But I think it is only the transmit data, not the received data. Where does received data go? And how to access?

  Thanks for patient.

  • Hello Joe,

    1. SPI master does not have to generate extra clock cycles for slave to transfer data. The SPI can transmit data when teh SPI master transmit the data (real data or dummy data).

    The SPI can be configured via SW to operate as either a master or a slave. In slave mode (MASTER=0, and CLKMOD=0), data shift out on the SPISOMI and in on the SPISIMO pin. The SPICLK pin is used as the input of the serial shift clock which is supplied from the external SPI master. The SPI slave is not able to transfer data without this clock. Data written to teh SPIDAT0 or SPIDAT1 register is transmitted to the network when the SPICLK signal is received from the SPI master. To receive data, the SPI slave waits for the master to send the SPICLK signal and then shifts data on the SPISIMO pin into the RX shift register. If data is to be transmitted by the slave simultaneously, it must be written to the SPIDAT0 or SPIDAT1register before the beginning of the SPICLK signal.

    2. If the slave wants to transmit 6 bytes, and master needs to generate 48 clock signals. 

    To use MIBSPI, please refer to the mibspi sample project generated through HALCoGen: