It might well be a power issue too.
As I said I had a similar problem with a TFT turning white and hanging till I power-cycled it (since I also had no RST pin ;-)), when inserting an SD card in the on-board slot.
The reason was a very short voltage drop, which I could overcome with a cap - just as @bko already suggested.
So when Antony ( @apassemard ) says he sometimes gets a good result which then disappears, without obvious reason (since loop() is empty), it might well be an electrical issue.
Antony, how are you powering the Core?
Could you try a power supply >= 1000mA?
@ScruffR, I agree. A CHEAP USB power source has been shown over and over to cause problems. Using a quality supply like an Apple charger or similar unit is a good start.
@ScruffR I used your code but wonder about a possible typo in the following "if" statement: Looks like reserLevel should be HIGH no?
As is it didn't do much, so I started adding some delays here and there, and also serial outputs so I could track things a bit. I go HIGH, I go LOW, and I see the little D7 LED do it's thing but not output on the display.
The interesting thing is that randomly (and not often), I will see the text appear on the screen for a fraction of a second and it goes back to white right after. So something is happening.
To answer your question about voltage, I unsoldered the J1 on the board and reverted to a 5V input to VCC. I do power the LED with 3.3V, I actually tried 5V as the datasheet said it supports it (I think) and it just makes the screen brighter.
I power the Spark from my mac USB directly, but I switched to a USB power supply that outputs 2A to try as well. Same results. It's from an Android device.
I'll keep trying, it's encouraging to see the screen pop to life from time to time, even rarely. I'm wondering if the display may be defective as well..
@peekay123 I grabbed the new version in the repo and tried it as is (just changing DC to D6) and compiled but it didn't work.
It happened again. I resetted the spark entirely… Moved my DC pin to D0 to be able to use Peekay123’s code without any changes. I compiled, once, nothing, I compiled a second time and the screen flashed some text for 0.5 sec or so and went back white.
I think the display has an issue honestly… I should receive a couple new ones in the next couple of weeks. I’m giving up on this one. It should work… this is not normal.
@apassemard, you are correct, it does NOT look shorted! According to the schematics, shorted bypasses the onboard regulator allowing 3.3v as Vcc. So either the regulator is damaged, explaining a few things, or there enough of a short to bypass the regulator. I am just freaking glad it works!
I have bought one of these ‘cheap’ TFT displays with a ST7735B controller that appears to be exactly the same as your pictures. I have tried all the things in the thread above and I always see a white screen and nothing else. I have reached the conclusion the display is defective. Posting the code here if you might spot some mistake from your efforts to solve the problems with this type of display.
Update on this is that I received a ‘quality’ adafruit ST7735 display. With the defines above it still did not work. I have now inserted values directly into the tft object creation and this works. I am relieved to get this working, but can anyone explain why this is the case.
I am using/including the Adafruit_ST7735 library from the Web IDE and had copied the example code. Rather than me reproducing it here you should see the same in the library.
I am including:
// This #include statement was automatically added by the Particle IDE for the TFT display #include “Adafruit_ST7735/Adafruit_ST7735.h”
I have experienced this problem before with setting pinMode where if I use a #define relay D7 it does not work and if I use int relay = D7; if does.
Hmm, that’s odd if only the defines make the difference.
It should and did work, but one contributing factor could be that A2, D0 and D7 are #defines themselves and so the preprocessor would need to resolve multiple “layers” - maybe there was some change in the buildfarm that causes this behaviour now (ping @Dave)
Meanwhile could you try this, if this proves me right or wrong
I am using the Web IDE.
I tried with first suggestion above #define cs 12 etc. - that worked.
Then I tried #define cs A2 etc. - that worked and it didn’t before.
I will look in the other threads as you suggest - thanks for your advice.
I had the exact same problem reported by a bunch of people in different thread ( text displayed 1 time on 10…) most of the time the display turn and stay white. I’ve a 1.44" TFT display from adafruit (model 2088). After hours trying to figure what the problem is … using hardware reset fix the problem. @peekay123 I know you you suggest to use swReset but look unusable for some devices?
I use a fork of original Spark port from peekay123 (merged with latest Adafruit::ladyada libs supporting the 1.44" display )
I have a Particle Photon to drive the display.
PS. I’m completely new here, first post and newbie with electronic too (I’m not a developper neither…)