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.

DM 6437 McBSP as SPI Slave (Maximum Data rate?)

Hi,

I am using DM 6437 McBSP as SPI Slave.

I need to send 50k of data from 6437 to Another FPGA device(70MHz).

I am directly using CSL. No PSP driver is used.

What is the maximum data rate I can achieve?

I configured the SPI 8 bit.

At a time I can receive only 8bytes(Max 4 bytes if I configure for 32bit).

I need to call the function in a loop to send more data.

It seems to be very slow.

 

How can I improve the speed?

 

Please check the code. I am sending a buffer to another device.

 

SPI_Slave_Init ( SPI_8BIT );

SendBytes(Buffer, size); 

 

//Sending byte by byte.

SendBytes(char* Buffer, int size)

{

for(i=0;i<size;i++)

RecvVal = SPISendReceive( Buffer );

}

 

unsigned long SPISendReceive ( unsigned long Send )
{
    unsigned long Recv;

    //poll transmitter ready
    while(CSL_FEXT(mcbsp0Regs->SPCR,MCBSP_SPCR_XRDY)
        != CSL_MCBSP_SPCR_XRDY_YES);

    //write to transmit register
    mcbsp0Regs->DXR = Send;

    //poll receiver is ready
    while(CSL_FEXT(mcbsp0Regs->SPCR,MCBSP_SPCR_RRDY)
        != CSL_MCBSP_SPCR_RRDY_YES);

    //read receive register
    Recv = mcbsp0Regs->DRR;

    return ( Recv );
}

 

 

 

Please advice me.

Thanks

Lijesh

 

  • Hi,

    Your code seems to be fine.

    As the DM6437 is a SPI slave, the maximum SPI data rate is dependent on the SPI master. As long as the DM6437 McBSP CLKG is 8 times faster than the CLKX/CLKR (from the SPI master) the DM6437 McBSP should be able to handle the data sent from the SPI master.

    Thanks.

    Tai Nguyen

  • Hi Tai Nguyen

     

    Thank you for your reply.

    I am still stuck with the same problem.

    Can somebody tell me the 'actual throughput' of SPI(6437McBSP as slave)?

    The master clk is 6MHz.

    Can I assume a speed more than 700 kbps?

     

  • Hi Lijesh,

    Since the DM6437 McBSP is running on SYSCLK3 which is divided by 6 from the DM6437 clock, if the DM6437 is operated at 300Mhz, for example, the slave McBSP SPI should work with the master clock of 6Mhz which requires the McBSP CLKG of 48-50Mhz. You can achieve this by select the SRG clock source as the McBSP internal clock and setting the CLKGDV =0. If this works you should get a throughput of 6Mbps.

    Thanks,

    Tai Nguyen

  • Hello Tai Nguyen,

     

            Can you send me any application note which uses McBSP as SPI Slave?   For further details of my project & Configuration f McBSP kindly refer: 

    http://e2e.ti.com/support/embedded/f/355/p/97315/340026.aspx#340026

    Thank you,

    Kanthi

  • Hello Kanthi,

    Unfortunately we don't have any app note for McBSP in SPI slave mode. I suggest to test your code using the digital loopback mode. I did look for some test code to send but they were written to use the old CSL drivers unfortunately.

    -Tai