0.96" TFT 160x80 marked ST7735 (but actually GC9106) cropped display - SOLVED #1310
Replies: 13 comments 20 replies
-
If anyone has one of these displays that you thought was broken, here is a working sketch based on an 8051 driver example I received from the Chinese vendor. Perhaps it will help get someone started... I took the function initial() from this sketch and added it to Bodmers ST7735_init.h for my "BLUETAB" version which is the subject of this topic. ` #include <SPI.h> #define CS 10 #define uchar unsigned char #define RED 0xf800 void Contrast_Adjust(); //code uint typFNT_GBK16 hz16[]; void Output_Pixel(uint x, uint y); void delay_ms(uint time) void SPI_WriteData(uchar Data) void Lcd_WriteIndex(uchar Data) void Reset() //////////////////////////////////////////////////////////////////////////////////////////////
} void Lcd_SetRegion(unsigned int x_start, unsigned int y_start, unsigned int x_end, unsigned int y_end)
} void PutPixel(uint x_start, uint y_start, uint color) void fillRect(uint x, uint y, uint w, uint h, uint color) void drawRect(uint x, uint y, uint w, uint h, uint color) void dsp_single_colour(int color) void setup() void loop(void) #if 0 And here is the output: |
Beta Was this translation helpful? Give feedback.
-
I may be talking to myself here but in case it is of use to someone in the future, I found an error I made in hacking Bodmers code: In ST7735_Defines.h ... For my "new" BLUE TAB check I forgot to define CGRAM OFFSET. So now I am closer in all orientations but the remaining offsets, though small are not acceptable... suggestions welcome :-) |
Beta Was this translation helpful? Give feedback.
-
OK finally done. Again, I know I'm talking to myself entirely on this one but someone else may benefit in the future. |
Beta Was this translation helpful? Give feedback.
-
Turns out the controller on the display is NOT an ST7735S as is printed on the PCB.... it's a GalaxyCore GC9106. |
Beta Was this translation helpful? Give feedback.
-
I’ll be happy to help but will need a little time, I’ll try to work something up later today.
Tim
…Sent from my iPad
On Sep 16, 2021, at 5:05 AM, Sicco55 ***@***.***> wrote:
Arduino_ST7789
|
Beta Was this translation helpful? Give feedback.
-
Hello @Boyeen, I must say I have way less knowledge and experience with TFT_eSPI so I´m not sure what I need to change where to get this display working. Currently - whatever I try - I do get colors wrong (Red shows as yellow, green as magenta and blue as cyan), white and black are inverted and I do have an image offset as well ... Would you be able to provide some information / files how you got your displays to work? thanks - help would really be appreciated, as those are the smalles LCD I could find so far (and I need small ones) - MacSass |
Beta Was this translation helpful? Give feedback.
-
Hi, Missed this discussion, looks like you have it cracked though. If this display is still available I will accept a pull request. Changes must be the minimum required to support the display with no other edits. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hiya Nachus,
I can’t take much credit for the GC9106 mods. I was (like you) just trying to make use of some displays I got from China. In fact I asked the vendor for help and they sent me some 8051 driver code and I converted it over (with help from another user). I never looked at the instruction set so it doesn’t surprise me that the code is weird.
Anyway, from that intro you can probably tell that I don’t think I can be much help to you here. If the colors are wrong, they are probably inverted and there are some commands to handle that. Look in UserSetup.h, it says uncomment one of these:
// #define TFT_INVERSION_ON
// #define TFT_INVERSION_OFF
Sounds like you ALSO would like to mirror the display and I don’t know how to do that. If you want my help (for what it’s worth) to look further send me more info about what you are seeing. Or send me your code and I’ll see if I can spot anything.
Bodmer asked me to request him to pull my mods but I am not sure I trust them.
The mods worked for my displays/projects but I can’t vouch for them really.
Sorry not to be much help.
Tim
…Sent from my iPad
On Apr 4, 2022, at 7:37 PM, nachus001 ***@***.***> wrote:
Hello Boyeen
I'm using your library, great rpoduct! I came through one of those 0.96"tft's labelled ST7735S. I could implement the mod for the GC9106 controller (patched the 2.4 library with them) and actually make the thing run.
But... The display is mirrored and I cannot find a display command that can invert the video accessing in order to un-mirror what is seen in the screen.
I think this is due to how this particular manufacturer wired the panel to the chip.
Other issues, (when running GC9106_demo.ino) I don't know if they're related, but that background colors are not what the text says. "RED" is blue, and "BLUE" is red. However Green and gray are okey.
Would you tell me where in the library to hack in order to un-mirror the TFT output?
On the other side, i've checked the GC9106_init.h file and found that there are many commands that are not part of the GC9106 command set (nor the ST7735S controller either), and are apparently ignored (I commented them out with no adverse effect)
There are also incomplete commands, two 0xf0 and 0xf1 that require 15 parameters (by datasheet) and are given 14, and one final 0x2C that has a variable amount of parameters (per datasheet) and is issued with no parameters at all
Would you tell me where in the library to hack in order to un-mirror the TFT output?
thanks in advance
Nachus
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Sounds great Nachus,
I will take a look at the files and try to update mine. Then, if you are willing, I might ask you to download a fresh copy and check if it still works with your display? That will give us 2 points of reference and perhaps we can send a pull request to Bodmer. I will be sure to add you to the credits :-)
Thanks,
Tim
…Sent from my iPad
On Apr 5, 2022, at 7:00 PM, nachus001 ***@***.***> wrote:
Oh, and, in regards of color, the GC9106_defines.h lacked the color order flag. It was hardcoded, and, it worked for your display and not in mine :<
Now, the configuration from platformio.ini works ok. I uploaded it to a repository for anyone who wants to run this display
https://github.com/nachus001/GC9106_driver
Regards
Nachus
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Thanks very much for this driver and the explanation. It worked for my generic chinese display that was also supposed to be st7735. |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
As I stated earlier in this thread, the marking on the display are wrong wrt the controller, not uncommon with cheap Chinese displays. That is why it does not work with the base ST7735 library drivers.
I got help from Dave Prentice on the Arduino forum who knows far more than I ever will. Anyway, he had me run some code on the controller chip in my display and he was able to determine from the returned values that it reports as GC9106.
…Sent from my iPad
On May 3, 2022, at 11:00 AM, gkr321 ***@***.***> wrote:
How did you determine that? I don't see anything that says that on mine.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
I see a lot of Chinese vendors now selling these displays for cheap which appear to be defective.... they have a blue label and under TFT_eSPI, behave like 120x80 displays.... the screen is black at the end furthest from the ribbon. I have been looking into this and have a partial solution but am a babe-in-the-woods on LCD tech. Hopefully someone can help.
First, full disclosure, I got GREAT help from Dave Prentice on the Arduino forum, could not have gotten this far alone.
I obtained an 8051 driver from the Chinese vendor and Dave converted it and made a simple test sketch which works, it can
access the entire display (80x160) in simple fillRect() drawRect() style. IMHO the problem with these displays seems to be large screen offsets but ALSO that the controller is a clone of ST7735S, the init() code uses several undeclared controller registers/addresses.
My application is a jpg image load of the display in portrait mode. My code works with my "GOOD" displays (ST7735REDTAB). Of course I thought a bunch of $2 displays was too good an opportunity to pass up. More fool me?
I took the init() routine of Daves code and hacked it into ST7735_init(define)(rotate) driver files by adding a temporary INITR_BLUETAB #define. It's working in that I can access the whole display height (160) but my images are offset in the width (80) dimension. As I said, the 8051 code has correct geometry, so perhaps I am abusing Bodmers masterpiece? :-)
Sorry if I am not using correct LCD terminology... I know these are not simple bitmapped displays, but this is all new to me.
Q1. Where do I start trying to correct the geometry?
Q2. Is there some documentation on how to add/extend a driver?
I am happy to share my code, especially when I get it to work... but this msg has been long enough :-)
Here is the init() code I am using in st7735_init.h:
` if (tabcolor == INITB)
{
commandList(Bcmd);
}else if(tabcolor == INITR_BLUETAB) {
Serial.println("Initializing a blue display");
writecommand(0xfe);
writecommand(0xfe);
writecommand(0xfe);
writecommand(0xef);
writecommand(0xb3);
writedata(0x03);
writecommand(0x36);
writedata(0xd8);
writecommand(0x3a);
writedata(0x05);
writecommand(0xb6);
writedata(0x11);
writecommand(0xac);
writedata(0x0b);
writecommand(0xb4);
writedata(0x21);
writecommand(0xb1);
writedata(0xc0);
writecommand(0xe6);
writedata(0x50);
writedata(0x43);
writecommand(0xe7);
writedata(0x56);
writedata(0x43);
writecommand(0xF0);
writedata(0x1f);
writedata(0x41);
writedata(0x1B);
writedata(0x55);
writedata(0x36);
writedata(0x3d);
writedata(0x3e);
writedata(0x0);
writedata(0x16);
writedata(0x08);
writedata(0x09);
writedata(0x15);
writedata(0x14);
writedata(0xf);
writecommand(0xF1);
writedata(0x1f);
writedata(0x41);
writedata(0x1B);
writedata(0x55);
writedata(0x36);
writedata(0x3d);
writedata(0x3e);
writedata(0x0);
writedata(0x16);
writedata(0x08);
writedata(0x09);
writedata(0x15);
writedata(0x14);
writedata(0xf);
writecommand(0xfe);
writecommand(0xff);
writecommand(0x35);
writedata(0x00);
writecommand(0x44);
writedata(0x00);
writecommand(0x11);
delay (120);
writecommand(0x29);
//writecommand(0x2c);
writecommand(0x2A); //Set Column Address
writedata(0x00);
writedata(0x18);
writedata(0x00);
writedata(0x00);//(0x67);
writecommand(0x2B); //Set Page Address
writedata(0x00);
writedata(0x00);
writedata(0x00);
writedata(0x9f);
writecommand(0x2c);
// writecommand(TFT_INVON);
colstart = 1;
rowstart = 26;
}`
Beta Was this translation helpful? Give feedback.
All reactions