cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Reading state machine

khouja_houssem
Associate II
Posted on April 11, 2013 at 23:50

Hi,

I am working on STM10C eval board. I am trying to read X and Y datas from the touchscreen using a state machine inside the I2C_IRQ_Handler. The start byte is generated inside the EXTI interrupt once a touch is detected so I2C interrupts start working.

I implemented the code and it is working fine. But the problem is that the datas reception stops after a certain number of uses and when I push the reset button, the IO_Expander (STMPE811) does not initialize right and it does only work again if I unplug the power source and put it on back again. Knowing that the STMPE811 does not have a reset input and it is only possible to reset it by software, I think that the problem is related to it.

Any one had a similar problem on I2C communication? 

Still the problem may be related to software, but as it is working alright in the begining I don't think so. I hope someone can help.
1 REPLY 1
rbs3rd
Associate II
Posted on June 23, 2014 at 23:07

I'm not experiencing that problem, but I do notice that if I have the TC configured to provide just X, and Y coordinates, the very first Y coordinate always comes out 0. It's perfect after that, but the first 12 bits for the Y position are 0. No problems with the 12 bit for the first X, or any others after it.