I recently bought an XC4629 128x128 TFT screen and noticed that failing to initialise a background for the screen produced this RBG static.

A red line drawn on the screen without a background: enter image description here

The problem, however, is that when I did initialise a background, the "static" remained on 3-4 pixels down the side of the screen: enter image description here

Here is the code I used:

 #include <TFT.h> 
 #include <SPI.h>

 #define CS   10
 #define DC   9
 #define RESET  8  

 TFT myScreen = TFT(CS, DC, RESET);

 void setup(){

 void loop(){
   myScreen.stroke(255, 0, 0); 
   myScreen.line(0, 128, 128, 10); 

Is this a problem with the screen itself? I have searched around the internet and have found no similar issues. Due to the behaviour it seems like an code issue but I have made it as simple as possible and experimented and only found it goes away if I remove the signal and just have the screen on backlight only. I also double checked that the wiring was all in the correct slots (both referencing the code and the datasheet for the screen).

Many thanks in advance.

1 Answer 1


It will be a problem with the library you are using. Not all screens that use the same CoG are wired in quite the same way. Often a CoG that supports a larger number of columns is used with a screen that doesn't have that many columns (132 in this case), and the actual screen is placed at an offset within the available columns, and it's up to the manufacturer of the screen where that offset is.

So the library has to initialize the CoG with where the screen actually is within its physical column range, and your screen is different to what the library is expecting. Looking at the TFT library bundled with the IDE most screen configurations appear to impose a couple of pixels offset in the columns, which you don't want.

I would suggest investigating other TFT libraries, such as UTFT, which may give better control over screen parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.