This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

understanding SPI with easy DMA

Hi!

I want to understand different in use with DMA and w/o DMA in the SPI.

I explore example SPI from SDK examples and see that enabled SPI and SPIM together.

But at this case what 

spi_event_handler

handled?

SPI works with DMA? If I don't want to work with DMA? What should I do? 

Parents
  • Hi Mikhail

    There is no reason not to use DMA in the nRF52832. 

    The reason we support both is that the older nRF51 devices did not support DMA in the SPIM interface, and the driver was designed to support operation both with and without DMA. 

    All the nRF52 devices support DMA in the SPIM interface, and using DMA ensures less CPU utilization and lower current consumption, so I would recommend using it at all times. 

    Best regards
    Torbjørn

  • Hi! Thanks.

    I understand that should use DMA in the nRF52. 

    But DMA means SPIM? Or means NRFX?

    Could you explane me in the above screenshot, in the your example SPI, for what needs three SPI declarations?

    - NRFX SPIM

    - NRFX SPI

    - SPI enabled

    If I only need to use SPI master with DMA, which settings in the sdk_config.h should I enable?

    Which instance should use in those settings for DMA use?

    Why in this example used instance from just SPI?

    And in a code I use this instance

    #define SPI_INSTANCE  0 /**< SPI instance index. */
    static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);  /**< SPI instance. */

    Therefore, for use DMA with SPI master, how should minimum configure sdk_config.h and wich instance should enable?

Reply
  • Hi! Thanks.

    I understand that should use DMA in the nRF52. 

    But DMA means SPIM? Or means NRFX?

    Could you explane me in the above screenshot, in the your example SPI, for what needs three SPI declarations?

    - NRFX SPIM

    - NRFX SPI

    - SPI enabled

    If I only need to use SPI master with DMA, which settings in the sdk_config.h should I enable?

    Which instance should use in those settings for DMA use?

    Why in this example used instance from just SPI?

    And in a code I use this instance

    #define SPI_INSTANCE  0 /**< SPI instance index. */
    static const nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(SPI_INSTANCE);  /**< SPI instance. */

    Therefore, for use DMA with SPI master, how should minimum configure sdk_config.h and wich instance should enable?

Children
Related