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.

TMS320F28379s SPI Slave Output Non-Responsive

Other Parts Discussed in Thread: MSP430F2254, TMS320F28379S

I'm trying to use SPI to connect an MSP430f2254 with a TMS320F28379s. I am using the MSP as my Master and the TMS as my Slave. I have already been able to transmit data from the MSP to the TMS however I have been unable to do the opposite. Even when I use an external function generator to make a clock and select line input to the TMS there is still no data out from the SPISOMI line. When doing this I see in the debugger (using CCS 6.0) that the data I want to send is sitting in the TXBUF but has not been moved over to the DAT register. Below is my SPI setup code:

//Configure GPIO MUX for SPI 

GpioCtrlRegs.GPAMUX2.bit.GPIO16= 0b01;
GpioCtrlRegs.GPAMUX2.bit.GPIO17= 0b01;
GpioCtrlRegs.GPAMUX2.bit.GPIO18= 0b01;
GpioCtrlRegs.GPAMUX2.bit.GPIO19= 0b01;
GpioCtrlRegs.GPADIR.bit.GPIO17 = 1;

//CONFIGURE SPI REGISTERS
SpiaRegs.SPICCR.bit.SPISWRESET = 0;
SpiaRegs.SPICTL.bit.MASTER_SLAVE = 0; //Slave
SpiaRegs.SPICCR.bit.CLKPOLARITY = 0;
SpiaRegs.SPICTL.bit.CLK_PHASE = 1;
SpiaRegs.SPICCR.bit.SPICHAR = 7; //7 bit
SpiaRegs.SPISTS.bit.OVERRUN_FLAG = 0;
SpiaRegs.SPISTS.bit.INT_FLAG = 0;
SpiaRegs.SPICTL.bit.TALK = 1;
SpiaRegs.SPICTL.bit.SPIINTENA = 1;
SpiaRegs.SPICCR.bit.SPISWRESET = 1;

Any help is appreciated, thanks!

  • Benjamin,

    A few things to verify. It seems like you posted some snippets rather than entire functions, so I just want to make sure you have done a few other things in your code.
    First and foremost, when you "have already been able to transmit data from the MSP to the TMS..." you are saying that you are able to successfully receive data in the F28379? if this is true, then we know that your SPI is at least configured to the proper clocking mode.

    2. You have enabled the peripheral clock to the SPI?
    3. You have an EALLOW surrounding your GPIO configuration code?
    4. Ensure that the GPIO Group mux is properly configured to 0. This should be done before setting the GPIO mux to the SPI pin.
    5. There is no requirements to set the GPIO direction if you have configured the GPIO mux to a peripheral.
    6. By setting SPICHAR to 7, you are actually configuring the SPI to use 8-bit words, not 7.

    Hopefully this gets you on the right track.

    -Mark
  • Mark,
    Yes I have been able to transmit from the MSP to the F28379.
    By enabling the peripheral clock do you mean this piece of code?
    CpuSysRegs.PCLKCR8.bit.SPI_A = 1;
    From what I've read this allows the SPI-A module clock to be turned on.
    I made changes based on your suggestions and still do not see any output. Data remains in the TXBUF and is never shifted to the Data transmit buffer.
  • Nevermind it is working. I think the peripheral clock was the problem. Thanks!