GTT43a I2C Bug

GTT TFT Support

Moderator: Mods

Post Reply
iotexpert.com
LCD!
Posts: 16
Joined: Fri Apr 27, 2018 9:15 am

GTT43a I2C Bug

Post by iotexpert.com » Sun May 06, 2018 11:35 am

I have a loop that does I2C reads...

essentially like this

while(1)
{
x = read
print x
}

When you run this you will get 0's ... until there is something in the buffer... this is good.

I have a screen with a legacy button. Every time you press the button it puts 252,135,0,2,0,7 into the buffer... when that happens you can see a string of 0's then the message... then more 0's ... that is good.

What is notice is that if you press the button on the screen... really fast... it will eventually cause the I2C to hang.... when it hangs... SDA becomes stuck at 0...

I am guessing that the mcu on the gtt43 doesn't clock stretch...

Or maybe when you make the mcu busy by touching so frequently it hangs the I2C bus.

I also notice that if I put a delay in the loop... the longer the delay the less likely it is to hang... this makes me think that if the CPU is busy writing to some buffer and you do an I2C read that it hangs.

There are tons of obvious problems with the delay... so id rather not have it.

Has anyone else seen this bug? Any known solutions?

To unhang the i2c bus you have to
1) Power cycle the screen
2) send it 8 SCLs of 0..

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 176
Joined: Thu Sep 24, 2015 9:38 am

Re: GTT43a I2C Bug

Post by Daniel Divino » Thu May 17, 2018 9:16 am

Hi iotexpert,

I'll take a look at the I2C bus and test this specific situation. I'll let you know what I find.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 176
Joined: Thu Sep 24, 2015 9:38 am

Re: GTT43a I2C Bug

Post by Daniel Divino » Thu May 17, 2018 10:48 am

Hi iotexpert,

I have set up a test bench similar to what you described and was unable to replicate the issue you've described.

The GTT's processor is capable of clock stretching so that shouldn't be the cause of the issue.

Did you have any scripts attached to your button or does your host process any data when the button is pressed, other than the button return message? Also, if possible, could you send me your project? It would make it easier to replicate the issue.

Also, have you considered setting up a timer to determine when information is parsed from the display? This will allow you to control how often touch responses are parsed from the display, but unlike a standard delay, it won't block your host from doing anything else while waiting.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 176
Joined: Thu Sep 24, 2015 9:38 am

Re: GTT43a I2C Bug

Post by Daniel Divino » Thu May 17, 2018 11:17 am

Hi iotexpert,

After talking to our firmware designer, it sounds like the GTT's processor is capable of clock stretching, but it has been firmware disabled. I'll see if we can provide you a beta firmware with clock stretching enabled to see if that helps the situation.

Cheers,
Daniel Divino
Daniel Divino
Technical Support
Matrix Orbital

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest