What happens when...? I2C Scenarios

Hi,

I'm going to be using an MPR121 capacitance chip in a touchpad application. It has 12 electrodes. I had some general questions about I2C and a sensor type chip like the MPR121:

-What happens if you try reading the MPR121 but the MPR121 is in the middle of gathering it's sensor (electrode) data?
-What happens if you try reading the MPR121 and in the middle of that the MPR121 needs to sample its electrodes at the same time?

What does the datasheet say? Perhaps give a link to it.

trivialbob:
-What happens if you try reading the MPR121 but the MPR121 is in the middle of gathering it's sensor (electrode) data?
-What happens if you try reading the MPR121 and in the middle of that the MPR121 needs to sample its electrodes at the same time?

That depends on the MPR121, not the I2C bus. Read the datasheet.

cache.freescale.com/files/sensors/doc/data_sheet/MPR121.pdf?fpsp=1&WT_TYPE=Data%20Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation

Link to freescale page: NXP® Semiconductors Official Site | NXP Semiconductors

Can you suggest a keyword that I should search for to find this information?

-What happens if you try reading the MPR121 but the MPR121 is in the middle of gathering it's sensor (electrode) data?
-What happens if you try reading the MPR121 and in the middle of that the MPR121 needs to sample its electrodes at the same time?

guessing: Nothing. Even assuming that the MPR12 contains a microprocessor that does the sorts of things you're asking about sequentially, the pause at the level of external I2C behavior would be imperceptible, since I2C will usually have hardware shift registers and some buffering, and I2C is quite slow compared to modern microprocessor speeds.

Can you suggest a keyword that I should search for to find this information?

Something like "WARNING"? As in "warning: if an I2C command arrives during a sensor scan, response can be delayed up to nn clock cycles." Or perhaps "warning: the MPR121 processor should only be written to using I2C when it is not busy scanning its sensors, as indicated by the "IMNOTREADY" status bit."

You can get a more visceral feel for the possibilities by imagining code written for the AVR that would be an I2C slave, reporting data from sensors connected to IT.