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.

TMS320F28386D: SPI CS

Expert 2380 points
Part Number: TMS320F28386D
Other Parts Discussed in Thread: ADS7038

TMS320F28386D connect with Ads7038 using SPID.

One question: SPI CS I had set it as GPIO, but  TX every 16bits, it set to high automaticlly?

Another question: I am sending 0X18 0X01 0X01 data, but always that show the first TX byes is 0x00?

Where I made mistake.

  • W Z,

    Another question: I am sending 0X18 0X01 0X01 data, but always that show the first TX byes is 0x00?

    Your SPI is configured with SPI character length = 16 bits and not 8 bits. If your SPI_setConfig select 8-bit word size instead of 16.

    One question: SPI CS I had set it as GPIO, but  TX every 16bits, it set to high automaticlly?

    If you are doing byte by byte transaction in non-FIFO mode, I would encourage you to use SPI_transmitByte(base, txData) 

    you can change your code like this.

    setCS(LOW);

        SPI_transmitByte(SSI_BASE_ADDR, 0x18) ;

        SPI_transmitByte(SSI_BASE_ADDR, 0x01) ;

        SPI_transmitByte(SSI_BASE_ADDR, 0x01) ;

    setCS(HIGH);

    Regards,

    Manoj

  • I fixe it. The root cause is that when TX 0x18, actually that F28386's smallest unit is 2 bytes, so 0x18 is 0x0018.

    Always sent the high byte firstly.

    Thanks for your suggestion.