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.

TMS320C5515 - SPI Problem

Other Parts Discussed in Thread: TMS320C5515

Hi All,

I am working on CCS 6.1.3 (Windows 10), and I am trying to send a stream of data on SPI interface,

First I connect TMS320C5515 to my laptop (J2 EMU USB), I launch selected configuration (you can see on picture below):

After I finish this step, I press the "connect target" button, and then I get this error

I searched for solutions to this error, and i found a post that my program should work regardless.

I wrote a program to test the SPI interface.

SYS_EBSR=0x5A3F;

SYS_PCGCR1=0x0000;

SYS_PCGCR2=0x0000;

SYS_PSRCR=0x0020;

SYS_PRCR=0x0080;

SYS_PCGCR1=0x0000;
SPI_SPICCR=0x0000;
SPI_SPICDR=0x0FFF;
SPI_SPICCR=0x8000;
SPI_SPIDCR1=0x0300;
SPI_SPIDCR2=0x0303;
//Sending SDATA
do{
SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x5500;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0xFF00;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

}while(1);

As you can see, I put the initialization outside the do-while loop, because in this loop, I am only loading the SPI register, and sending the data. I used RedLab 1608fs for data acquisition, and in the next picture you can see the result of the data acquisition:

Everything works as it should.

But when I put write the next program:

SYS_EBSR=0x5A3F;

SYS_PCGCR1=0x0000;

SYS_PCGCR2=0x0000;

SYS_PSRCR=0x0020;

SYS_PRCR=0x0080;

SYS_PCGCR1=0x0000;
SPI_SPICCR=0x0000;
SPI_SPICDR=0x0FFF;
SPI_SPICCR=0x8000;
SPI_SPIDCR1=0x0300;
SPI_SPIDCR2=0x0303;
//Sending SDATA
do{

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0xFF00;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x1100;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x4300;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x0000;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0xC000;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x4100;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x0100;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x8600;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x0000;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

SPI_SPIDAT1=0x0000;
SPI_SPIDAT2=0x4500;
SPI_SPICMD1=0x4000;
SPI_SPICMD2=0x003A;

}while(1);

In the next picture you can see the result of the data acquisition:

If you analyse the program and the picture, you can see that the TMS320C5515 is not sending the whole stream of data.

My question is why is this happening? Is this related to the error I mentioned earlier? Why is the same thing not happening in the first program?

Thank you in advance for your help.