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.

CCS/TM4C1294NCPDT: ROM_SSIConfigSetExpClk - What protocol should I use ?

Part Number: TM4C1294NCPDT

Tool/software: Code Composer Studio

Hello,

My TIVA has to send few bytes as master to an SPI slave. 

According to the slave datasheet, the timing should be like the following: 

In ROM_SSIConfigSetExpClk, the 3rd parameter is protocol and can be:

SSI_FRF_MOTO_MODE_0

SSI_FRF_MOTO_MODE_1

SSI_FRF_MOTO_MODE_2

SSI_FRF_MOTO_MODE_3

SSI_FRF_TI

SSI_FRF_NMW

1. How can I choose the protocol ?

In my project, the SPI is sent from PD3 (clock), PD1 (MOSI), PD0 (MISO).

2. I'm using SSI2. Am I right ?

3. Must I use SSIAdvModeSet ?  It is not mentioned in the sample code. 

Thank you,

Zvika 

  • Hi Zvika,

    1. You should use SSI_FRF_MOTO_MODE_0.
    2. Yes, PD3 (SPICLK), PD1 (SPITX) and PD0( SPIRX) are for SSI2
    3. No, I don't think you need to use advance mode.
  • Hi Charles,

    According to the sample code in spmu289d.pdf:

    //
    // Enable the SSI module.
    //
    SSIEnable(SSI0_BASE);
    //
    // Send some data.
    //
    i32Idx = 0;
    while(pcChars[i32Idx])
    {
    SSIDataPut(SSI0_BASE, pcChars[i32Idx]);
    i32Idx++;
    }

    Should I mark end of message ? How ?
    My slave has 3 registers, each has a different data length.
    I think the above sample is only for 8 bits length register. Am I right ?

    Thank you,
    Zvika
  • Hi,
    The example is to illustrate sending out ascii string. It will continue to send until it reaches the NULL which has the ASCII code of 0. Please refer to additional examples under <TivaWare_Installation>\examples\peripherals\ssi.

    What do you mean your slave has different data length? I don't know what slave device you have. What the three registers and how long is each register? You want to setup the SSI module data length that will match the smallest length among of the three registers. Let's say the three registers are 8, 16, and 24bit each then you want to setup the SSI for 8bit. To talk to the register with 16bit length you will need to write twice. For the 24bit register will need to write three times.