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

WaveShare 2.9 inch e-paper support (IL3820) #318

Closed
bogus105 opened this Issue Jul 28, 2017 · 143 comments

Comments

Projects
None yet
@bogus105

bogus105 commented Jul 28, 2017

E-paper displays are getting more and more popular for battery powered applications. WaveShare e=paper displays are nice and almost cheap. It would be fantastic to add WaveShare e-paper displays support in your excellent u8g2 library.

Please add 2.9inch 296x128 pixels module to your list.
http://www.waveshare.com/w/upload/e/e6/2.9inch_e-Paper_Datasheet.pdf

Thank you!

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Jul 28, 2017

Owner

According to the datasheet, this E-Paper uses an IL3820 controller.
https://www.smart-prototyping.com/image/data/9_Modules/EinkDisplay/GDE029A1/IL3820.pdf
Is the IL3820 compatible to SSD1608?

One problem: Chap 13.2 of the display data sheet is empty. But I need the LUT code for the display.
Without the LUT it will be almost impossible to set pixel on the display.

@bogus105:
Can you takeover testing?

Owner

olikraus commented Jul 28, 2017

According to the datasheet, this E-Paper uses an IL3820 controller.
https://www.smart-prototyping.com/image/data/9_Modules/EinkDisplay/GDE029A1/IL3820.pdf
Is the IL3820 compatible to SSD1608?

One problem: Chap 13.2 of the display data sheet is empty. But I need the LUT code for the display.
Without the LUT it will be almost impossible to set pixel on the display.

@bogus105:
Can you takeover testing?

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Jul 28, 2017

Oliver,
can you explain me what is LUT? i've seen it before when looking at the waveshare code.
I found this:

`//Write LUT register
#ifdef EPD02X13
static unsigned char LUTDefault_full[] = {0x32,0x22,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x01,0x00,0x00,0x00,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

#else
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};
#endif
`

so it seems 2.13inch display has different LUT table and all other displays (1,54inch and 2,9inch) share the same LUT values:
`//Write LUT register
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};
#endif
`

Yes i can test it. Be aware the hardware i have on hand now: WaveShare 2.9inch 296x122 module and Arduino Nano converted to 3.3V, Arduino Uno (but 5V). I ordered ESP8266 in China and waiting for it (it may take some time).

bogus105 commented Jul 28, 2017

Oliver,
can you explain me what is LUT? i've seen it before when looking at the waveshare code.
I found this:

`//Write LUT register
#ifdef EPD02X13
static unsigned char LUTDefault_full[] = {0x32,0x22,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x01,0x00,0x00,0x00,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

#else
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};
#endif
`

so it seems 2.13inch display has different LUT table and all other displays (1,54inch and 2,9inch) share the same LUT values:
`//Write LUT register
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};

static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};
#endif
`

Yes i can test it. Be aware the hardware i have on hand now: WaveShare 2.9inch 296x122 module and Arduino Nano converted to 3.3V, Arduino Uno (but 5V). I ordered ESP8266 in China and waiting for it (it may take some time).

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Jul 28, 2017

Owner

The LUT contains the display specific waveform for the pixel programming of the display.
I also found this in the code.


  #define xDot 128
  #define yDot 296
  #define DELAYTIME 1500


//LUT for the 296x128 device:
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00
,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};
  static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};



	EPD_Write(GDOControl, sizeof(GDOControl));	// Pannel configuration, Gate selection
	EPD_Write(softstart, sizeof(softstart));	// X decrease, Y decrease
	EPD_Write(VCOMVol, sizeof(VCOMVol));		// VCOM setting
	EPD_Write(DummyLine, sizeof(DummyLine));	// dummy line per gate
	EPD_Write(Gatetime, sizeof(Gatetime));		// Gage time setting
	EPD_Write(RamDataEntryMode, sizeof(RamDataEntryMode));	// X increase, Y decrease
	EPD_SetRamArea(0x00,(xDot-1)/8,(yDot-1)%256,(yDot-1)/256,0x00,0x00);	// X-source area,Y-gage area
	EPD_SetRamPointer(0x00,(yDot-1)%256,(yDot-1)/256);	// set ram

Owner

olikraus commented Jul 28, 2017

The LUT contains the display specific waveform for the pixel programming of the display.
I also found this in the code.


  #define xDot 128
  #define yDot 296
  #define DELAYTIME 1500


//LUT for the 296x128 device:
static unsigned char LUTDefault_full[] = {0x32,0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00
,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00};
  static unsigned char LUTDefault_part[] = {0x32,0x10,0x18,0x18,0x08,0x18,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
,0x00,0x13,0x14,0x44,0x12,0x00,0x00,0x00,0x00,0x00,0x00};



	EPD_Write(GDOControl, sizeof(GDOControl));	// Pannel configuration, Gate selection
	EPD_Write(softstart, sizeof(softstart));	// X decrease, Y decrease
	EPD_Write(VCOMVol, sizeof(VCOMVol));		// VCOM setting
	EPD_Write(DummyLine, sizeof(DummyLine));	// dummy line per gate
	EPD_Write(Gatetime, sizeof(Gatetime));		// Gage time setting
	EPD_Write(RamDataEntryMode, sizeof(RamDataEntryMode));	// X increase, Y decrease
	EPD_SetRamArea(0x00,(xDot-1)/8,(yDot-1)%256,(yDot-1)/256,0x00,0x00);	// X-source area,Y-gage area
	EPD_SetRamPointer(0x00,(yDot-1)%256,(yDot-1)/256);	// set ram

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Jul 28, 2017

It looks like the information you was looking for, right? i still can't understand display pixels orienation vs RAM - i mean how to organize memory (font libraries, drawing procedures, etc.) to properly display its content on the display.
Are you able to merge the part of the code above with your powerful u8g2 library? It is far beyond my skills. Hey, i'm an oil&gas engineer, not a programmer:)

bogus105 commented Jul 28, 2017

It looks like the information you was looking for, right? i still can't understand display pixels orienation vs RAM - i mean how to organize memory (font libraries, drawing procedures, etc.) to properly display its content on the display.
Are you able to merge the part of the code above with your powerful u8g2 library? It is far beyond my skills. Hey, i'm an oil&gas engineer, not a programmer:)

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Jul 28, 2017

Owner

Let's see. I just collected information first.

Owner

olikraus commented Jul 28, 2017

Let's see. I just collected information first.

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Jul 28, 2017

I found what i was trying to say:) This is Scan Mode. See IL3820 datasheet:

https://www.smart-prototyping.com/image/data/9_Modules/EinkDisplay/GDE029A1/IL3820.pdf

bogus105 commented Jul 28, 2017

I found what i was trying to say:) This is Scan Mode. See IL3820 datasheet:

https://www.smart-prototyping.com/image/data/9_Modules/EinkDisplay/GDE029A1/IL3820.pdf

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 8, 2017

I have that lcd too. Would be perfect using u8g2 because it is easy and perfect good

bobybobybob commented Aug 8, 2017

I have that lcd too. Would be perfect using u8g2 because it is easy and perfect good

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 8, 2017

Owner

I did not found time to work on this... From where did you buy this device?

Owner

olikraus commented Aug 8, 2017

I did not found time to work on this... From where did you buy this device?

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 8, 2017

Oliver we will wait:) Mine came from robotic etc stuff online shop from Poland: botland.com.pl but i've seen them in at least few online shops so far.

bogus105 commented Aug 8, 2017

Oliver we will wait:) Mine came from robotic etc stuff online shop from Poland: botland.com.pl but i've seen them in at least few online shops so far.

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 8, 2017

Would it help if we sponsor you one of that device for developing get easy for you better have own ?

bobybobybob commented Aug 8, 2017

Would it help if we sponsor you one of that device for developing get easy for you better have own ?

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 9, 2017

Got my waveshare 2.9" just recently and the demo code drives me crazy. The orientation feels just .. wrong. Anyone got this mystery solved?

cimba007 commented Aug 9, 2017

Got my waveshare 2.9" just recently and the demo code drives me crazy. The orientation feels just .. wrong. Anyone got this mystery solved?

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 9, 2017

i tried an example but commented out most of the demo code leaving 'prograss bar' only. After uploading progress bar showed up at the botton of the screen running across the whole screen. But any tries to modify its shape (width / lenght / segment count / speed) was unsuccesful. The original library seems sooo wierd!
Really looking forward for Oliver to have some spare time to look at this:) His u8g2 is the most reliable and powerfull lib for displays i've ever seen!

bogus105 commented Aug 9, 2017

i tried an example but commented out most of the demo code leaving 'prograss bar' only. After uploading progress bar showed up at the botton of the screen running across the whole screen. But any tries to modify its shape (width / lenght / segment count / speed) was unsuccesful. The original library seems sooo wierd!
Really looking forward for Oliver to have some spare time to look at this:) His u8g2 is the most reliable and powerfull lib for displays i've ever seen!

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 9, 2017

Just so anybody gets the ideo why this display is so strange ..

img_20170809_184231

The display get initialized with ID = 01

image

I modified the string example to print a little arrow .. which is printed from right to left .. where I would have expected it to be printed from left to right (the origin is "wrong" and the direction too ..

  const int origin_y = 0;
  Serial.println(">> end of setup <<");

  byte pattern[16] = { 0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000,
                      0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000 };
  EPD.EPD_Dis_Part(origin_x+0,origin_x+7,origin_y+8+0,origin_y+8+16-1,(unsigned char *)pattern,1);
  //driver_delay_xms(DELAYTIME);
    
  EPD.EPD_Dis_Part(origin_x+16+0,origin_x+16+7,origin_y+8+0,origin_y+8+16-1,(unsigned char *)pattern,1);
  //driver_delay_xms(DELAYTIME);

  EPD.EPD_Dis_Part(origin_x+16+0,origin_x+16+7,origin_y+32+0,origin_y+32+16-1,(unsigned char *)pattern,1);

Since I have very little nubmers as x/y coordinates I expect my arrows to appear near the origin of the display (so rotating the display is no option), having the origion at the top right corner .. feels wrong.

EPD.EPD_Dis_Part(0,7,8+0,8+16-1,(unsigned char *)pattern,1);

cimba007 commented Aug 9, 2017

Just so anybody gets the ideo why this display is so strange ..

img_20170809_184231

The display get initialized with ID = 01

image

I modified the string example to print a little arrow .. which is printed from right to left .. where I would have expected it to be printed from left to right (the origin is "wrong" and the direction too ..

  const int origin_y = 0;
  Serial.println(">> end of setup <<");

  byte pattern[16] = { 0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000,
                      0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000 };
  EPD.EPD_Dis_Part(origin_x+0,origin_x+7,origin_y+8+0,origin_y+8+16-1,(unsigned char *)pattern,1);
  //driver_delay_xms(DELAYTIME);
    
  EPD.EPD_Dis_Part(origin_x+16+0,origin_x+16+7,origin_y+8+0,origin_y+8+16-1,(unsigned char *)pattern,1);
  //driver_delay_xms(DELAYTIME);

  EPD.EPD_Dis_Part(origin_x+16+0,origin_x+16+7,origin_y+32+0,origin_y+32+16-1,(unsigned char *)pattern,1);

Since I have very little nubmers as x/y coordinates I expect my arrows to appear near the origin of the display (so rotating the display is no option), having the origion at the top right corner .. feels wrong.

EPD.EPD_Dis_Part(0,7,8+0,8+16-1,(unsigned char *)pattern,1);

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 11, 2017

Owner

Would it help if we sponsor you one of that device for developing get easy for you better have own ?

Thanks for the kind offer, but this is not required.
I try to order one of these bigger displays. However I have to wait a little but longer for the order.

Owner

olikraus commented Aug 11, 2017

Would it help if we sponsor you one of that device for developing get easy for you better have own ?

Thanks for the kind offer, but this is not required.
I try to order one of these bigger displays. However I have to wait a little but longer for the order.

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 11, 2017

Oliver note among Waveshare e-paper displays the biggest one - 4.3 inch 800x600 pixels is controlled in different manner! it uses UART. The rest displays: 1.54inch, 2.13inch and 2.9inch uses that wierd, unfriendly protocol/library. So if you're going to order the biggest to create user-friendly library then the biggest would be 2.9 inch one.

bogus105 commented Aug 11, 2017

Oliver note among Waveshare e-paper displays the biggest one - 4.3 inch 800x600 pixels is controlled in different manner! it uses UART. The rest displays: 1.54inch, 2.13inch and 2.9inch uses that wierd, unfriendly protocol/library. So if you're going to order the biggest to create user-friendly library then the biggest would be 2.9 inch one.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 11, 2017

Owner

Yes, my assumption is this at the moment:

Waveshare 2.9", 296×128, IL3820 (compatible to SSD1608?)
Waveshare 2.13", 250x122, IL3895 (compatible to SSD16xx??)
Waveshare 1.54", 200x200, controller unknown, could be compatible to SSD1607

My goal was to focus on the 2.9". However, it would be cool to know, whether the existing u8g2 SSD1607 driver works with the 1.54 display.

Owner

olikraus commented Aug 11, 2017

Yes, my assumption is this at the moment:

Waveshare 2.9", 296×128, IL3820 (compatible to SSD1608?)
Waveshare 2.13", 250x122, IL3895 (compatible to SSD16xx??)
Waveshare 1.54", 200x200, controller unknown, could be compatible to SSD1607

My goal was to focus on the 2.9". However, it would be cool to know, whether the existing u8g2 SSD1607 driver works with the 1.54 display.

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 11, 2017

Good to hear that. I have the same one for tests. I can test it on the following platforms: arduino uno, mega, nano and esp8266-12e.

bogus105 commented Aug 11, 2017

Good to hear that. I have the same one for tests. I can test it on the following platforms: arduino uno, mega, nano and esp8266-12e.

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 11, 2017

The Codemaker from GxEPD use 3 different Dingdongs for that 3 Display Formats. https://github.com/ZinggJM/GxEPD

GxGDEP015OC1 => Waveshare 1.54 SPI
GxGDE0213B1 => Waveshare 2.13 SPI
GxGDEH029A1 => Waveshare 2.9 SPI

bobybobybob commented Aug 11, 2017

The Codemaker from GxEPD use 3 different Dingdongs for that 3 Display Formats. https://github.com/ZinggJM/GxEPD

GxGDEP015OC1 => Waveshare 1.54 SPI
GxGDE0213B1 => Waveshare 2.13 SPI
GxGDEH029A1 => Waveshare 2.9 SPI

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 11, 2017

Owner

Good to hear that. I have the same one for tests. I can test it on the following platforms: arduino uno, mega, nano and esp8266-12e.

So you would be able to test the 200x200 device? There is already a u8g2 constructor for the SSD1607. Will this constructor work?

The Codemaker from GxEPD use 3 different Dingdongs for that 3 Display Formats. https://github.com/ZinggJM/GxEPD

Somehow they do not reveal the controller. It should be something like ILxxxx or SSDxxxx.

Owner

olikraus commented Aug 11, 2017

Good to hear that. I have the same one for tests. I can test it on the following platforms: arduino uno, mega, nano and esp8266-12e.

So you would be able to test the 200x200 device? There is already a u8g2 constructor for the SSD1607. Will this constructor work?

The Codemaker from GxEPD use 3 different Dingdongs for that 3 Display Formats. https://github.com/ZinggJM/GxEPD

Somehow they do not reveal the controller. It should be something like ILxxxx or SSDxxxx.

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 11, 2017

Oliver, i have 2.9 inch 296x128 pixels only.

bogus105 commented Aug 11, 2017

Oliver, i have 2.9 inch 296x128 pixels only.

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 11, 2017

So you would be able to test the 200x200 device?

Dear Friend,
i will order now that display and when it is here i can test it for you. Only need then a arduino esp code blabla for Programm it like you want.

bobybobybob commented Aug 11, 2017

So you would be able to test the 200x200 device?

Dear Friend,
i will order now that display and when it is here i can test it for you. Only need then a arduino esp code blabla for Programm it like you want.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 11, 2017

Owner

Please note that the esp32 is not yet supported by u8g2 (well actually the esp32 core library is not yet fully Arduino compatible)

Owner

olikraus commented Aug 11, 2017

Please note that the esp32 is not yet supported by u8g2 (well actually the esp32 core library is not yet fully Arduino compatible)

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 11, 2017

I can test (pro mini, nano, uno, mega, ESP07, ESP12e, ESP12F, ESP32 and stm32F103)

bobybobybob commented Aug 11, 2017

I can test (pro mini, nano, uno, mega, ESP07, ESP12e, ESP12F, ESP32 and stm32F103)

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 11, 2017

I tried to visualize what the original "example" for the display is doing and came to the conclusion .. that it is fucked up.

Not only are the Y-Start and End parameters swapped and inconsistent in the example (function EPD_Dis_Part calling EPD_part_display) .. x and y are swapped all together .. and its a real mess .. I wonder why the fonts still come up the right way .. I guess minus and minus results in plus.

image

IL3820.zip

First of all .. how is the display oriented and what is x and y?

image

Suggests that the controller supports up to 320 rows which is
xy

Orange bars try to represent the actual bytes (8bit) that are written one by one to the ram. (remember golden pins from the first picture)

61ulq3m1 cl sl1223

So my approch was .. that I want to write some data to the origin!!! x = 0 and y = 0

The pictures in 8.3 Data Entry Mode Setting (11h) are pretty confusing .. so reading the text will help.

When AM = “1”, the address counter is updated in the Y direction.

ID [1:0]="11”
X: increment
Y: increment

This should write the first byte in the position at bottom left, the next byte right next to it (right) as y is increased .. and if it should reach the end of the y-window it would increment x and write one row to the top .. beginning at left.

So what should be done to work with this concept?

Remember by arrow pattern?

  byte pattern[16] = { 0xFF-0b10000001, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000,
                      0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000 };

Visualisation:
image

To stay as close as possible to the datasheet and my thoughts from the beginning my source code looks like this.

uint8_t xStart;
uint8_t xEnd;
uint8_t yStart;
uint8_t yEnd; // End must be greater than start

  xStart = 32+0;
  xEnd = 32+7;
  yStart = 0;
  yEnd = 7;    // End must be greater or equal? than start
  
  EPD.EPD_part_display(xStart/8,xEnd/8,yStart%256,yStart/256,yEnd%256,yEnd/256);    
  EPD.EPD_WriteDispRam(xEnd-xStart, yEnd-yStart+1,pattern);
  EPD.EPD_Update_Part();
  driver_delay_xms(500);
  EPD.EPD_part_display(xStart/8,xEnd/8,yStart%256,yStart/256,yEnd%256,yEnd/256);  
  EPD.EPD_WriteDispRam(xEnd-xStart, yEnd-yStart+1,pattern);

What would you expect from this?

img_20170811_203213

If you have ever played with the SSD1306 OLED-Display this part from its datasheet might be familiar as the SSD1306 has a similar memory structure.

image

If anyone got any questions to my writeup freel free to ask.

cimba007 commented Aug 11, 2017

I tried to visualize what the original "example" for the display is doing and came to the conclusion .. that it is fucked up.

Not only are the Y-Start and End parameters swapped and inconsistent in the example (function EPD_Dis_Part calling EPD_part_display) .. x and y are swapped all together .. and its a real mess .. I wonder why the fonts still come up the right way .. I guess minus and minus results in plus.

image

IL3820.zip

First of all .. how is the display oriented and what is x and y?

image

Suggests that the controller supports up to 320 rows which is
xy

Orange bars try to represent the actual bytes (8bit) that are written one by one to the ram. (remember golden pins from the first picture)

61ulq3m1 cl sl1223

So my approch was .. that I want to write some data to the origin!!! x = 0 and y = 0

The pictures in 8.3 Data Entry Mode Setting (11h) are pretty confusing .. so reading the text will help.

When AM = “1”, the address counter is updated in the Y direction.

ID [1:0]="11”
X: increment
Y: increment

This should write the first byte in the position at bottom left, the next byte right next to it (right) as y is increased .. and if it should reach the end of the y-window it would increment x and write one row to the top .. beginning at left.

So what should be done to work with this concept?

Remember by arrow pattern?

  byte pattern[16] = { 0xFF-0b10000001, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000,
                      0xFF-0b00000000, 0xFF-0b00011000,0xFF-0b00011000,0xFF-0b00011000,0xFF-0b11111111,0xFF-0b01111110,0xFF-0b00111100,0xFF-0b00011000 };

Visualisation:
image

To stay as close as possible to the datasheet and my thoughts from the beginning my source code looks like this.

uint8_t xStart;
uint8_t xEnd;
uint8_t yStart;
uint8_t yEnd; // End must be greater than start

  xStart = 32+0;
  xEnd = 32+7;
  yStart = 0;
  yEnd = 7;    // End must be greater or equal? than start
  
  EPD.EPD_part_display(xStart/8,xEnd/8,yStart%256,yStart/256,yEnd%256,yEnd/256);    
  EPD.EPD_WriteDispRam(xEnd-xStart, yEnd-yStart+1,pattern);
  EPD.EPD_Update_Part();
  driver_delay_xms(500);
  EPD.EPD_part_display(xStart/8,xEnd/8,yStart%256,yStart/256,yEnd%256,yEnd/256);  
  EPD.EPD_WriteDispRam(xEnd-xStart, yEnd-yStart+1,pattern);

What would you expect from this?

img_20170811_203213

If you have ever played with the SSD1306 OLED-Display this part from its datasheet might be familiar as the SSD1306 has a similar memory structure.

image

If anyone got any questions to my writeup freel free to ask.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 11, 2017

Owner

wow, looks like i need to have this display in my lab also.

Owner

olikraus commented Aug 11, 2017

wow, looks like i need to have this display in my lab also.

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 11, 2017

I will try to sum up my findings and strip down the code to provide a really easy to understand and use example. Maybe this will help you to impelment this display to u8g2

cimba007 commented Aug 11, 2017

I will try to sum up my findings and strip down the code to provide a really easy to understand and use example. Maybe this will help you to impelment this display to u8g2

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 11, 2017

Hardware:
Arduino ProMini (1Mhz internal osc.) @ 3.3Volt THE DISPLAY MIGHT BE DESTROYED ON 5VOLT

Software:
Arduino 1.8.2
Compiler LTO: Enabled (this saves up some more space but is optional)

Connection:
BUSY (purple) D7
RST (white) D8
DC (green) D9
CS (orange) D10
CLK (yellow) D13
DIN (blue) D11
GND (black) Ground
3.3V (red) 3.3Volt

As promised I stripped out unneded stuff and changed the font to a progmemfont inspired from https://github.com/greiman/SSD1306Ascii/blob/master/SSD1306Ascii/src/fonts/Adafruit5x7.h

This results in a small footprint working example. There is NO SERIAL OUTPUT as this would only bloat the size of the sketch.

Der Sketch verwendet 3462 Bytes (10%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 118 Bytes (5%) des dynamischen Speichers, 1930 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.

epd_2_9_easy.zip

EDIT (12.08.2017):
I fixed some stuff, and included low power sleep mode ( https://github.com/LowPowerLab/LowPower ).
Furthermore I reimplemented the Dis_String function to include an invert for better results.

With the Arduino's voltage reulator removed, the atmega328p in powerDown mode and the display reset with a SWRESET (command 0x12) the whole "project" consumes ~34µA with the ram-data preserved.

epd_2_9_easy_low_power.zip

Edit2:
After working some time with this display .. I get very disappointed .. just from removing the main power while having some capacitors in line (which will result in voltage < 2.4V) the memory can become corrupted. This corruption can not be reset by hardware-reset pin .. only be completly disconnecting the display from power ..

cimba007 commented Aug 11, 2017

Hardware:
Arduino ProMini (1Mhz internal osc.) @ 3.3Volt THE DISPLAY MIGHT BE DESTROYED ON 5VOLT

Software:
Arduino 1.8.2
Compiler LTO: Enabled (this saves up some more space but is optional)

Connection:
BUSY (purple) D7
RST (white) D8
DC (green) D9
CS (orange) D10
CLK (yellow) D13
DIN (blue) D11
GND (black) Ground
3.3V (red) 3.3Volt

As promised I stripped out unneded stuff and changed the font to a progmemfont inspired from https://github.com/greiman/SSD1306Ascii/blob/master/SSD1306Ascii/src/fonts/Adafruit5x7.h

This results in a small footprint working example. There is NO SERIAL OUTPUT as this would only bloat the size of the sketch.

Der Sketch verwendet 3462 Bytes (10%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 118 Bytes (5%) des dynamischen Speichers, 1930 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.

epd_2_9_easy.zip

EDIT (12.08.2017):
I fixed some stuff, and included low power sleep mode ( https://github.com/LowPowerLab/LowPower ).
Furthermore I reimplemented the Dis_String function to include an invert for better results.

With the Arduino's voltage reulator removed, the atmega328p in powerDown mode and the display reset with a SWRESET (command 0x12) the whole "project" consumes ~34µA with the ram-data preserved.

epd_2_9_easy_low_power.zip

Edit2:
After working some time with this display .. I get very disappointed .. just from removing the main power while having some capacitors in line (which will result in voltage < 2.4V) the memory can become corrupted. This corruption can not be reset by hardware-reset pin .. only be completly disconnecting the display from power ..

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 13, 2017

what a great job cimba007. What do you mean by:

After working some time with this display .. I get very disappointed .. just from removing the main power while having some capacitors in line (which will result in voltage < 2.4V) the memory can become corrupted. This corruption can not be reset by hardware-reset pin .. only be completly disconnecting the display from power ..<

bogus105 commented Aug 13, 2017

what a great job cimba007. What do you mean by:

After working some time with this display .. I get very disappointed .. just from removing the main power while having some capacitors in line (which will result in voltage < 2.4V) the memory can become corrupted. This corruption can not be reset by hardware-reset pin .. only be completly disconnecting the display from power ..<

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Aug 13, 2017

cimba007 commented Aug 13, 2017

@bogus105

This comment has been minimized.

Show comment
Hide comment
@bogus105

bogus105 Aug 13, 2017

ok, got it. i'll be able to test some codes in the end of the upcoming week. i'll see if its specific to your particular display or to these displays

bogus105 commented Aug 13, 2017

ok, got it. i'll be able to test some codes in the end of the upcoming week. i'll see if its specific to your particular display or to these displays

@olikraus olikraus added this to the 2.17 milestone Aug 14, 2017

olikraus added a commit that referenced this issue Aug 14, 2017

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 14, 2017

Owner

Added 296x128 device for u8g2.
Of course this is not tested, because i do not own this device.

U8G2_IL3820_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=/ 13, / data=/ 11, / cs=/ 10, / dc=/ 9, / reset=*/ 8); // WaveShare 2.9 inch eInk/ePaper Display

It would be great if someone code test this device with u8g2.

Owner

olikraus commented Aug 14, 2017

Added 296x128 device for u8g2.
Of course this is not tested, because i do not own this device.

U8G2_IL3820_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=/ 13, / data=/ 11, / cs=/ 10, / dc=/ 9, / reset=*/ 8); // WaveShare 2.9 inch eInk/ePaper Display

It would be great if someone code test this device with u8g2.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 14, 2017

Owner

The lastest u8g2 lib is available here:

https://github.com/olikraus/U8g2_Arduino/archive/master.zip

Please use the "add lib zip file" menu of the Arduino IDE for the installation.

Owner

olikraus commented Aug 14, 2017

The lastest u8g2 lib is available here:

https://github.com/olikraus/U8g2_Arduino/archive/master.zip

Please use the "add lib zip file" menu of the Arduino IDE for the installation.

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob Aug 14, 2017

HELLO WORD u8x8

Bibliothek U8g2_Arduino-master in Version 2.17.1 im Ordner: C:\Users\Vogel\Documents\Arduino\libraries\U8g2_Arduino-master wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire wird verwendet
exit status 1
'U8G2_IL3820_296X128_1_4W_SW_SPI' does not name a type


HELLO WORD Pagebuffer

See Video https://youtu.be/uNN2BZ7HSjs


HELLO WORD FULLbuffer

no much RAM (Arduino Pro Mini)

Arduino Mega + LogicConverter ==> Same like https://youtu.be/uNN2BZ7HSjs

bobybobybob commented Aug 14, 2017

HELLO WORD u8x8

Bibliothek U8g2_Arduino-master in Version 2.17.1 im Ordner: C:\Users\Vogel\Documents\Arduino\libraries\U8g2_Arduino-master wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI wird verwendet
Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire wird verwendet
exit status 1
'U8G2_IL3820_296X128_1_4W_SW_SPI' does not name a type


HELLO WORD Pagebuffer

See Video https://youtu.be/uNN2BZ7HSjs


HELLO WORD FULLbuffer

no much RAM (Arduino Pro Mini)

Arduino Mega + LogicConverter ==> Same like https://youtu.be/uNN2BZ7HSjs

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Aug 14, 2017

Owner

hmmm.... i guess i need to order the display first for myself :-(

Owner

olikraus commented Aug 14, 2017

hmmm.... i guess i need to order the display first for myself :-(

@bobybobybob

This comment has been minimized.

Show comment
Hide comment
@bobybobybob

bobybobybob commented Aug 16, 2017

Here is Video with 200x200 1.54 Waveshare Display.

https://www.youtube.com/watch?v=IqKgGfVnwgU&feature=youtu.be

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 8, 2017

Owner

Release 2.17.10:

https://github.com/olikraus/U8g2_Arduino/archive/master.zip

I think the code for this device is now finished (unless you find some bugs).

Compared to 2.17.9:

  • Code cleanup
  • There are now two constructors:
    • U8G2_IL3820_296X128...: Slow, lot of screen flicker, init code from vendor, best quality
    • U8G2_IL3820_V2_296X128...: Faster, lesser screen flicker, maybe little bit lesser display quality
  • Increased startup speed for both devices, lesser screen flicker and ghosting during startup.
  • setPowerSave() now controlls the charge pump of the e-paper controller. Without using the power save mode, the charge pump will be active as long as the e-paper device is powered.

Use the following code pattern to disable the charge pump for minimal power consumption:

void setup(void) {
  u8g2.begin();			// e-paper is cleared, charge pump is active
    // charge pump still active after .begin()
  u8g2.setPowerSave(1);	// set power save mode: disable charge pump
}

...

  u8g2.setPowerSave(0);	// before drawing, enable charge pump (req. 300ms)
  u8g2.firstPage();
  do {
    draw();
  } while ( u8g2.nextPage() );
  u8g2.setPowerSave(1);	// disable charge pump
Owner

olikraus commented Sep 8, 2017

Release 2.17.10:

https://github.com/olikraus/U8g2_Arduino/archive/master.zip

I think the code for this device is now finished (unless you find some bugs).

Compared to 2.17.9:

  • Code cleanup
  • There are now two constructors:
    • U8G2_IL3820_296X128...: Slow, lot of screen flicker, init code from vendor, best quality
    • U8G2_IL3820_V2_296X128...: Faster, lesser screen flicker, maybe little bit lesser display quality
  • Increased startup speed for both devices, lesser screen flicker and ghosting during startup.
  • setPowerSave() now controlls the charge pump of the e-paper controller. Without using the power save mode, the charge pump will be active as long as the e-paper device is powered.

Use the following code pattern to disable the charge pump for minimal power consumption:

void setup(void) {
  u8g2.begin();			// e-paper is cleared, charge pump is active
    // charge pump still active after .begin()
  u8g2.setPowerSave(1);	// set power save mode: disable charge pump
}

...

  u8g2.setPowerSave(0);	// before drawing, enable charge pump (req. 300ms)
  u8g2.firstPage();
  do {
    draw();
  } while ( u8g2.nextPage() );
  u8g2.setPowerSave(1);	// disable charge pump

@olikraus olikraus closed this Sep 8, 2017

@olikraus olikraus reopened this Sep 8, 2017

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 8, 2017

Owner

reopen (closed by mistake...)

Owner

olikraus commented Sep 8, 2017

reopen (closed by mistake...)

olikraus added a commit that referenced this issue Sep 8, 2017

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 8, 2017

Hello,
Thanks a lot for these updates.
My project is trying to make a weather station with nodeMCU.
I have tried the last version (2.17.10) and it seems to works very well on it. Nice improvements, it seems that the display is now more black :) (tried with U8G2_IL3820_296X128 ).
I tried also U8G2_IL3820_V2_296X128, i didn't notice less quality, but I have much less screen flicker with it and no black screen before the refresh, so it's perfect :) Great job !

openelearning commented Sep 8, 2017

Hello,
Thanks a lot for these updates.
My project is trying to make a weather station with nodeMCU.
I have tried the last version (2.17.10) and it seems to works very well on it. Nice improvements, it seems that the display is now more black :) (tried with U8G2_IL3820_296X128 ).
I tried also U8G2_IL3820_V2_296X128, i didn't notice less quality, but I have much less screen flicker with it and no black screen before the refresh, so it's perfect :) Great job !

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 8, 2017

Very usefull this u8g2.setPowerSave(1) .
If i didn't put a delay before, the display is a little grey. WIth a delay(500); before it's well displayed in black color.

openelearning commented Sep 8, 2017

Very usefull this u8g2.setPowerSave(1) .
If i didn't put a delay before, the display is a little grey. WIth a delay(500); before it's well displayed in black color.

@jjjrmy

This comment has been minimized.

Show comment
Hide comment
@jjjrmy

jjjrmy Sep 9, 2017

When will this be live in the Arduino Library?

jjjrmy commented Sep 9, 2017

When will this be live in the Arduino Library?

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

@openelearning
Thanks for your feedback.
Where exactly did you place the delay? Just before the call to u8g2.setPowerSave(1)?

@jjjrmy
Not sure. At least I also wanted to aply the e-paper improvements to the 200x200 device. Any reasons why it is needed more urgently?

Owner

olikraus commented Sep 9, 2017

@openelearning
Thanks for your feedback.
Where exactly did you place the delay? Just before the call to u8g2.setPowerSave(1)?

@jjjrmy
Not sure. At least I also wanted to aply the e-paper improvements to the 200x200 device. Any reasons why it is needed more urgently?

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 9, 2017

@olikraus
yes :
u8g2.print("hPa"); } while ( u8g2.nextPage() ); delay(500); u8g2.setPowerSave(1);
I haven't tested yet other values than 500, certainly smallest could works also. I can do more test if it could be useful.

openelearning commented Sep 9, 2017

@olikraus
yes :
u8g2.print("hPa"); } while ( u8g2.nextPage() ); delay(500); u8g2.setPowerSave(1);
I haven't tested yet other values than 500, certainly smallest could works also. I can do more test if it could be useful.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

hmm... ok, thanks. I have added another 100ms inside nextPage() for this..

Owner

olikraus commented Sep 9, 2017

hmm... ok, thanks. I have added another 100ms inside nextPage() for this..

olikraus added a commit that referenced this issue Sep 9, 2017

@oceanapplications

This comment has been minimized.

Show comment
Hide comment
@oceanapplications

oceanapplications Sep 9, 2017

I'm having issues where the top ~20 pixels in a row sometimes can't be written. It seems to be an intermittent issue.

Just using the hello world example with text written to the upper rows.

void loop(void) {
  u8g2.firstPage();
  do {
  u8g2.setFont(u8g2_font_ncenB10_tr);
  u8g2.drawStr(0, 0, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 25, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 50, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 65, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 100, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 125, "text line 123456789 123456789 123456789");
  } while ( u8g2.nextPage() );
  delay(1000);
}

img_0676

oceanapplications commented Sep 9, 2017

I'm having issues where the top ~20 pixels in a row sometimes can't be written. It seems to be an intermittent issue.

Just using the hello world example with text written to the upper rows.

void loop(void) {
  u8g2.firstPage();
  do {
  u8g2.setFont(u8g2_font_ncenB10_tr);
  u8g2.drawStr(0, 0, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 25, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 50, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 65, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 100, "text line 123456789 123456789 123456789");
  u8g2.drawStr(0, 125, "text line 123456789 123456789 123456789");
  } while ( u8g2.nextPage() );
  delay(1000);
}

img_0676

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

I am not exacly sure what you mean. The first line might not be visible if the default reference position for string s still set to the baseline of the chars:

https://github.com/olikraus/u8g2/wiki/u8g2reference#setfontposbaseline

Owner

olikraus commented Sep 9, 2017

I am not exacly sure what you mean. The first line might not be visible if the default reference position for string s still set to the baseline of the chars:

https://github.com/olikraus/u8g2/wiki/u8g2reference#setfontposbaseline

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

Can I close this issue?

All mentioned issues seem to be implemented, see also #347

Owner

olikraus commented Sep 9, 2017

Can I close this issue?

All mentioned issues seem to be implemented, see also #347

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 9, 2017

100ms for the delay worked fine for me, thanks.
Some one know if there is a way to use this e-paper with the lib in sleep mode for a card (ie NodeMCU) without that the whole screen became white when updating data ?
The sleep mode restart the whole program, if we use u8g2.initDisplay(); or u8g2.begin(); the whole screen become white. Without sleep mode it's ok, in the loop, we can refresh the displayed data on screen without the whole screen became white.
U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2([...] u8g2.begin(); u8g2.enableUTF8Print(); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_fub14_tf); // u8g2.setCursor(0, 20); u8g2.print("Température 1 : "); } while ( u8g2.nextPage() ); delay(100); u8g2.setPowerSave(1); ESP.deepSleep(100 * 1000000);
There is no way, no ? Or we put deep sleep and we have this problem, or we don't use a reset sleep mode and we haven't this white refreshing screen ?

openelearning commented Sep 9, 2017

100ms for the delay worked fine for me, thanks.
Some one know if there is a way to use this e-paper with the lib in sleep mode for a card (ie NodeMCU) without that the whole screen became white when updating data ?
The sleep mode restart the whole program, if we use u8g2.initDisplay(); or u8g2.begin(); the whole screen become white. Without sleep mode it's ok, in the loop, we can refresh the displayed data on screen without the whole screen became white.
U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2([...] u8g2.begin(); u8g2.enableUTF8Print(); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_fub14_tf); // u8g2.setCursor(0, 20); u8g2.print("Température 1 : "); } while ( u8g2.nextPage() ); delay(100); u8g2.setPowerSave(1); ESP.deepSleep(100 * 1000000);
There is no way, no ? Or we put deep sleep and we have this problem, or we don't use a reset sleep mode and we haven't this white refreshing screen ?

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

There is no way, no ? Or we put deep sleep and we have this problem, or we don't use a reset sleep mode and we haven't this white refreshing screen ?

Are you able to differ between power on reset and reset out of sleep mode?
code should be something like this:

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(...);

if ( power on reset )
u8g2.begin();

...

This means, only call .begin in the case of a power on reset. Do not call .begin if your uC comes out of sleep mode.

Owner

olikraus commented Sep 9, 2017

There is no way, no ? Or we put deep sleep and we have this problem, or we don't use a reset sleep mode and we haven't this white refreshing screen ?

Are you able to differ between power on reset and reset out of sleep mode?
code should be something like this:

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(...);

if ( power on reset )
u8g2.begin();

...

This means, only call .begin in the case of a power on reset. Do not call .begin if your uC comes out of sleep mode.

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 9, 2017

Thanks for your reply. It seems (but I'm newbie, so I'm not sure at all) that it's not possible : With deepsleep everything is powered off except the RTC on NodeMCU, the RTC will wakeup the MCU with GPIO16 to RST, and he will start to read the whole program (so for adapting the code I move all the loop in setup part, as everything stop in this oneshot loop when there is ESP.deepSleep).

We cannot have the quality of transition without whole white screen) between the u8g2.firstPage(); in the arduino loop (no fading with IL3820_V2 :) )
if we have to start from scratch using u8g2.initDisplay(); or u8g2.begin(); or other start mode, no ? (telling it with other words, it's not possible to power up an card with a start mode without a whole black/white screen that take some time (1s it seems).

openelearning commented Sep 9, 2017

Thanks for your reply. It seems (but I'm newbie, so I'm not sure at all) that it's not possible : With deepsleep everything is powered off except the RTC on NodeMCU, the RTC will wakeup the MCU with GPIO16 to RST, and he will start to read the whole program (so for adapting the code I move all the loop in setup part, as everything stop in this oneshot loop when there is ESP.deepSleep).

We cannot have the quality of transition without whole white screen) between the u8g2.firstPage(); in the arduino loop (no fading with IL3820_V2 :) )
if we have to start from scratch using u8g2.initDisplay(); or u8g2.begin(); or other start mode, no ? (telling it with other words, it's not possible to power up an card with a start mode without a whole black/white screen that take some time (1s it seems).

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 9, 2017

Owner

You could uncomment this line:
https://github.com/olikraus/u8g2/blob/master/csrc/u8x8_d_il3820_296x128.c#L386
and then call .initDisplay() as only init sequence.

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(...);
u8g2.initDisplay()

and then proceed with your other draw procedures. This might work.

Owner

olikraus commented Sep 9, 2017

You could uncomment this line:
https://github.com/olikraus/u8g2/blob/master/csrc/u8x8_d_il3820_296x128.c#L386
and then call .initDisplay() as only init sequence.

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(...);
u8g2.initDisplay()

and then proceed with your other draw procedures. This might work.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 10, 2017

Owner

ok, i will close this issue to finish the milestone 2.17.
Please raise a new issue for any questions.

Owner

olikraus commented Sep 10, 2017

ok, i will close this issue to finish the milestone 2.17.
Please raise a new issue for any questions.

@olikraus olikraus closed this Sep 10, 2017

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 10, 2017

Owner

Release 2.17.11 is there. It should appear in the Arduino IDE within the next days.

Owner

olikraus commented Sep 10, 2017

Release 2.17.11 is there. It should appear in the Arduino IDE within the next days.

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 10, 2017

Thanks a lot for this release and for your tip, works perfectly ! (if other user want to do the same, please consider to comment u8x8_d_il3820_first_init(u8x8); in u8x8_d_il3820_296x128.c in the first (line 386) or second version (line 525) if you use U8G2_IL3820_V2_296X128_1_4W_SW_SPI or U8G2_IL3820_296X128 ).

openelearning commented Sep 10, 2017

Thanks a lot for this release and for your tip, works perfectly ! (if other user want to do the same, please consider to comment u8x8_d_il3820_first_init(u8x8); in u8x8_d_il3820_296x128.c in the first (line 386) or second version (line 525) if you use U8G2_IL3820_V2_296X128_1_4W_SW_SPI or U8G2_IL3820_296X128 ).

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 10, 2017

Owner

One more point: I have reactivated 8 bit mode for the release. This means you have to activate 16 bit release for the waveshare 2.9 again (see FAQ)

Owner

olikraus commented Sep 10, 2017

One more point: I have reactivated 8 bit mode for the release. This means you have to activate 16 bit release for the waveshare 2.9 again (see FAQ)

@froussel

This comment has been minimized.

Show comment
Hide comment
@froussel

froussel Sep 10, 2017

I have a nodemcu 1.0 and a waveshare 2.9 inches
I tested constructor

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=/ D5, / data=/ D7, / cs=/ D8, / dc=/ D2, / reset=*/ D3);

With examples/page_buffer
U8g2Logo.ino ; DirectAccess.ino ; ContrastTest.ino ; ScrollingText.ino ; GraphicsTest.ino: Clock.ino

There is a display of something, I did not look further
It works perfectly; no more white screen then all black

But

When the power is disconnected the display is degraded a little, the background reappears weakly
img_20170910_124419

And I like the function of partial refreshing of
GxED_PartialUpdateExample_e_paper from the GxED library
https://github.com/ZinggJM/GxEPD

May be in U8G2 ?

It seems to me that we can save a little time between each cycle, my goal would be to have a countdown; second per second

I don't understand u8g2.setPowerSave ; an .ino file please :-)

froussel commented Sep 10, 2017

I have a nodemcu 1.0 and a waveshare 2.9 inches
I tested constructor

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=/ D5, / data=/ D7, / cs=/ D8, / dc=/ D2, / reset=*/ D3);

With examples/page_buffer
U8g2Logo.ino ; DirectAccess.ino ; ContrastTest.ino ; ScrollingText.ino ; GraphicsTest.ino: Clock.ino

There is a display of something, I did not look further
It works perfectly; no more white screen then all black

But

When the power is disconnected the display is degraded a little, the background reappears weakly
img_20170910_124419

And I like the function of partial refreshing of
GxED_PartialUpdateExample_e_paper from the GxED library
https://github.com/ZinggJM/GxEPD

May be in U8G2 ?

It seems to me that we can save a little time between each cycle, my goal would be to have a countdown; second per second

I don't understand u8g2.setPowerSave ; an .ino file please :-)

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 10, 2017

Owner

When the power is disconnected the display is degraded a little, the background reappears weakly

Yes, this may happen. This is the trade off between lesser flicker and long term stability.
Use U8G2_IL3820_296X128_1_4W_SW_SPI instead.

And I like the function of partial refreshing of
GxED_PartialUpdateExample_e_paper from the GxED library

Unfortunately I do not know what this function does. But basically it sounds like this is in general not supported by u8g2.

I don't understand u8g2.setPowerSave ; an .ino file please :-)

https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/PowerSaveTest/PowerSaveTest.ino

Owner

olikraus commented Sep 10, 2017

When the power is disconnected the display is degraded a little, the background reappears weakly

Yes, this may happen. This is the trade off between lesser flicker and long term stability.
Use U8G2_IL3820_296X128_1_4W_SW_SPI instead.

And I like the function of partial refreshing of
GxED_PartialUpdateExample_e_paper from the GxED library

Unfortunately I do not know what this function does. But basically it sounds like this is in general not supported by u8g2.

I don't understand u8g2.setPowerSave ; an .ino file please :-)

https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/PowerSaveTest/PowerSaveTest.ino

@froussel

This comment has been minimized.

Show comment
Hide comment
@froussel

froussel Sep 10, 2017

https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/PowerSaveTest/PowerSaveTest.ino

Only display : draw("power on / x"); never display : Power off

For PartialUpdate :

float value = 13.95;
display.setFont(&FreeMonoBold12pt7b);
display.setTextColor(GxEPD_BLACK);
display.setRotation(0);
draw background
display.drawBitmap(BitmapExample1, 0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, GxEPD_BLACK);
display.update();
delay(4000);

// partial update to full screen to preset for partial update of box window
// (this avoids strange background effects)
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);
// reset the background
display.setRotation(1);
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);
for (int i = 1; i <= 100; i++)
{
display.fillRect(30, 30, 200, 40, GxEPD_WHITE);
display.setCursor(30, 65);
display.print(2*i, 1);
display.updateWindow(30, 30, 200, 40, true);
}
display.fillRect(30, 30,200, 40, GxEPD_WHITE);
display.updateWindow(30,30, 200, 40, true);

A rectangle is passed in white and only in this area the display is updated

froussel commented Sep 10, 2017

https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/PowerSaveTest/PowerSaveTest.ino

Only display : draw("power on / x"); never display : Power off

For PartialUpdate :

float value = 13.95;
display.setFont(&FreeMonoBold12pt7b);
display.setTextColor(GxEPD_BLACK);
display.setRotation(0);
draw background
display.drawBitmap(BitmapExample1, 0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, GxEPD_BLACK);
display.update();
delay(4000);

// partial update to full screen to preset for partial update of box window
// (this avoids strange background effects)
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);
// reset the background
display.setRotation(1);
display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);
for (int i = 1; i <= 100; i++)
{
display.fillRect(30, 30, 200, 40, GxEPD_WHITE);
display.setCursor(30, 65);
display.print(2*i, 1);
display.updateWindow(30, 30, 200, 40, true);
}
display.fillRect(30, 30,200, 40, GxEPD_WHITE);
display.updateWindow(30,30, 200, 40, true);

A rectangle is passed in white and only in this area the display is updated

@froussel

This comment has been minimized.

Show comment
Hide comment
@froussel

froussel Sep 10, 2017

pin Busy of display disconnected : no problem

Correct ?

froussel commented Sep 10, 2017

pin Busy of display disconnected : no problem

Correct ?

@ZinggJM

This comment has been minimized.

Show comment
Hide comment
@ZinggJM

ZinggJM Sep 10, 2017

One of "my" clients uses partial update of the whole screen, because of its speed (display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);) . I recommend to use a full update from time to time to avoid degradation. Also for normal use of partial update the background should be refreshed from time to time with full update.
Note: partial update is not supported for AVR (limited RAM) yet in my GxEPD classes (available, but incomplete).
I will try to improve this, if need is there.
I like to see the progress of u8g2 for e-papers.

ZinggJM commented Sep 10, 2017

One of "my" clients uses partial update of the whole screen, because of its speed (display.updateWindow(0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, false);) . I recommend to use a full update from time to time to avoid degradation. Also for normal use of partial update the background should be refreshed from time to time with full update.
Note: partial update is not supported for AVR (limited RAM) yet in my GxEPD classes (available, but incomplete).
I will try to improve this, if need is there.
I like to see the progress of u8g2 for e-papers.

@olikraus

This comment has been minimized.

Show comment
Hide comment
@olikraus

olikraus Sep 10, 2017

Owner

Only display : draw("power on / x"); never display : Power off

yes

For PartialUpdate :

U8g2 was developed as a LCD lib. Partial update in that sense would require a lot of changes to U8g2. E-Paper is more like a simple add on. I suggest to use GxED in such cases, which provides more specific e-paper functions.

pin Busy of display disconnected : no problem

Yes, busy pin is not required. I have pre-calculated and verified the timing.

Owner

olikraus commented Sep 10, 2017

Only display : draw("power on / x"); never display : Power off

yes

For PartialUpdate :

U8g2 was developed as a LCD lib. Partial update in that sense would require a lot of changes to U8g2. E-Paper is more like a simple add on. I suggest to use GxED in such cases, which provides more specific e-paper functions.

pin Busy of display disconnected : no problem

Yes, busy pin is not required. I have pre-calculated and verified the timing.

@froussel

This comment has been minimized.

Show comment
Hide comment
@froussel

froussel Sep 10, 2017

In any case, congratulations to both, for the work provided and especially shared

froussel commented Sep 10, 2017

In any case, congratulations to both, for the work provided and especially shared

@openelearning

This comment has been minimized.

Show comment
Hide comment
@openelearning

openelearning Sep 10, 2017

@olikraus
ok thanks for the 16 bits mode, I have updated the last version (2.17.11) it works very well, thanks.

openelearning commented Sep 10, 2017

@olikraus
ok thanks for the 16 bits mode, I have updated the last version (2.17.11) it works very well, thanks.

@4k

This comment has been minimized.

Show comment
Hide comment
@4k

4k Sep 17, 2017

@froussel @openelearning could you please post your pin mappings for 2.9" display and nodemcu v1 or v2? Thanks!

4k commented Sep 17, 2017

@froussel @openelearning could you please post your pin mappings for 2.9" display and nodemcu v1 or v2? Thanks!

@froussel

This comment has been minimized.

Show comment
Hide comment
@froussel

froussel Sep 17, 2017

@4k

https://www.banggood.com/fr/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html

#include <Arduino.h>
#include <SPI.h>
#include <U8g2lib.h>

/* Constructor */
// WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! For Arduino

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ D5, /* data=*/ D7, /* cs=*/ D8, /* dc=*/ D2, /* reset=*/ D3);  
// WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! 
//For Nodemcu v2 BUSY = D1 - RST = D3 - DC = D2 - CS = D8 - CLK = D5 - DIN = D7 - GND = GND = 3.3V = 3V3

/* u8g2.begin() is required and will sent the setup/init sequence to the display */
void setup(void) {
  u8g2.begin();
}

/* draw something on the display with the `firstPage()`/`nextPage()` loop*/
void loop(void) {
  u8g2.firstPage();

do {
   u8g2.setFont (u8g2_font_ncenB14_tr); 
   u8g2.drawStr (0,20, "Bonjour tout le monde !"); 
   u8g2.drawStr (0,40, "Bonjour Monde ! Salut Monde !"); 
   u8g2.drawStr (0,60, "Bonjour tout le monde ! "); 
   
   u8g2.drawStr (0,80, "Hello World ! Bonjour Monde !"); 
   u8g2.drawStr (0,100, "Bonjour Monde ! Bonjour !"); 
  } while ( u8g2.nextPage() );

froussel commented Sep 17, 2017

@4k

https://www.banggood.com/fr/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html

#include <Arduino.h>
#include <SPI.h>
#include <U8g2lib.h>

/* Constructor */
// WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! For Arduino

U8G2_IL3820_V2_296X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ D5, /* data=*/ D7, /* cs=*/ D8, /* dc=*/ D2, /* reset=*/ D3);  
// WaveShare 2.9 inch eInk/ePaper Display, enable 16 bit mode for this display! 
//For Nodemcu v2 BUSY = D1 - RST = D3 - DC = D2 - CS = D8 - CLK = D5 - DIN = D7 - GND = GND = 3.3V = 3V3

/* u8g2.begin() is required and will sent the setup/init sequence to the display */
void setup(void) {
  u8g2.begin();
}

/* draw something on the display with the `firstPage()`/`nextPage()` loop*/
void loop(void) {
  u8g2.firstPage();

do {
   u8g2.setFont (u8g2_font_ncenB14_tr); 
   u8g2.drawStr (0,20, "Bonjour tout le monde !"); 
   u8g2.drawStr (0,40, "Bonjour Monde ! Salut Monde !"); 
   u8g2.drawStr (0,60, "Bonjour tout le monde ! "); 
   
   u8g2.drawStr (0,80, "Hello World ! Bonjour Monde !"); 
   u8g2.drawStr (0,100, "Bonjour Monde ! Bonjour !"); 
  } while ( u8g2.nextPage() );

@Redferne

This comment has been minimized.

Show comment
Hide comment
@Redferne

Redferne Sep 22, 2017

I got the hardware SPI constructor working by changing the SPI mode to 0 on my M0+ board. I can also confirm that it is quite easy to hang the IL3810 controller and a normal reset does not work. You are required to pull the 3.3V from the display to recover.

U8G2_IL3820_V2_296X128_F_4W_HW_SPI

static const u8x8_display_info_t u8x8_il3820_296x128_display_info =
{
  /* spi_mode = */ 0,
};

Thanks for a great library!

Redferne commented Sep 22, 2017

I got the hardware SPI constructor working by changing the SPI mode to 0 on my M0+ board. I can also confirm that it is quite easy to hang the IL3810 controller and a normal reset does not work. You are required to pull the 3.3V from the display to recover.

U8G2_IL3820_V2_296X128_F_4W_HW_SPI

static const u8x8_display_info_t u8x8_il3820_296x128_display_info =
{
  /* spi_mode = */ 0,
};

Thanks for a great library!

@cimba007

This comment has been minimized.

Show comment
Hide comment
@cimba007

cimba007 Sep 23, 2017

Totally unrelated to this issue - but I don't know a better place to drop this. The display is very similar (same Size + Resolution) but supports two colors.

Picture:
img_20170923_143935

Sourceode:
https://github.com/drewler/arduino-SSD1675A (not my lib, all credits to drewler)

Display:
http://stores.ebay.de/BuyDisplay/E-Paper-Display-/_i.html?_fsub=21677504012&_sid=1167871942&_trksid=p4634.c0.m322

PCB (fixed, picture still contains small error): Custom made in Eagle (with ArduinoProMini and NRF24 - the NRF24 part is untested so far)
eink_adapter_SSD1675.zip

It contains the SSD1675 display controller.

cimba007 commented Sep 23, 2017

Totally unrelated to this issue - but I don't know a better place to drop this. The display is very similar (same Size + Resolution) but supports two colors.

Picture:
img_20170923_143935

Sourceode:
https://github.com/drewler/arduino-SSD1675A (not my lib, all credits to drewler)

Display:
http://stores.ebay.de/BuyDisplay/E-Paper-Display-/_i.html?_fsub=21677504012&_sid=1167871942&_trksid=p4634.c0.m322

PCB (fixed, picture still contains small error): Custom made in Eagle (with ArduinoProMini and NRF24 - the NRF24 part is untested so far)
eink_adapter_SSD1675.zip

It contains the SSD1675 display controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment