TWIM: EasyDMA transfers - STOP Task before STARTED Event

What happens if I trigger the STOP task to an I2C transaction that hasn't had a STARTED event yet? Will the STOPPED event immediately happen, or will the peripheral wait for a transaction to actually happen?

Background: I would like to set up automatic TWI master reads (TXRX) triggered by an external GPIO toggle along with using the EasyDMA list feature (implying NRFX_TWIM_FLAG_HOLD_XFER, NRFX_TWIM_FLAG_REPEATED_XFER, & NRFX_TWIM_FLAG_RX_POSTINC). These reads would proceed to fill a large buffer.  Asynchronous to this, I would like to periodically read out any collected data before having to wait until the next transaction to occur.

Sorry for the crude drawing, but what I'm looking to do the following, but I will not know I need the data prior to actually immediately requesting it.

Parents
  • Hello,

    I can understand what you want to do here, but I would suggest that you evaluate run-time when the next periodic reading of twi is relative to when you want to perform an manual reading, e.g. if you see that the time to next periodic reading is for instance less than the time to perform an twi transaction, then consider waiting or disable the ppi channel that may trigger the the periodic twi channel. If you see that you want to perform an manual twi transcation shortly after the periodic twi transfer is still ongoing, then you should wait with the manual twi transfer. 

    Doing it like above should avoid that you need to trigger stop task, instead you make sure to perform manual twi transcation at safe time, and if you don't want to perform a periodic twi transaction you instead disable the ppi channel in those situations. Reasons for doing it like this I deem it safer than all the possible corner cases of performing stop shortly after executing a start task (this might also be something the sensor is not happy about).

    Kenneth

Reply
  • Hello,

    I can understand what you want to do here, but I would suggest that you evaluate run-time when the next periodic reading of twi is relative to when you want to perform an manual reading, e.g. if you see that the time to next periodic reading is for instance less than the time to perform an twi transaction, then consider waiting or disable the ppi channel that may trigger the the periodic twi channel. If you see that you want to perform an manual twi transcation shortly after the periodic twi transfer is still ongoing, then you should wait with the manual twi transfer. 

    Doing it like above should avoid that you need to trigger stop task, instead you make sure to perform manual twi transcation at safe time, and if you don't want to perform a periodic twi transaction you instead disable the ppi channel in those situations. Reasons for doing it like this I deem it safer than all the possible corner cases of performing stop shortly after executing a start task (this might also be something the sensor is not happy about).

    Kenneth

Children
Related