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.

TMS320F28035 SPI - 16 bit Read Problems

Other Parts Discussed in Thread: TMS320F28035

I am using TMS320F28035 in SPI Master mode. Where I have to transmit 8 Bit data to the slave device and have to read 16-bit data out of the slave device after completion of data transfer from master to slave. So total of 24 SPICLK cycles to carry out complete communication.

Since I have to read 16-bit data from the slave, master device should keep clock running for 24 cycles. But clock stops as soon as the data in SPITXBUF transmitted. To acquire at least some data from the slave I am keeping clock running by placing 16-bit data in the SPITXBUF so that 8 bits of useful data and 8-bits of garbage just to hold the clock total 16 cycles. During this period I am able to read 8 bits of data from the slave.

Problem:

Now the question is how should I hold the clock running for 8 more cycles to read remaining 8-bits from slave?

  • Rahul,

    It sounds like maybe you need to do three 8-bit transfers? Or alternately, do an 8-bit transfer, then reconfigure the SPI port to do a 16-bit transfer. I guess it depends on what your slave device is expecting. Does the slave reconfigure itself from 8- to 16-bit transfer in the middle of the transaction? I suspect not.

    - David
  • Thanx David,
    solved the problem using 3 8-bit transfers.
    Reconfiguring it to 16-bit takes finite time which might stop the clock and miss out the immediate data during configuration.
    Thanks for the reply.