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.

mibSPI on LS3137 does not receive data

Other Parts Discussed in Thread: HALCOGEN

I have a design that requires a data stream from custom hardware to be received over mibSPI on a LS3137 device. I have prototyped this using a simple wire 'loopback' test on a LS3137 dev board where mibSPI3 (as master) transmits data and mibSPI5 (as slave) receives data.  Connections used are clk, cs0 and mosi from master to slave (slave to master data is not needed).  Hardware configuration is setup using HALcodegen.  A periodic loop sends data on mibSPI3 and receives on mibSPI5.

 

I have put a scope on the wires to confirm that cs0 (active low), clk and mosi from mibSPI3 are working as expected; all looks good. The problem is that no data is received on mibSPI5.  I have searched other posts to try and find anything that might help.  I have checked that PINMUX settings are as required and confirmed that level changes on the wires are getting through to the DIN register.  I have tried endless configurations for data formats, transfer groups, port settings etc but nothing seems to help.

 

For the port settings only clk, cs0 and somi0 and simo0 are set as SPI pins; all others are GPIO.

 

Periodic code loop:

 

void rtiNotification(uint32 notification)

{

   /* set data to Tx on mibSPI3 */

   mibspiSetData(mibspiREG3, 0, TX_DATA);

 

   /* wait for data on mibSPI5 */

while (!mibspiIsTransferComplete(mibspiREG5, 0))

   {

   }

   /* read data */

   mibspiGetData(mibspiREG5, 0, RX_DATA);

}

 

The code locks up in the mibSPITransferComplete function as the Rx bit in the Flg register is never set.

 

I have tried using SPI2 to receive the data from mibSPI3 and this works just fine; it seems to be just mibSPI that I cannot get to receive. Also tried receiving on mibSPI1 but this just does the same as mibSPI5.

 

I am sure there is something very simple in the setup that I am missing but I am not able to find it. Any ideas would be appreciated.

 

For info a register dump follows for mibSPI5 at the point where it is waiting for in the mibSPITransferComplete loop.

 

 

  • Do you mind uploading you project (CCS File->Export)? Or if the code is proprietary, just the  HALCoGen .hcg and .dil files?

  • I have uploaded a zipped workspace that contains the whole project.  It is just a simple example; there is no proprietary code in there.

    I am puzzled about the transfer group triggering options in HALcodegen.  There are options for chip select, trigger event and trigger source.  I had assumed that in slave mode TG0 is simply triggered from CS(0), TG1 from CS(1) etc.  Do the options for triggering in the Transfer Groups tab have any significance for slave mode receive?  The problem I seem to have is that I never see the transfer group get triggered.  I have enabled TG0 and confirmed that CS(0) is being toggled and that it is getting through to the DIN register.  Is there something that I am missing to cause the TG to be triggered?

    3527.TMS570LS3137_CCS_Workspace_1.zip