Pages: [1]   Go Down
Author Topic: What happens when...? I2C Scenarios  (Read 621 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 499
Posts: 19071
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5656
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

-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.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



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
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Link to freescale page: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPR121
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6788
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
-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.

Quote
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.
Logged

Pages: [1]   Go Up
Jump to: