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: UDMA/DMSS and MSCSPI Integration example

Part Number: AM6442


Hi TI,

Any reference example available for handling MCSPI  data acquisition via UDMA or DMSS?

Example to read or write data to external ADC's from AM6442

Thanks & Regards
Anjan.

  • Hello Anjan,

    I understand your requirement: you want to read external ADC data from the AM64X.

    May I know why you want to go with external ADCs since AM64X has a 12-bit ADC and a 4 MSPS sampling rate?

    This ADSC spec is not sufficient for your use case.

    As of now, we don't have any examples of your use case.

    But a few other examples are available on the PRU core in both parallel and serial communication.

    Please go through the below link for more details.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/latest/exports/docs/api_guide_am64x/EXAMPLES_PRU_ADC_ADS85x8.html

    If you want to go with MCSPI + UDMA, an example is already available in the MCU+SDK, and you have to take this example as the base version. Next, you have to implement commands to read data from external ADCs.

    ..\examples\drivers\mcspi\mcspi_loopback_dma

    Regards,

    S.Anil. 

  • Hi Anil,

    Our requirement is AM6442 will be sitting on our main control board design which should talk with external daughter board( which has ADC's) via MCSPI.

    In our old design we used to utilize EDMA for data Acquisition from ADC's via SPI.

    Can you please help on this.

    Thanks 
    Anjan.

  • Hello Anjan,

    Ya sure.. Can you please provide details about which ADC you are using?

    We need to look at the datasheet to provide a software implementation.

    Already, you said you have an existing EDMA and MCSPI driver. So, we have to see how we can use the same code on the AM64X.

    If you have code, please share it with me. So, I can look at how you are reading data from an external ADC. Similarly, we have to do it on the AM64X.

    Regards,

    S.Anil.

  • Hi Anil,

    Requirement is simple we need to access the data from external ADC's via Multiple SPI's.

    Coming to speed it is around 10MHZ.

    Any AM64X Sample code which involves DMA acquisition to get data from external ADC with speed around 10MHZ.

    Thanks
    Anjan.

  • Hello Anjan,

    As of now, we don't have any MCSPI examples to interface with external ADCs.

    But the below example code can definitely help with your requirements.

    C:\ti\mcu_plus_sdk_am64x_08_06_00_43\examples\drivers\mcspi\mcspi_loopback_dma

    In this example, code is currently available on MCSPI+DMA.

    Coming to speed it is around 10MHZ.

    Please configure which ever speed you want, and check phase and polarity from the below system configuration.
    As per TRM maximum speed, you can configure up to 50 MHz

    Any AM64X Sample code which involves DMA acquisition to get data from external ADC with speed around 10MHZ.

    As of now, we don't have any MCSPI examples to interface with external ADCs.

    I am not sure which device you are connecting to the AM64X. So, typically, you need to send a command to read ADC data.

    So, send a command from the below function.

     

        /* Writeback buffer */
        CacheP_wb(&gMcspiTxBuffer[0U], sizeof(gMcspiTxBuffer), CacheP_TYPE_ALLD);
        CacheP_wb(&gMcspiRxBuffer[0U], sizeof(gMcspiRxBuffer), CacheP_TYPE_ALLD);


        /* Initiate transfer */
        MCSPI_Transaction_init(&spiTransaction);

        spiTransaction.channel  = gConfigMcspi0ChCfg[chip_no].chNum;
        spiTransaction.dataSize = 8U;
        spiTransaction.csDisable = TRUE;
        spiTransaction.count    = CMD_LEN / (spiTransaction.dataSize/8);
        spiTransaction.txBuf    = (void *)gMcspiTxBuffer;
        spiTransaction.rxBuf    = (void *)gMcspiRxBuffer;
        spiTransaction.args     = NULL;

        transferOK = MCSPI_transfer(gMcspiHandle[CONFIG_MCSPI0], &spiTransaction);

    C:\ti\mcu_plus_sdk_am64x_08_06_00_43\examples\drivers\mcspi\mcspi_loopback_dma

    Please go through the above example which can be helpful for your requirement .

    For your requirement you have to use D1 signal for receiving data .

    I hope this can be helpful for your requirement.

    Please close this thread and open new threads if you have new queries.