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

What happens on the TWI communication when there is an Interruption

I'm using TWI and BLE functions together. My TWI sensor is operating at 400kHz, low priority. BLE has the highest priority. For example, if nRF52805 is sending commands to the TWI sensor, and it's been interrupted by BLE. So the TWI sensor doesn't receive the full command continuously.

Question:

When BLE causes interruptions, what happens to the TWI communication? 

How could the senor itself know that there is an interruption?

What are the SDA and SCL values (high or low) when it's been interrupted?

How could the sensor know that the interruption is completed? 

Thanks! 

Parents
  • The TWI transfers are typically using EasyDMA (TWIM), which means that only the start may be delayed due to higher interrupt priority may cause the twi call to be delayed in the application. Once started the EasyDMA will tranfer all bytes as configured, even if there are other processing going on, once twi transfer is finished the data reside in RAM ready to be handled in due time.

    In old days before EasyDMA was introduced there could be delays between bytes when interrupted by higher level interrupts, I have not really seen any errors due to this, since there are in any case start and stop conditions on TWI to ensure that the peer know when an entire twi transfer is started and ended.

    Kenneth

  • Excellent explanation, thanks, Kenneth! 

    So TWI master (nRF52) sends a command, the TWI slave sensor will return only 1 complete data. In order to get another sensor measurement, the master needs to re-send the command. The salve sensor will NOT return data continuously forever, is that right? 

    I'm new to Nordic nRF52. Do you have any links/tutorials to explaining the EasyDMA? 

    Thank you! 

Reply
  • Excellent explanation, thanks, Kenneth! 

    So TWI master (nRF52) sends a command, the TWI slave sensor will return only 1 complete data. In order to get another sensor measurement, the master needs to re-send the command. The salve sensor will NOT return data continuously forever, is that right? 

    I'm new to Nordic nRF52. Do you have any links/tutorials to explaining the EasyDMA? 

    Thank you! 

Children
Related