MCU-PLUS-SDK-AM273X: How can I dynamically configure the MIBSPIs of AM273x?

Part Number: MCU-PLUS-SDK-AM273X

Tool/software:

Hello Support team,

Currently based on sample project code of mibspi, we can configure the mibspi via the example.syscfg file. However, if we want to control multiple SPI slave devices which requires different SPI Mode and SCLK value, can we configure the mibspi dynamically in our source code for different slave SPI devices? If it's possible, how should we do it?

Any instructions or advice are greatly appreciated.

Looking forward to your response.

Best regards,

Lin

  • Hi Lin,

    The way the AM275x MIBSPI driver works on the MIBSPI instances is as the following:

    Drivers_open --> Drivers_mibspiOpen --> MIBSPI_open which uses the gMibspiOpenParams (set in the example.syscfg) to open/configure the MIBSPI instance

    If you want to change the MIBSPI instance configuration dynamically, you will have to close the currently opened MIBSPI instance using MIBSPI_close() and reopen it using different gMibspiOpenParams (with your required updates) again.

    Best regards,

    Ming

  • Hi Ming,

    Thank you very much for your explanation and all the information. I will try to follow that to proceed.

    Best regards,

    Lin

  • Hi Ming,

    We met an urgent issue about ADC chipset sampling rate. As I think it's not directly related to this thread topic, so I created another thread about CS rate. Could you please check and answer it?

    Thanks,

    Lin

  • Hi Lin,

    I will look in to the new thread you filed and get back to you soon.

    Best regards,

    Ming

  • Hi Ming,

    To better understand the LLD of the MCU+ SDK (mainly for MIBSPI, EDMA, QSPI and others), what document/manual should I read from?

    Thanks for your help.

    Best regards,

    Lin

  • Hi Lin,

    Not every peripheral on AM273x has LLD. For example the MIBSPI and EDMA do not have LLD, but QSPI does.

    For QSPI LLD,

    file:///C:/ti/mcu_plus_sdk_am273x_09_02_00_60/docs/api_guide_am273x/group__DRV__QSPI__LLD__MODULE.html

    and the AM273x TRM are the best resources for details.

    Best regards,

    Ming 

  • Hi Ming,

    Thanks for your explanation and QSPI LLD link. They are helpful.

    My original purpose was to understand the MCU+ SDK peripheral API structure and where and how does it configure the peripheral registers. So that I can write my own configuration for some peripheral such as MIBSPI and EDMA. My current task is to reduce the overhead of the MIBSPI_transfer( ) to increase the CS rate.

    Looking forward to your further help.

    Best regards,

    Lin

  • Hi Lin,

    As I stated before that the MIBSPI does not have enough throughput (even in theory) to meet your 500Khz sampling requirement for sure. The best we can do is around 100Khz sampling. It is only 1/5 of the required throughput. To =me this is a dead end, unless you want drop your ADC sampling frequency.

    Best regards,

    Ming

  • Hi Ming,

    Yes, I understand and remember that the sapling rate limitation. We have revised our design and lower the sampling to around 100 KHz. And we would like to understand well the MCU+ SDK for the coming projects. As I spent some time on the MIBSPI, so I want use it as a start point.

    Thanks for your understanding.

    Best regards,

    Lin

  • Hi Lin,

    With the code build with release build, you should be able to get close to 100Khz ADC sampling rate. I am not sure what I can help your further on this topic.

    You ask for the way to dynamically change the MIBSPI configuration. I showed you the way to do it using syscfg:

    Drivers_open --> Drivers_mibspiOpen --> MIBSPI_open which uses the gMibspiOpenParams (set in the example.syscfg) to open/configure the MIBSPI instance

    If you want to change the MIBSPI instance configuration dynamically, you will have to close the currently opened MIBSPI instance using MIBSPI_close() and reopen it using different gMibspiOpenParams (with your required updates) again.

    Would you mind to close this thread?

    Thanks!

    Ming

  • Hi Ming,

    Thanks for your continuously help and support.

    Hopefully we can get your support in the other projects.

    Best regards,

    Lin