Hello,
I'm using TMS570LS0432, Halcogen 03.05.02 and CCS 5.4.0.00091.
So I want to get communication between SPI2 and SPI3 ports (didn't chose to use loopback because from brief explanation in datasheet TMS570LS04x I didn't comprehend how to.. and video example for MibSPI didn't work because of DMA (the video is for RM48x anyways)).
First of all, I did wiring which is fairly easy (SIMO_port3-SIMO_port2, SOMI_port3-SOMI_port2, CLK_port3-CLK_port2, CS_port3-CS_port2). Checked output line with the scope (SIMO, CS, CLK) just with send function in master mode- signal OK.
But receive line seems to get stuck at line " while((spi->FLG & 0x00000100U) != 0x00000100U) { } /* Wait */ " of "spiReceiveData" function. So It doesn't receive "RXINTFLG".
My code:
#include "spi.h"
#define length 15
uint16 RXbuf[length]={0}, TXbuf[length]={0}, priimti[length];
spiDAT1_t structure;
spiDAT1_t *pointer;
void main (void){
uint32 indikatorius=0,indikatorius1=0;
pointer=&structure;
_enable_IRQ();
spiInit();
for(i=0;i<length;i++)
{ TXbuf[i]=15-i; }
while(1)
{
indikatorius=spiTransmitData(spiREG2, pointer, length, TXbuf);
indikatorius1=spiReceiveData(spiREG3, pointer, length, RXbuf);
}
}
1. Could someone please show me how to make this communication work (any working code would be appreciated)? Because there are functions, which repeat themselves (and I get confused at this point):
uint32 spiTransmitData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff);
void spiSendData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff);
uint32 spiTransmitAndReceiveData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff, uint16 * destbuff);
void spiSendAndGetData(spiBASE_t *spi, spiDAT1_t *dataconfig_t, uint32 blocksize, uint16 * srcbuff, uint16 * destbuff);
2. In function "spiTransmitData" what does second member stand for ("pointer"). I inserted it just to make things work but didn't understand meaning of this member.
3. A link, to using loopback function (or explanation) would be apreciated.
Regards,
I'm sorry for making such confusion, but maybe someone could help me, at least partially, to get started here.