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.

CCS/TMS570LS3137: Mibspi communication ,when to start

Part Number: TMS570LS3137

Tool/software: Code Composer Studio

Hello 

 I dont know when they  start.. I can  send data,and receive data, but when to start in master.

mibspiTransfer??or mibspiIsTransferComplete()??

  • hello 

     and  when send data in slave?

  • Hello 

      I see some paper,that  says mibspiTransfer ,this function send data .is it right?

      but,in my slave  I also use mibspitranfer function,that send data.

      slave dont have clock,master give its clock,why use this function? 

  • Hello,

    In SPI, only Master generates the clock signal (SPICLK). There is always only one master, but there can be multiple slaves.

    When data is sent from the master to a slave, it's sent on SIMO data line (Master Out / Slave In). If the slave needs to send a response back to the master, the master will continue to generate a prearranged number of clock cycles, and the slave will put the data onto SOMI data line (Master In / Slave Out). Because the master always generates the clock signal, it must know in advance when a slave needs to return data and how much data will be returned. 

    Yes, the mibspiTransfer() can be used to transmit data in both master and slave sides. 

    Before master generates the SPICLK, the slave has to copy the data to mibspi RAM (multi-buffered mode) or spiDat1 register first.

  • Thank you

      Now  I use mibspi communication  two cpu  with master and slave.

      question:1. In slave this funciont "while(mibspiIsTransferComplete()==flase);"whether still wait for the master send data,if that the salve can continue execute next code.  ??

                           

  • Hi,

    The INTFLGRDY bit in TGINTFLG register is set when this transfer group has been transferred. But the MibSPI interrupt service routine (ISR) reads the INTVEC0/1 register to check the pending interrupt. Reading those interrupt vector registers will clear the interrupt flag in TGINTFLG register. 

    If you check while(mibspiIsTransferComplete()==flase) inside the MibSPI notification or after, the while() will run forever since the return value is False.

    When INTFLGRDY is set, the slave TG has been transferred, and the master stops generating clock.

  • Thank you 

      I want  to know  the slave wait how much time...(mibspiIsTransferComplete()==flase)

      means slave wait how much time,,

      I see use spiena maybe realize  communation timeout.  FIVE pin operation..

      if Five pin operation 

     1. master  make cs pin low to slave

      2.Slave make pinena low to master ,and how time maser can make clock to slave. is this time can be set??  

        between slave make pinena to  receive clock..

     I see timeout interrupt ,this time can be set???