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.

TMS570LC4357: Question about the MibSPI.

Part Number: TMS570LC4357

Hi,

Below figures are my configurations:

Description:

I'd like to communicate with external flash. Firstly, I will transmit a instruction by the function(mibspiSetData() and mibspiTransfer()), and then I expect to receive data sent to me by the external Flash.

The question is that I did not receive the data. 

  1. Weather the function(mibspiGetData()) still let the CS pin keep low?
  2. I expect to receive 24 bits of data, weather should I call the function(mibspiGetData()) 3times?

Looking forward to your answer.

  • uint16_t data[4]={0};
    uint16_t command[1]={0x9F};
    uint8_t i;
    uint32_t ID;

    mibspiSetData(mibspiREG4,0,command);

    mibspiTransfer(mibspiREG4,0);

    while(mibspiIsTransferComplete(mibspiREG4,0)==1){
    c(mibspiREG4,0,data);

    ID|=data[0]<<24;
    mibspiGetData(mibspiREG4,0,data);
    ID|=data[1]<<16;
    mibspiGetData(mibspiREG4,0,data);
    ID|=data[2]<<8;
    mibspiGetData(mibspiREG4,0,data);
    ID|=data[3];
    }

  • From your example, the command is 1 16-bit data. 

    When you set the MibSPI TX buffers (8 buffers in your config), the first buffer is filled with 0x9F, but the 2nd to 7th buffers are unknown value in the SRAM. Do those 7 unknow value affect the Flash's response? 

    data[4]={0}; --> I guess the number of  return for command 0x9F is 4 16-bit values. Is a delay between command and return data required? If the Flash returns only 4 values, why do your define TG0=8 buffer?

    My suggestions:

    1. Use SPI mode instead of MibSPI mode

    2. define charlen=8 rather than 16

    3. Define command[4]={0x9F, 0x0, 0x,0, 0x0}; data[4]={0};

    4. Check flash device if CSHOLD is accepted or not.

    4. use spiTransmitAndReceiveData() in poling mode, and spiSendAndGetData() in interrupt mode to get dat

  • Thanks for your answer!