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

TWI easy DMA parallel channels

Hi,

assuming I have an IMU sensor with 3 different interrupt lines. And I want to start a TWI DMA transfer for each interrupt line in parallel. Is this possible since there is only one memory? This would mean to choose for each interrupt line one buffer address.

  • Hi,

    • What chip are you using here? nRF51 or nRF52?
    • What IMU sensor is this ?
    • The sensor have 3 different interrupt lines that are used to signal to the master device(nRF5x) that the sensor have data in the FIFO buffer waiting to be read by the master?
    • Do you get these interrupt at the same time?
    1. It is the nrf52
    2. It is the BMX055 from Bosch it has even more interrupt lines and there are configurable.
    3. For each sensor gyro, acc, mag I would get a different interrupt
    4. Depending on the configuration they might come at the same time.
  • Ok. TWI is a serial protocol, so you can't start these transfers completely in parallel. I see in one of you other post that you work directly on the register level. Depending on what abstraction layer you need, I would recommend that you either use the TWI transaction manager (app_twi) or the underlying TWI driver (nrf_drv_twi.c/h). With app_twi the transfers will be scheduled, and can be run either in the background or in blocking mode.

    In the TWI Transaction Manager Example, asynchronous data transfer requests are generated with button presses, you can easily change this so that the interrupt line is the one that is triggering the asynchronous data transfer requests. Both app_twi and nrf_drv_twi can be configured to use EasyDMA. With nrf_drv_twi you can also start transfers from PPI.

    The TWI Sensor Example shows you how the nrf_drv_twi driver is used.

  • okay this does not realy answer my question. So maybe I try to get more precise. Maybe with a different use case:

    • If I have one sensor connected via SPI and one connected via I2C
    • Now I want to start on both a DMA transfer which gets triggered by the data ready line.
  • Yes, this is possible using PPI. Use a PPI fork to trigger the TASKS_STARTRX task for both the SPI and I2C peripheral when you get a GPIOTE event(data ready line). If you are using the driver, see this page and this.

1 2