Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdew075T7 Reduce black-white transitions during display update or invoke partial update #10

Closed
BitSalat opened this issue Jul 14, 2020 · 22 comments
Assignees
Labels
needs Testing Not yet tested, cannot be used in prooduction

Comments

@BitSalat
Copy link

We have implemented latest cale-idf repo but now see an issue with display.update - every update causes 3 transistions from black->white before new contents is visible. As we are using the waveshare 7.5" V2 display I assume that a partial update is not possible?
However why do we need 3 transistions, is there a way to reduce to one transition?

@martinberlin martinberlin self-assigned this Jul 15, 2020
@martinberlin
Copy link
Owner

martinberlin commented Jul 15, 2020

The only way I know is doing a partial update, full update() always uses 3 refreshes, that is not an issue is the normal behaviour. Only partial update uses one transition. But on 7.5" V2 is still not working like it should. We will need to go together through the documentation.
On GxEPD is also not working so we may be missing some SPI command or there is something that needs correction. Let's start by putting links to the available documentation:
https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT_(B) is quite confusing. Better check the Good display documentation. My presumption is that Waveshare only adds electronics on top, but EPD's are good display:

https://storage.luckycloud.de/d/3d3bfde36f7744cb90d5/?p=/GoodDisplay&mode=list PDFs

GD7965 is the controller. In http://www.good-display.com is not listed anymore so we may have to email them. It's not easy to find documentation for this ones, since sometimes they remove models if there are not available anymore.

Wiki link of 7.5 V2

@BitSalat
Copy link
Author

Will check if I can find a datasheet later - meanwhile do you know the Zephyr project: https://www.zephyrproject.org/?
Basically this is a RTOS for embedded devices but they do have display drivers and are also supporting the GD7965 here:
https://github.com/zephyrproject-rtos/zephyr/blob/7a822078fcac21012d5cbc498f469fa2a81895d6/drivers/display/gd7965.c
Maybe something we can get some inputs ...
BTW you can still find the GD7965 datasheet here: https://v4.cecdn.yun300.cn/100001_1909185148/GD7965.pdf

@martinberlin
Copy link
Owner

Nice will research a bit tonight and check against the commands we are sending. I hope it can be fixed since I'm also very interested in get partial updates working as they should

@martinberlin
Copy link
Owner

Will be some days away from the keyboard since I’m going to Poland. Will keep this one on my mind for further research

martinberlin added a commit that referenced this issue Jul 19, 2020
@martinberlin
Copy link
Owner

@martinberlin martinberlin added New epaper New Epd implementation needs Testing Not yet tested, cannot be used in prooduction and removed New epaper New Epd implementation labels Jul 21, 2020
@martinberlin
Copy link
Owner

@BitSalat Added a new class wave7i5.h

Still not tested, have to coordinate with my father, since I do not have this EPD at home anymore (Was a gift to him)

@BitSalat
Copy link
Author

Dev boards are on their way to you - please check your email!

@martinberlin
Copy link
Owner

martinberlin commented Jul 22, 2020

Many thanks. Sadly I have 2 not so good news:

  1. 800*480 seems to be out-of-stock in Waveshare
    5 65“ 13 3“ e Paper Displays

  2. Even trying with Waveshare 7.5 EPD example, I cannot do a successful partial refresh:

void Epd::Displaypart(const unsigned char* pbuffer, unsigned long xStart, unsigned long yStart,unsigned long Picture_Width,unsigned long Picture_Height) {
    SendCommand(0x13);
    int * padd; // Why on earth they declare a pointer they dont use?

    for (unsigned long j = 0; j < height; j++) {
        for (unsigned long i = 0; i < width/8; i++) {
            if( (j>=yStart) && (j<yStart+Picture_Height) && (i*8>=xStart) && (i*8<xStart+Picture_Width)){
                SendData(~(pgm_read_byte(&(pbuffer[i-xStart/8 + (Picture_Width)/8*(j-yStart)]))) );
            }else {
                SendData(0x00);
            }
        }
    }
    SendCommand(0x12);
}

This in my opinion is just like a normal update. See that in the other class is sending a "Partial IN" command and some Ram pointers, to signalize the update area.
Like this, unless we find the right commands, in a documentation that is well written will be really hard to get this working.
Added this page to explain better the difference between full and partial update
https://github.com/martinberlin/cale-idf/wiki/Epaper-full-vs-partial-update

@martinberlin martinberlin changed the title Reduce black-white transistions during display update or invoke partial update gdew075T7 Reduce black-white transistions during display update or invoke partial update Jul 22, 2020
@martinberlin
Copy link
Owner

@BitSalat sent an email to good display about partial update and added here:
https://github.com/martinberlin/cale-idf/wiki/Model-gdew075T7.h -> Link to the IC controller PDF (In page 10 the partial update reference)

@martinberlin

This comment has been minimized.

@martinberlin
Copy link
Owner

Last 7.5 I ordered does not support partial update. News: Good Display sent an example program that performs a partial update (In other platform)
GDEW075T7_P_20191125.zip

@BitSalat
Copy link
Author

thanx for your continued efforts for the partial update however I understand that it is not supported on the 7.5" displays from Waveshare or GoodDisplay. Perhaps there will be new devices in the future.

@martinberlin
Copy link
Owner

martinberlin commented Jul 31, 2020

It's not supported on the color ones. In 7.5" 2 color is supported and I attached the Good Display example.
There is not such a thing as Waveshare EPD, their displays are manufactured by Good Display, they add external electronics and rebrand them as Waveshare but the one that really has last word about what the epaper can or cannot do is Good display.
So I'm attaching their example, we just have to try hard to adapt it, but it may work.
About new devices, but a bit more expensive, they are two new brands that can be a good example:

  1. PlasticLogic with offices in Dresden. Amazing flexible epapers. Everything works including partial refresh, super fast. Added already as a base class to CalEPD component. (4 levels of gray)
  2. Inkplate Based on refurbished Kindle displays, also a very interesting project, 800*600 with 3 bit grayscale ( 6 levels of gray) This one are super fast, but are not SPI, they communicate in Parallel so they take 8 GPIOs. This will be much harder to adapt to ESP-IDF

martinberlin added a commit that referenced this issue Aug 10, 2020
…was borrowed from GxEPD. Not tested, will make a termin with father
@martinberlin
Copy link
Owner

Dear Stefan I will try to get one 7.5 epaper again this time. Tried last week but they are out of stock. This epaper have support for partial update but is not easy to do and undocumented.
Also the gxEPD example does not work so it’s not an easy thing to get working.
I will also implement an additional buffer for light gray, this will take an additional:
Width*height/8 bytes buffer (each byte stores 8 monochrome pixels)

@martinberlin
Copy link
Owner

New 7.5 gdew075T7 was purchased days ago. When it arrives I will make a deep test on this one again and try to solve the partial update and find a way to make the temperature issue better (If possible)
So leaving this open till then, sorry for the long wait!!!
Please try the touch if you can and in next purchase get a cheap 2.7 touch epaper from Good Display (15 u$ aprox.)

@martinberlin
Copy link
Owner

martinberlin commented Jan 4, 2021

Such a bad luck with this one. It arrived but didn't left any message, so it comes back to China...AHhhm. And after they send again I will finally get it ;)
UPDATE: Is finally coming next weeks so I will finally work on optimizing it.
I would also like to add gray(s) but that will need an ESP32 with PSRAM like the ones you sent me. Very grateful for that @BitSalat

@martinberlin martinberlin changed the title gdew075T7 Reduce black-white transistions during display update or invoke partial update gdew075T7 Reduce black-white transitions during display update or invoke partial update Jan 16, 2021
@martinberlin
Copy link
Owner

@BitSalat my new 7.5 epaper is finally coming to Berlin in the next weeks. Sorry that it took so long. I’m still very grateful to use the ESP32 controllers you sent me and about the growth of this library because of you, the early main adopters

@martinberlin martinberlin mentioned this issue Jul 10, 2021
3 tasks
@BitSalat
Copy link
Author

@martinberlin thanx for info. We are using your cale-idf for our OpenHAB / HomeAssistant ePaper displays with great success and wouldn't have been able to do so without your libraries. There's only one thing still a bit annoying. For updating the screen it takes 4 changes between black and white which looks not so sexy. Is there a way to reduce that?

@martinberlin
Copy link
Owner

There is partial update. But is not as clean as full update. When this 7.5 arrives will make a branch so we can test it together.
I guess a good combination would be to do partial refresh and from time to time a full refresh. Full always makes that 4 flashes. It seems the only way to fully clean the Eink from the screen is doing that. Will get back to you soon

@martinberlin
Copy link
Owner

martinberlin commented Jul 30, 2021

EPD 7.5 arrived, will leave it wired to SPI to try new partial display, Goodisplay sent this function, it's for SMT32 but what matters is the CMD and data sent:

/***************************partial display function*************************************/

void partial_display(u16 x_start,u16 x_end,u16 y_start,u16 y_end ,const unsigned char *old_data,const unsigned char *new_data,unsigned char mode) //partial display
{
   unsigned int i;
		EPD_W21_WriteCMD(0X50);
		EPD_W21_WriteDATA(0x47);		
		lut1();
	  EPD_W21_WriteCMD(0x91);		//This command makes the display enter partial mode
		EPD_W21_WriteCMD(0x90);		//resolution setting
		EPD_W21_WriteDATA (x_start/256);
		EPD_W21_WriteDATA (x_start%256);   //x-start    		
		EPD_W21_WriteDATA (x_end/256);		
		EPD_W21_WriteDATA (x_end%256-1);  //x-end

		EPD_W21_WriteDATA (y_start/256);
		EPD_W21_WriteDATA (y_start%256);   //y-start    	
		EPD_W21_WriteDATA (y_end/256);		
		EPD_W21_WriteDATA (y_end%256-1);  //y-end

		EPD_W21_WriteCMD(0x10);	       //writes Old data to SRAM for programming
 
	if(mode==0)
	for(i=0;i<48000;i++)	     
	{
	 EPD_W21_WriteDATA(0xff);  
	}
	else
	 for(i=0;i<48000;i++)	     
	{
	 EPD_W21_WriteDATA(~old_data[i]);  
	}  
	
	EPD_W21_WriteCMD(0x13);				 //writes New data to SRAM.
		for(i=0;i<48000;i++)	     
	 {
		EPD_W21_WriteDATA(~new_data[i]);  
	 }  
	 
		EPD_W21_WriteCMD(0x12);		 //DISPLAY REFRESH 		             
		driver_delay_xms(300);     //!!!The delay here is necessary, 200uS at least!!!     
		lcd_chkstatus();
	  
}

/////////////////////////////////partial display waveform////////////////
const unsigned char lut_vcom1[] ={
0x00	,0x19	,0x01	,0x00	,0x00	,0x01,//0x00	,0x19	,0x01	,0x00	,0x00	,0x01,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00
	,0x00	,0x00,					};
const unsigned char lut_ww1[] ={
0x00	,0x19	,0x01	,0x00	,0x00	,0x01,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,};
const unsigned char lut_bw1[] ={
0x80	,0x19	,0x01	,0x00	,0x00	,0x01,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	};
const unsigned char lut_wb1[] ={
0x40	,0x19	,0x01	,0x00	,0x00	,0x01,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	};
const unsigned char lut_bb1[] ={
0x00	,0x19	,0x01	,0x00	,0x00	,0x01,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	
0x00	,0x00	,0x00	,0x00	,0x00	,0x00,	};

@martinberlin
Copy link
Owner

martinberlin commented Jul 30, 2021

@BitSalat just corrected the partial update Waveform in branch: refactor/oop

You can try to use partial update now. Try flashing demo-epaper.cpp adding it in the CMakeFiles and commenting the rest.
Short video:
https://sync.luckycloud.de/d/ba23888bbf604bdea17f/

@martinberlin
Copy link
Owner

Dear @BitSalat closing this since I didn't got any feedback since 30 July (4 months aprox.)
Feel free to re-open if there is something more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs Testing Not yet tested, cannot be used in prooduction
Projects
None yet
Development

No branches or pull requests

2 participants