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.

TMS320F28377S: SPI 24-bit sending issue

Part Number: TMS320F28377S
Other Parts Discussed in Thread: CONTROLSUITE, , DAC8560

Hello TI community,

I am currently trying to configure the TMS320F28377S MCU to send 24 bits data stream through the SPIB (GPIO58 to GPIO61). I am understand that the MCU can only send up to 16 bit words; however, it can be configured to send continuous data without delay by configuring the FIFO. I have come up with sending three 8-bit words to achieve my 24-bit data stream. I am working off the spi_loopback (no interrupt) example code from controlSUITE except I set the loop back to 0.

I am monitoring the TX FIFO status register can see the register being incremented up to 2 only. I also can see my values are being written correctly to the transfer buffer. I am also wondering why the receive buffer is being filled as the loop back bit is set to 0? Anyways, I am trying to communicate to a DAC8560() to disable it's internal reference. I can't see to get the internal reference to be disabled. I wrote a simple code for the SPIB. I am wondering what I am doing wrong.

 

#define DAC8560_DISABLE_INT_SEQ_P1 0b0100100000000000       // 8-bit left justified
#define DAC8560_DISABLE_INT_SEQ_P2 0b0000010000000001
#define DAC8560_NORMAL_OP          0b0000000000000000
#define DAC8560_PWR_DWN_1K         0b0000000100000000
#define DAC8560_PWR_DWN_100K       0b0000001000000000
#define DAC8560_PWR_HIGH_Z         0b0000001100000000

volatile struct SPI_REGS *SPI_PTR[SPI_CH] = {&SpiaRegs, &SpibRegs, &SpicRegs};

void disable_int_ref_DAC8560(volatile struct SPI_REGS *SPI)
{
    set_DAC8560(SPI, DAC8560_DISABLE_INT_SEQ_P1, DAC8560_DISABLE_INT_SEQ_P2);
}

void set_DAC8560(volatile struct SPI_REGS *SPI, Uint16 dac8560_op_mode, Uint16 dac_level)
{
    //Uint16 rdata;
    Uint16 sdata[] = {0, 0, 0};
    Uint16 i;
    sdata[0] = dac8560_op_mode;
    sdata[1] = dac_level & 0xFF00;
    sdata[2] = (dac_level & 0x00FF) << 8;

    for(i=0; i<3; i++)
    {
        spi_xmit(SPI, sdata[i]);
    }
}

  • i used an oscilloscope and noticed that my SPIBCLK remains low the entire time and that my SPISTEB remains high the entire time. I double checked that I configured the pin to be SPIB following the pin mux selection table.
  • On further inspection, I was able to capture the activity happening on my MOSI, CLK, and STE pin. My STE and MOSI pins are operating as intended however there is a slight spike at the beginning which concerns me. I also noticed for my clk signal that it's high is never reaching the max voltage given to it (3.3V) and stays below 1V which could be the problem of why no information is being written to my DAC8560.
  • Hi Brenden,

    I'll be helping to resolve your post regarding the issues with the SPI module. Can you post a waveform of your current status and update on which issues from this post are resovled and which are still open?

    What board are you using for your F28377S device?

    Regards,
    Kris
  • Hi Kris,

    After some hardware debugging, I realized that my SPI CLK and STE pins some how were being shorted. After un-shorting the lines, everything went smoothly!