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

uart, i2c/twi communication with polling, interrupt, DMA method different brief explained guide

Hello,

i have searched for uart, i2c/twi communication with polling, interrupt, DMA method different brief explained guide for NRF52

but i have not found it any where plz suggest me a good guide for the same....or share me examples for different methods separately

which is supportable sdk 15 or above...bcz serial library from sdk13 i am not able to run in sdk17 and 15 

Regards

  • Hi,

    Polling means that the CPU needs to constantly/regularly read the EVENT registers in the peripheral, to see if a TASK has completed. Polling mode is often implemented in the drivers as Blocking mode. With interrupts, the peripheral will automatically trigger an interrupt handler in the driver/application when an EVENT occurs. In interrupt mode, the CPU can sleep while waiting for events, which will save power. Interrupt mode is often implemented in the drivers as Non-blocking mode. See Peripheral interface for more details around these HW concepts.

    DMA is used by the peripherals to read/write data directly to/from RAM during transfers, to allow the CPU to sleep. This is described in more details in the EasyDMA chapter. Only peripherals with EasyDMA support (UARTE, TWIM, TWIS, SPIM, SPIS) can use DMA. Other peripherals (UART, TWI, SPI) will have to provide the data for each byte that will be transferred, which will wake CPU much more often than when EasyDMA is used.

    nrf_serial library is deprecated and removed in SDK 17.0.0, but should be available and working for earlier SDK versions. In SDK 17.0.x, it is recommended to use libUARTE library.

    Best regards,
    Jørgen

Related