touch button update, fix display settings font and size#6360
touch button update, fix display settings font and size#6360arendst merged 1 commit intoarendst:developmentfrom
Conversation
Please, can you test if with the actual arduino STAGE core from today this I2C issue is still there? |
|
@gemu2015 in my build core pre2.6 i use a different i2c (wip) driver which saves about 600 bytes of iram. PR esp8266/Arduino#6326 |
Yes, that is right. I could compile STAGE by disabling:
|
|
as it turns out it is not related to pre 2.6 this routine returns wrong values on 2.52 and above has anybody a hint what might be wrong ? original code called with reg 2 (number of touch points) uint8_t FT6236readTouchRegister(uint8_t reg) |
|
i checked the i2c changes between 2.42 and 2.52 but couldn't figure out what could be the reason for the touch controller failure. a simple workaround fixed the problem however => reading the status register twice while the 1. reading delivers wrong readings every few seconds, the 2.reading is always correct Strange! |
|
Could this be a clock strech issue? There is still a open issue to. |
|
There are a few things wrong with FT6236readTouchRegister().
Basically, if all works ok, you get the correct button touch state, but in case of error you cannot detect it. I2C is a shared bus, meaning things will go wrong at times. How about sth like this?: https://github.com/joba-1/HumiControl/blob/master/src/main.cpp#L162 With that you could see what the "real" error is. Maybe a timing issue. Maybe bus congestion, Maybe the datasheet demands an unusual delay somewhere, Whatever... HTH |
|
@Jason2866 @joba-1 |
|
not saying my proposals will fix the error, just that modifying the code to check and report errors instead of guessing could help finding the actual cause :) |
|
you are right! Wire.beginTransmission(FT6236_i2c_addr); Wire.endTransmission returns error 3 (received NACK on transmit of data) but what difference in the core causes this ??? since the workaround fixes the problem i will not further investigate but this may affect other i2c devices also |
|
ok, maybe the error has nothing to do with this call. It could well be, the previous i2c access (from what ever) leaves the bus in an inconsistent state and the first stop at the end of endTransmission() sorts this out. |
|
me again, lol. Interesting how much can happen in so few code lines. What about the default stop parameter of endTransmission(bool stop = true)? Or maybe it is just another core bug... Whatever, I don't have the device and can't test, so I guess I'm out of here now, too. |
|
ok, i was curious what is going on and took my logic analyzer. |
|
found the bug! i don't know however why this doesn't affect other sensors. very strange void Twi::init(unsigned char sda, unsigned char scl) } |
|
Have you addressed your finding at Arduino ESP8266 github? |
|
Sure, removing the attachInterrupt will solve your slave mode problem as it disables slave mode. Simply call Wire.begin() without address when you do not want slave mode. A master does not need any address because it will never send the own address to anyone. Neither does anyone need the address of the master, because it cannot even get addressed, because you disabled slave mode. There may be bugs in slave mode, @Jason2866 cross referenced 5762. But this is due to esp8266 being too slow for handling interrupts for i2c running at 100kHz. |
|
yes thats the difference. in the touch controller code i got from the net there was a wire.begin(address) a simple wire.begin() solves the problem. thanks. |


Description:
Related issue (if applicable): fixes #<#6357>
displayfont, displaysize now immediately set font and size
touch button interface rework.
remark:
on pre core 2.6 the touch i2c driver is unreliable. until now i could not figure out what is wrong
obviously there must be changes in the i2c driver.
Checklist: