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.

TMS320F28377D: MASTER(NXP-ARM M4) - 28377 SPI SLAVE , If increase master's clk , do not working.

Part Number: TMS320F28377D

 Hi, 

We want to use TMS320F28377D SPI Slave mode. 

We already set as SPI Master with NXP ARM MCU(mk60xxxx).

If We set sclk - 15KHz , it work normal.

But if we set scl - 50KHz or higher than 50KHz, (ex 1MHz),  it do not work...

I think Slave can not accept high sclk. because MISO data corrupted at some sclk (between 15KHz and 50KHz).

Please help me~

This is Slave code.

//  9.1 Idle Loop
    for(;;) // Just sit and loop forever
    {
        BackTicker++;

        while(SpiaRegs.SPIFFRX.bit.RXFFST !=1) { }

        Rdata = SpiaRegs.SPIRXBUF;
    }



void spia_initialize()
{
    // Initialize SPI FIFO registers
    SpiaRegs.SPIFFTX.all = 0xE040;
    SpiaRegs.SPIFFRX.all = 0x2044;
    SpiaRegs.SPIFFCT.all = 0x0;

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

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

    // Set the baud rate
    SpiaRegs.SPIBRR.bit.SPI_BIT_RATE = ((200E6 / 4) / 500E3) - 1;

    // 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;
}


//  End of file.

this is normal and abnormal(BLUE-MISO line do not working) scope 

yellow - sclk

red - /cs

blue - MISO

green - MOSI

 

  • Shin,

    Did you try to figure out why is your MISO pin floating ( it is neither high (or) LOW)? Wondering whether you have some sort of hardware issue.

    Regards,
    Manoj
  • Hi Manoj, Thanks for reply

    I already test MISO pin pull-up and pull-down , but same result.
    I think SPI dont need pull-up or down.

    If mcu has a lot to process in interrupt or main function , can spi slave not get high clock?

    thank you.
  • Well that is quite possible. SPI should be able to operate at higher baudrates than what you see. So, SPI module as such doesn't have this restriction. The restriction might come up from how much available bandwidth is there to process SPI data reception / transmission.

    Regards,
    Manoj