240x240 Round display with GC9A01 driver....undocumented command

Hi,
I recently purchased the “1.28’’ IPS TFT LCD Display 240x240 Round Circle Screen for Smart Watch” here: buydisplay
The site gives sample demo code (download) that is written by the manufacturer of the display “EastRising” and also links to the GC9A01 driver datasheet here.

Problem I have is that the demo code references command codes in the display initialization that are not documented in the driver datasheet. I would say approx 70% are not documented.
I contacted BuyDisplay and they said “Unfortunately we don’t have more specific datasheet for reference, The chip supplier only provided that datasheet to us.
I have not yet run the demo code but I am sure it will work, but I wanted to understand exactly what all the initialization commands are doing.
I have attached the GC9A01 sample driver code (header file) that shows the initialization code starting on line 385.
Example command in demo would be:

Write_Cmd(0x88);
Write_Cmd_Data(0x0A);

I have looked at a number of other driver chips ST7789, ILI9488, ILI9341 and none have any commands in the 0X80->0x8F range or 0x62->0x67 shown in demo code.
I have tried to contact EastRising, but I am not hopeful.

Has anyone seen this before?
Any help is appreciated.
Thanks
Mark

GC9A01.h (151 KB)

It looks like it is a regular MIPI-style controller like ST7789.
Your “program” contains the initialisation sequence.

The subsequent “user” commands will be just like ST7789, ST7735, … or any other SPI controller.

If you have the proper datasheet, please post link or attach PDF if < 2MB. Or PM me if too big.

David.

Hi David,

The GC9A01 driver datasheet provided with the product can be downloaded at https://www.buydisplay.com/download/ic/GC9A01A.pdf

I have developed a ST7789 driver before and the LCD initialization command codes are at least documented in the ST7789 datasheet.

The CG9A01 datasheet (linked to above) is missing a multitude of command codes that are used in the demo code, attached in the original first post.

Like I say in the original post, I am sure if I compiled and ran the demo it would work, but to not be able to document what most of the GC9A01 LCD initialization code is actually doing is a annoying, due to the command codes not being documented in the datasheet.

Thanks for responding
Mark

Thanks for the Galaxycore datasheet.

It is not uncommon to have undocumented registers. For example the GC9102 App Note has several registers that are not mentioned in the GC9102 datasheet.

It is not uncommon to have typos and copy-paste errors in GC datasheets.
And plain wrong items.

I presume that you have adapted the 8051 code for AVR or ARM. And that it works.

David.

Undocumented code (often called illegal opcode) has been around for a few decades: Illegal opcode - Wikipedia

Often time if there's little room left in the CPU or controller chip's design, the dev will slip in an extra command or 2. Often times, it's not published in official documentation because it's extra info that weren't planned. Other time it's unintended design glitches that aren't dangerous but can be exploited for extra feature or extra speed. And there's time people just got lazy when updating the official datasheets and overlook a few supported codes.

Hello!

I am using the same LCD with driver IC(GC9A01A) ;The example code is working fine for me.
But can anyone please suggest me that , how they have extracted the picture array to display the images on the LCD in the given example.

I tried this Image2LCD application to convert the 240*240 pixel image into an array it generated huge array of size 172808 bytes which leads to flash overflow . Then tried reducing the size but still when I use that array into display , it was completely useless; the pixels on display are nowhere close to expected image, it was displaying some random pixels in the selected window..

This image2LCD app is generating an array of byte but the example code has used an array of 16bits ,So please any suggestions or explanations on how the example code has extracted the picture array would be appreciated.

Thank you for the precious time!!
Regards,
Bindu

My motor car is greyish blue colour.

How are you going to solve my problem?

David.

From the GC9A01.h file attached to #0

//show picture
void show_picture(void)
{ 
	unsigned char i,j;
	unsigned int n=0;


   LCD_SetPos(60,40,179,199);
	for(j=0;j<160;j++)
	{
		for(i=0;i<120;i++)
		{
            Write_Data_U16(pic[n++]);
	    }
	}


    return;
}

This implies that pic has got 120x160 (19200) pixels. i.e. 38400 bytes.
This is too big for the AVR C++ compiler to access as a single array.
Obviously too big for a Uno flash memory.

This would fit ok in a Zero or Due. And solve the array problem.

240x240 = 57600 pixels. 115200 bytes is fine for Zero, Due, …

David.

this worked for me to convert images for use on this display, after tearing my hair out - also, be sure to set the dimensions correctly in your setup/loop code

https://www.digole.com/tools/PicturetoC_Hex_converter.php

yes, I agree with david_prentice - you won’t get more than a few lines, or text, or a single image using an Uno or Mega… heck, I couldn’t even get an image and a line of text, this “driver software” is just too bloated. Maybe someone knows how to remove all the unused fonts, that may help? For example, there are two chinese fonts, which Ive no use for.

here is the only code that exists for this display that I can find:
https://www.waveshare.com/wiki/1.28inch_LCD_Module