This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Inter SPI time

Hello, 

I wish to send SPI message by 2 Bytes per once, total 102 bytes.

Basically SPI works fine.

I wonder if there is way to reduce inter SPI time. It measured 18u sec.

Could it be around 2 u sec?

Below is my source code. 

nbBYtes is 102. TxBuffer and RxBuffer is 102 size buffer.

    for(index = 0; index < (nbBYtes / 2); index++)
    {
        spi1_xfer_done = false;

        err_code = nrf_drv_spi_transfer(&m_spi_ntm, &TxBuffer[2 * index], 2, tempRx, 2);
        RETURN_IF_ERROR(err_code);

        while (!spi1_xfer_done)
        {
            __WFE();
        }

        RxBuffer[2 * index] = tempRx[1];
        RxBuffer[2 * index + 1] = tempRx[0];
    }

Parents Reply
  • Hi,

    I tried array list. Still 18u sec takes between SPI.

    Regarding Easy DMA, I have some questions.

    In my configuration, SPI0_USE_EASY_DMA is already enabled.

    I defined  Tx&Rx buffer as Array list. 

    #define BUFFER_SIZE  2
    
    typedef struct ArrayList
    {
        uint8_t buffer[BUFFER_SIZE];
    } ArrayList_type;
    
    ArrayList_type gau8TxData[NB_16BIT_XFERS] = {0};
    ArrayList_type gau8RxData[NB_16BIT_XFERS] = {0};

    and execute SPI communication like below.

            for(index = 0; index < (nbBYtes / 2); index++)
            {
                spi1_xfer_done = false;
    
                err_code = nrf_drv_spi_transfer(&m_spi_ntm, &gau8TxData[index], 2, &gau8RxData[index], 2);
                RETURN_IF_ERROR(err_code);
    
                while (!spi1_xfer_done)
                {
                    __WFE();
                }
            }

    But I can't find .MAXCNT nor .PTR which is specified in your link.
    Did I miss something?
Children
Related