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.

AM6442: Do multi channel mode support csDisable?

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I found that code shows csDisable is only supported in single chnnel mode.

Does this mean we can not implement multi buffer transfer in one single CS assert under multi channel mode?

Regards

Zekun

  • Hi Zekun,

    Thanks for your question.

    Please allow me sometime to follow up with you.

    Regards,

    Vaibhav

  • Hi Zekun,

    Thanks for your patience.

    multi channel mode?

    Can you please share a screenshot of what your SysConfig looks like under the tab MCSPI. Also, please share the screenshot of the chip select configuration which also comes under the tab MCSPI.

    After this I can guide you better.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    the sysconfig  is as depicted in the figure above.

  • Hi,

    Thanks for attaching the SysConfig details which I asked in my previous response.

    The SysConfig configurations are correct.

    Allow me sometime to follow up further on this.

    Regards,

    Vaibhav

  • Hi,

    As of today, for multi controller application where you need to communicate with multiple chip selects, you can have your code as I have explained below.

    Lets say there are two chip selects configured then your code flow for communicating with these two chip selects would look as follows.

    This is just a pseudo code for you to understand the logic, if you need a sample code I can drop it to you here on E2E itself:

    MCSPI Transaction Params1

    MCSPI Transaction Params2

    Params1.csDisable = True

    Params1.channel = ChipSelect0

    .... Other parameters defined as well like txBuffer, rxBuffer and so on.

    call MCSPI_Transfer() and the transfer has been done for Chip Select 0

    Params2.csDisable = True

    Params2.channel = ChipSelect0

    .... Other parameters defined as well like txBuffer, rxBuffer and so on.

    call MCSPI_Transfer() and the transfer has been done for Chip Select 1

    Hope this helps explain the flow and I would encourage you to try this and let me know if any help is needed,

    Looking forward to your response.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    I have correctly initialized the mcSPI.

    And my question is that when I use single controler(single  cs),the function MCSPI_transfer can send/recv multi-buffer as the buffer array has in one CS assert .

    But when the multi-controler (multi cs) used, the buffer array will be send/recv one by one in one by one CS assert ,In other words,in one CS assert just send/recv one buffer.

    In the source code ,

    this show the csDisable can control the buffer number that in one CS assert userd.

    but in other code show that csDisable just work in single mode?---MCSPI_CH_MODE_SINGLE == attrs->chMode

  • Hi,

    Thanks for your response.

    Allow me sometime to go through it and follow up.

    Regards,

    Vaibhav

  • Hi,

    Thanks for your patience.

    When we take a look at the parameters one such is csDisbale.

    So, what csDisable=TRUE is saying is that after a particular MCSPI Transaction is done deassert the CS line. So end to end transaction is being taken care here.

    But lets say you do not want to disable the CS line after only one transaction and you need to have more transactions then you can have it as FALSE.

    When you are aiming for only one transaction then:

    MCSPI Params Init

    param.csDisable = TRUE;

    MCSPI_Transfer()

    But lets say, you want to have 4 transactions one by one for a single MCSPI Controller then:

    MCSPI Params Init

    param.csDisable = FALSE;

    MCSPI_Transfer()

    MCSPI Params Init

    param.csDisable = FALSE

    MCSPI_Transfer()

    MCSPI Params Init

    param.csDisable = FALSE;

    MCSPI_Transfer();

    MCSPI Params Init

    param.csDisable = TRUE;

    MCSPI_Transfer()

    but in other code show that csDisable just work in single mode?---MCSPI_CH_MODE_SINGLE == attrs->chMode

    I totally understand your concern here. But before addressing this, can you please try for multi channel and let me know if it works as per your expectation?

    Looking forward to your response.

    Regards,

    Vaibhav