Do you have any sample code that shows how to retrieve data via i2c from 2 different device addresses using PPI?
Do you have any sample code that shows how to retrieve data via i2c from 2 different device addresses using PPI?
Hi,
This will only be possible to achieve if you have identical read and write buffer sizes for both devices. You will need to use the EasyDMA array list feature, and fill the array with alternating read and write commands for the two devices. You can then write the TASKS_START register to start a transfer to one device. When you trigger TASKS_START again, the RXD and TXD buffers will jump to the next buffer in the list (by adding the MAXCNT size to the buffer pointer).
You can enable the EasyDMA list feature in the driver by setting the flag NRFX_TWIM_FLAG_TX_POSTINC/NRFX_TWIM_FLAG_RX_POSTINC, but you will have to reserve/fill the consecutive data in the RAM buffers manually. Unfortunately, we do not have any sample code apart from the code in the above linked TWIM peripheral documentation.
Best regards,
Jørgen
You can trigger transfers from two TWIM instances using PPI, but the max transfer size will depend on which chip you are using. nRF52832 support only 8-bit MAXCNT register for the TWIM peripheral. nRF52810 support 10 bit and nRF52840 support 16 bits. On nRF52832 you can use the EasyDMA Arraylist feature to transmitt/receive more data without CPU intervention (not bigger chunks, but more chunks).
You can trigger transfers from two TWIM instances using PPI, but the max transfer size will depend on which chip you are using. nRF52832 support only 8-bit MAXCNT register for the TWIM peripheral. nRF52810 support 10 bit and nRF52840 support 16 bits. On nRF52832 you can use the EasyDMA Arraylist feature to transmitt/receive more data without CPU intervention (not bigger chunks, but more chunks).