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.

Delay required between two opcode instructutions

Reference : Section 14.2.11.1 of TRM

Hi,

In our project, TMS570 processor is interacting with HI 6121 slave through SPI. The slave device wors as below for reading and writing.

Write :

1) Lower the chipselect, Send the write ope code, followed by data words as per the opcode. Then deactivate the chip select.

Read:

1) Lower the chipselect, Send the read ope code, followed by dummy bytes to read the number of data words as per the opcode. Then deactivate the chip select.

During entire read or write, the chip slect should be active. So for this i am setting the CSHOLD bit in the SPIDAT1 register. It is working as expected.

My slave device requires chip selective to be deactivated for 100ns in between two different opcodes.

Ex : Operation 1: CS activated, write opcode for one byte, send one byte data word, CS dectivate

        Operation 2 : CS activate, write opcode for two bytes, send two bytes of data wors, CS deactivate

So during operation1 and operation2, the slave requires atleast 100ns time CS to be in deactivated state.

Is the WDELAY mentioned in the section 14.2.11.1 of TRM satisfies my requirement ? If not is there any availability in the SPI module.

       

 

 

  • Hello Bindu,

    Yes, the WDELAY is used for exactly this purpose. You need to set the WDEL field of the SPIDAT1 for the last transfer in operation 1. Then the chip select will not be activated for the operation2 for (WDELAY + 2) VCLK cycles.

    Please also note that there is an error in the description of the WDELAY field of the SPIFMT register. The description indicates that the max value of WDELAY can only be 0x3F. This is an 8-bit field, so that the maximum value possible for WDELAY is 0xFF.

    Regards, Sunil

  • Bindu,

    The WDELAY is an 8-bit value only for the TMS570LS31x/21x microcontrollers. It is a 6-bit field for the TMS570LS20x/10x microcontrollers.

    Regards, Sunil