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.

LP-MSPM0G3519: SPI Frame Length Compatibility Between MSPM0G3519 and TSC2046E

Genius 3215 points

Part Number: LP-MSPM0G3519
Other Parts Discussed in Thread: TSC2046E

Hi All,

Regarding SPI, there are two issues.

(1)-1
SPI frame length can NOT be set to be more than16
There are cases that SPI data length is more than 16Bit.
For example, frame data length is 24Bit regarding TSC2046E .

Is it possible to realize SPI frame more than 16.
If possible, please tell us the method.

(1)-2
SPI frame length can NOT be set dynamically
Is it possible to change SPI frame length dynamically.
If possible, please tell us the method.
We tried “DL_SPI_setDataSize” before DL_SPI_transmiteDataBlocking16..

(2)
When SPI frames sent continuously, /CS (Chip select) become high.
Is it possible to avoid high /CS between plural frames?
There is a function “DL_SPI_setDataSize”. We tried this function to change transmit frame length.
But, we can NOT change frame data length dynamically.
We called “DL_SPI_setDataSize” before DL_SPI_transmiteDataBlocking16.
We use plural “DL_transmitData16” or “DL_SPI_fillTXFIFO32”.

Best Regards,

Ito

  • Hi Ito,

    Will check from my side and reply to you tomorrow. Thanks!

  • Hi Ito,

    (1)-1
    SPI frame length can NOT be set to be more than16
    There are cases that SPI data length is more than 16Bit.
    For example, frame data length is 24Bit regarding TSC2046E .

    Is it possible to realize SPI frame more than 16.
    If possible, please tell us the method.

    Seen from data, we can only support up to 16 bit in hardware level.

    (1)-2
    SPI frame length can NOT be set dynamically
    Is it possible to change SPI frame length dynamically.
    If possible, please tell us the method.
    We tried “DL_SPI_setDataSize” before DL_SPI_transmiteDataBlocking16..

    From my understanding, yes you can use this API to change the frame length

    When SPI frames sent continuously, /CS (Chip select) become high.
    Is it possible to avoid high /CS between plural frames?
    There is a function “DL_SPI_setDataSize”. We tried this function to change transmit frame length.
    But, we can NOT change frame data length dynamically.
    We called “DL_SPI_setDataSize” before DL_SPI_transmiteDataBlocking16.
    We use plural “DL_transmitData16” or “DL_SPI_fillTXFIFO32”.

    There is a method that could make you transmission have continuous clk and CS: You can see SPH = 1. In this case, you can try to send 16bit + 8 bit data to achieve 24bit

  • 1) Last time I tried this, I had to disable/enable the SPI unit to recognize a change in the frame size. I suggest you just send it as 3x bytes.

    2) I recommend using a GPIO for /CS, rather than the hardware /CS. That way you know (for certain) when it will be (de-)asserted.

  • Hi Zoey and Bruce,

    Thank you for your help.

    I would like to try transmitting three bytes (8 bits × 3) while keeping CS asserted.
    Do you have any samples showing how to send data with continuous clocking while maintaining CS, or how to use a GPIO pin as the CS signal?
    A past E2E FAQ reference would also be fine.
    Best Regards,
    Ito

  • (1) is just a matter of shifts and ANDs [watch out for byte-order] and (2) is just clearing/setting a GPIO at the appropriate times.

    I haven't seen any TI examples which do this.

    Keith Barkley contributed his port of GRLib (here), which talks SPI with a GPIO /CS and writes 16-bit units as bytes. The interesting functions are in the LcdDriver directory.

    Last year I adapted SLAA208 to the MSPM0+SPI (here), which also does both of these things.

    These weren't written to exhibit those particular methods -- that's rather just a by-product -- so you'll have to wade through the stuff you aren't interested in.