Open geekerator opened 7 years ago
I'm working on some new products using the buy display LCD's and WiFi Arduino CPU modules. I started with the sumotoy RA8875 (thanks man, you must have spend a ton of time to write this code) . I have rewritten many parts of the code to fit our hardware design.
Above problem I also encountered during testing. It seems to be related to the SPI bus speed and the CPU clock speed (or compiler efficiency) and the reading of the TPXH/TPYH/TPXYL registers. function. As sumotoy mentions in his Wiki there must be bug in the RA8875 related to these registers. He mentions the SPI bus speed should be no higher then 10MHz. On my hardware I tried 7.5MHz which was too high, I mean the clock2 has above mentioned problem. So I slowed down the SPI speed to 3.75MHz, and now the touchscreen works fine.
So just try to reduce the SPI speed on your design (the read speed of the SPI !!!, not the writing speed).
Many thanks for the monumental work you have done on the RA8875 library - its greatly appreciated. I have a strange anomaly to report. It appears in an attached and very slightly modified touchTest.ino. I need to single thread the code following the original tft.touched() function, so I made the simple changes you will see in the attachment. The odd thing is the requirement to have the weirdly placed delayMicroseconds(500) statement in order to single thread. if it is commented out, single threading does not occur. Any help you can give would be much needed. Thank you...
touchTestOdd.ino.txt
My environment is: DUE, Adafruit RA8875+7' TFT LCD. I am fairly sure wiring is correct since all other functions of your library work just fine. The RA8875 has been calibrated.