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