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

nRF52 TWI easyDMA feature

Hi,

I want to know that if the TWI easyDMA in nRF52 can help in achieving this task:

  • we want to read from TWI each 10msec based on a timer interrupt and write the values in an array, e.g., A

  • meanwhile we want to transfer an array, e.g., B. Assume we can choose between non-connectable advertising or being in a connection.

Is this possible? Normally we should wait for the reading to finish, and then transmit in the 10msec window. Can DMA help in eliminating this sequence?

Thanks!

Parents
  • Hi,

    I guess it's not EasyDMA (alone) but rather PPI (see the description here). It should be possible to launch TWI transfer upon Timer end event (all that purely in HW without need to wake or interrupt CPU) but still you will probably need some management in your app. I did similar with PWM and SPI just by using NRF drivers from SDK 10/11 (they use EasyDMA and I've used two rotating 128-byte buffers to keep the PWM continuous, you are limited to 255B for single transfer on SPI and TWI anyway). It worked with interrupts at 1ms range, so 10ms shouldn't be a problem.

    Cheers Jan

  • Still for the case of PPI vs easyDMA I'm not getting my answer, and about the example I made: when I say 100msec we need the radio it means no other interrupts can be handled. The reason: timing of reading from TWI is important, so any delay cause by the radio is not acceptable. So, which method will make it possible to not miss the 10 samples in this example and still be able to transmit? To make it clear: whenever the timer interrupts for 10msec, we HAVE TO service it ASAP, no matter if the radio is active or not.

Reply
  • Still for the case of PPI vs easyDMA I'm not getting my answer, and about the example I made: when I say 100msec we need the radio it means no other interrupts can be handled. The reason: timing of reading from TWI is important, so any delay cause by the radio is not acceptable. So, which method will make it possible to not miss the 10 samples in this example and still be able to transmit? To make it clear: whenever the timer interrupts for 10msec, we HAVE TO service it ASAP, no matter if the radio is active or not.

Children
No Data
Related