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.
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