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.

TMS320F28379D: SPI DMA support 16 bit or 32 bit.

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Hello Team,

actually, SPI DMA support 16 bit or 32 bits. I'm using SPI support controller which support 8-bit commands. 

 

frame format like this.


void InitSpi(void)
{
// Initialize SPI-A

// Set reset low before configuration changes
// Clock polarity (0 == rising, 1 == falling)
// 16-bit character
// Enable loop-back
SpiaRegs.SPICCR.bit.SPISWRESET = 0;
SpiaRegs.SPICCR.bit.CLKPOLARITY = 0;
SpiaRegs.SPICCR.bit.SPICHAR = (8-1);
// SpiaRegs.SPICCR.bit.SPILBK = 1;

// Enable master (0 == slave, 1 == master)
// Enable transmission (Talk)
// Clock phase (0 == normal, 1 == delayed)
// SPI interrupts are disabled
SpiaRegs.SPICTL.bit.MASTER_SLAVE = 1;
SpiaRegs.SPICTL.bit.TALK = 1;
SpiaRegs.SPICTL.bit.CLK_PHASE = 1;
SpiaRegs.SPICTL.bit.SPIINTENA = 0;

// Set the baud rate
//SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = SPI_BRR;
SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = 4;

// Set FREE bit
// Halting on a breakpoint will not halt the SPI
SpiaRegs.SPIPRI.bit.FREE = 1;

// Release the SPI from reset
SpiaRegs.SPICCR.bit.SPISWRESET = 1;

}

I done SPI configurations like this.

please give me any suggestion, o resolve this issue.

  • Hi Akash,

    SPI DMA use is limited to 16-bit words as noted in the device TRM (noted in DMA section 5.1.1 Features).

    The SPI module specifically is optimized for 16-bit data words, so if you are using less than 16-bit (for example, 8-bit in your case), be sure to do left bit-wise shifts so the 8-bit data is left-justified before you transmit the data via SPI (in other words, for 8-bit data you would bit-shift by 8 before writing to SPI TXBUF to transmit data). No bit shifting is needed for receiving 8-bit data into SPI RXBUF. (The data justification is noted in the TRM section 18.3.4 Data Format)

    If you haven't already, you can also refer to the TRM SPI sections 18.2.4 DMA Support and 18.3.8 SPI DMA Transfers for more help with using SPI with DMA. There are also SPI C2000Ware examples - while we do not have a SPI-DMA specific example for F2837xD, there is one for F2838x that could be helpful if you need a reference located at {C2000Ware}driverlib\f2838x\examples\c28x\spi.

    It is a bit unclear what specific issue you are having right now - if the above notes are not helpful, could you please elaborate on what issue you are having with you program?

    Best Regards,

    Allison