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.

AM5726: AM572X transmit and receive procedure polling method

Part Number: AM5726

Hi Team,

Can you please help with the inquiry below?

Referring to SPRUHZ6L–October 2014–Revised August 2019  page 9577 the customer believe that:

1) "stop the channel should be the last step - after all receive has been done

2) The register for the line "Read the received register" should be MCSPI_RXx

The customer  based this on Table 24-325 (Receive-only procedure - polling method)

Would Please confirm if the customer's interpretation is correct?

Thank you in advance.

Regards,

Marvin

  • Hi Marvin,

    Referring to SPRUHZ6L–October 2014–Revised August 2019  page 9577 the customer believe that:


    There is no page 9577 is the mentioned document.



    Can you please provide the section name and number your customer is referring to?

    Regards,
    Parth

  • Hi Parth,

    I apologize for the confusion, Here is the section number mentioned.

    Regards,

    Marvin

  • Hi Parth,

    Thank you for waiting. Here is some clarification: 

    The correct page is 5977. The customer is referring to the 

    1. “stop the channel” before “Read the received register”
    2. “Read the received register”  refers to Register MCSPI_Txx and not MCSPI_TXxx

    In addition, can you also clarify the following?

    In “Single-Channel Master Mode”, section 24.4.4.3.5, page 5946

    I understand this to mean “single channel enabled at any point in time” – but there can still be multiple channels in use – the software just needs to ensure that it disables a current channel before enabling another channel. Is this correct? When is this mode of use recommenced/necessary/not allowed? How do I choose if I should work in this mode or leave all channels enabled? What are the tradeoffs?

    Regarding the FIFO – I understand that the FIFO can only be used for a given channel at a time.

    1. In which cases is the use of FIFO advantageous/not recommended? Is the intention that I use Single-Channel Master Mode and each time set the FIFO to the enabled channel or is the FIF intended for interrupt or DMA mode?
    2. Note that in the example code in C:\ti\pdk_am57xx_1_0_10\packages\ti\drv\spi\src\v1 file SPI_v1.c. The FIFO is set up in function MCSPI_xferSetup_v1() – but I can’t see where it is disabled when another channel is used.
    3. In the same file and function, the code calculates the “wordcount” and then it calls
      1. McSPIWordCountSet(hwAttrs->baseAddr, transaction->count);
      2. Passing the transaction->count   (in bytes) instead of the calculated word count – is this correct?

    Thank you in advance.

    Regards,

    Marvin

     

  • Hi Marvin,

    “stop the channel” before “Read the received register”

    I don't believe that's necessary. You can refer to our PDK driver, there the channel is disabled after that RX register has been read. But just to double check, I am looping in our McSPI experts for the confirmation.

    Read the received register”  refers to Register MCSPI_Txx and not MCSPI_TXxx

    Yes, this is correct understanding.

    Regards,
    Parth

  • Hi Parth,

    Thank you. 

    How about the questions regarding the FIFO? 

    Regards,

    Marviin

  • I believe you meant to reference the MCSPI_RXx registers instead of MCSPI_Txx?

    Agree that you don't need to disable the channel before reading the RX register.

    The benefit of the FIFO is to unload the DMA or interrupt handler and improve data throughput.

  • Hi B.C.

    Thank you for responding.

    Agree that you don't need to disable the channel before reading the RX register.

    To clarify your response, does this mean that "the channel should only be disabled after reading the RX register”?

    The customer want to know when does the channel need to be enabled and when should it be disabled.
    What does not work if the channel is disabled what only works when it is enabled.

    Can you also clarify the “Single-Channel Master Mode” defined in section 24.4.4.3.5 in SPRUHZ6K–October 2014–Revised October 2018? I’m trying to understand this mode as opposed to “round robin mode”.

    Does the term  “Single-Channel Master Mode” mean:

    1. Only a single channel is being used (at all)
    2. At any point in time only a single channel is enabled and the firmware is responsible for switching between channels (i.e. enable/disable, setup FIFO, etc.)

    And does “round robin mode” mean imply that I can enable multiple channels at a time, independently do send and receive (including use of interrupts, dma?) as long as :

    1. I don’t need to use the FIFO at all
    2. I only use the FIFO for one of the enabled channels at a time
    3. I don’t need “smart-Bit mode”
    4. I don’t need turbo mode
    5. What else???

    Basically, it would be useful to have a table that compares “Single-Channel Master Mode” to “round robin mode”  showing

    1. What is and what isn’t available in each mode
    2. The difference in the programming sequence

    Do we have this available?

    Also - is there an example of using the system in non-single channel mode ? Is it really as simple as changing SPI_v1_HWAttrs . chMode from  MCSPI_SINGLE_CH to MCSPI_MULTI_CH and using the existing checks on . chMode  and   MCSPI_SINGLE_CH.?

    Thank you again.

    Regards,

    Marvin

  • Hi Team,

    Any update?

    Thank you.

    Regards,

    Marvin

  • Hi Marvin,

    The customer want to know when does the channel need to be enabled and when should it be disabled.

    Please refer to the PDK driver for this. AS I mentioned earlier I don't believe that is it necessary to disable the channel before read.

    Does the term  “Single-Channel Master Mode” mean:

    1. Only a single channel is being used (at all)
    2. At any point in time only a single channel is enabled and the firmware is responsible for switching between channels (i.e. enable/disable, setup FIFO, etc.)

    Yes, this understanding is correct. Please refer to the section 24.4.4.3.5 Single-Channel Master Mode and 24.4.4.3.5.1 Programming Tips When Switching to Another Channel

    In single channel mode, switching between the channel has to be taken care by the user SW while in Multi Channel mode, the McSPI module takes care of switching between the channels.

    And does “round robin mode” mean imply that I can enable multiple channels at a time, independently do send and receive

    Yes. Please refer to the section 24.4.4.3.2 Master Transmit-and-Receive Mode (Full Duplex) of the TRM. It explains the conditions required to be met for a channel to be picked by the Round Robin arbitration.

    Also - is there an example of using the system in non-single channel mode ? Is it really as simple as changing SPI_v1_HWAttrs . chMode from  MCSPI_SINGLE_CH to MCSPI_MULTI_CH and using the existing checks on . chMode  and   MCSPI_SINGLE_CH.?

    Please refer to the example available at <PDK>\packages\ti\drv\spi\example\mcspi_slavemode\src

    There are UTs available for MultiChannel mode as well

    Regards,
    Parth