Hi,
I am trying to set up a SPI communication between TMS320C5515 and ADS1298R and I am having problems with initializing SPI on TMS320C5515. I am following the c5515 SPI User guide (sprufo3). I wrote a program in Code Composer for Initializin SPI:
//Reset of the SPI module
SYS_PRCR=0x0080;
value=SYS_PRCR;
while (value !=0){
//checking if the SPI module is turned on
value=SYS_PRCR;
}
if (value==0)
{
//Enabling the SPI input clock
SYS_PCGCR1=0x0000;
//Specifying how many clock cycles is reset asserted
SYS_PSRCR=0x0020;
//Disabling SPI_CLK
SPI_SPICCR=0x0000;
// setting CLKDV
SPI_SPICDR=0x0010;
//enabling SPI_CLK
SPI_SPICCR=0x8000;
//Setting up clock phase
SPI_SPIDCR1=0x0000;
SPI_SPIDCR2=0x0000;
//Setting interrupt
SPI_SPICMD1=0x4040;
//reading or writing
SPI_SPICMD2=0x003A;
//Enabling the SPI pins through the external bus selection register
SYS_EBSR=0x1A3F;
}
I am using the Code Composer debugger and watching how the registers are set step by step (by using Step Into) rather then letting the program Run. As far as I can see, all registers are set up correctly. After the step of setting up SPICMD2 (SPI_SPICMD2=0x003A), SPISTAT1->CC (character complete) becomes set, also SPISTAT2->CCNT (character count) is equal =0x01.
I am using the oscilloscope and watching the SPI_CLK pin, after the set up is finished there is no Clock signal on the pin. My question is am I doing something wrong (maybe skipping a step).
Thanks for any help.