Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

LAUNCHXL-F28379D: Sending 24 bit word from txt file via spi

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hi

i have a text file with 128 words, each word is 24 bit.

i'm trying to understand what is the best way to send the data via SPI.

I see that the maximum word length is 16 bits. maybe i should divide it to 3 sub words, with 8 bit each? do i need to configure something else?

thank you very much for your help.

  • Hi,

    Yes, the maximum data size of SPI is 16 bits. You can divide each word to 2 sub words of length 8 bits and send. Or you can combine words and send in chunks of 16 bits. Note that the data written to the TX register must be left-justified.

    You need to configure the character length accordingly (SPICCR.SPICHAR)

    Regards,

    Veena

  • thank you for the answer.

    i have a problem with the SPISTE line.

    if i change SPICHAR to 8 bit word (in order to send 3 words of 8 bit, total 24 bits), i get a signal every 8 bits.

    how can i change the timing of SPISTE to be high every 24 bits, immediate after the third 8 bit word?

  • Hi,

    The STE pin will automatically go high after every SPI transfer. If you want to change this behavior, you can configure the pin as a GPIO pin and control the output using software.

    Regards,

    Veena

  • I'm not sure how to do this.

    i took the spi loopback example and made some changes, i can read data from text file and send words from 1 to 16 bit length. in this example, the SPISTE is configured on GPIO19 pin.

    how can i force SPISTE to be low during the first two words transmit?

    how can i force SPISTE to be high after the third word transmit?

    is there any bit that controls the SPISTE state?

  • Hi,

    There is an example available in C200ware which shows how to interface SPI eeprom that does controls the STE pin via software. The example is for a different device, you can use this as a reference:

    <C2000ware>\driverlib\f2838x\examples\c28x\spi\spi_ex6_eeprom.c

    Note that in the example, the pin is configured as a normal GPIO output pin and not as the STE pin. The pin is controlled using GPIO registers.

    Regards,

    Veena

  • Note that when you enable the SPI FIFOs, the SPISTE pin will stay low as long as there is data in the FIFO. Therefore, if you load 3 8-bit characters to the SPI TX register, the SPI will generate 24 clocks with the SPISTE pin staying low the whole time. This is described in the post below:

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/688266/2536345