issue #318
This commit is contained in:
parent
865fa75176
commit
d63e42fe7a
|
@ -77,10 +77,6 @@ static const uint8_t u8x8_d_il3820_296x128_init_seq[] = {
|
|||
U8X8_A(295 % 256), U8X8_A(295/256), U8X8_A(0),
|
||||
|
||||
|
||||
U8X8_CA(0x03, 0x00), /* Gate Driving voltage: 15V (lowest value)*/
|
||||
U8X8_CA(0x04, 0x0a), /* Source Driving voltage: 15V (mid value and POR)*/
|
||||
|
||||
U8X8_CA(0x22, 0xc0), /* display update seq. option: enable clk, enable CP, .... todo: this is never activated */
|
||||
|
||||
|
||||
|
||||
|
@ -122,12 +118,76 @@ according to section 6.8:
|
|||
0x00,0x13,0x14,0x44,0x12, 0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
*/
|
||||
|
||||
/*
|
||||
0x00, 0x40, 0x04, 0xa6, 0xa8,
|
||||
0x65, 0x19, 0xaa, 0x98, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x20, 0x26, 0x26, 0x26, 0xff,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00
|
||||
|
||||
71 ticks, 1440 ms
|
||||
|
||||
|
||||
0x00, 0x88, 0x88, 0x88, 0x98,
|
||||
0x99, 0x99, 0x99, 0x11, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x20, 0x26, 0x26, 0x26, 0xff,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00
|
||||
71 ticks, 1440 ms
|
||||
|
||||
*/
|
||||
#ifdef OLD
|
||||
|
||||
U8X8_C(0x32), /* write LUT register*/
|
||||
/* original values */
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x88),
|
||||
U8X8_A(0x88),
|
||||
U8X8_A(0x88),
|
||||
U8X8_A(0x98),
|
||||
|
||||
U8X8_A(0x99),
|
||||
U8X8_A(0x99),
|
||||
U8X8_A(0x99),
|
||||
U8X8_A(0x11),
|
||||
U8X8_A(0x11),
|
||||
|
||||
U8X8_A(0x11),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
|
||||
/* Timing part of the LUT, 20 Phases with 4 bit each: 10 bytes */
|
||||
U8X8_A(0x20),
|
||||
U8X8_A(0x26),
|
||||
U8X8_A(0x26),
|
||||
U8X8_A(0x26),
|
||||
U8X8_A(0xff),
|
||||
U8X8_A(0x0f),
|
||||
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
#endif
|
||||
|
||||
/*
|
||||
0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
*/
|
||||
|
||||
measured 1582 ms
|
||||
*/
|
||||
U8X8_C(0x32), /* write LUT register*/
|
||||
/* original values */
|
||||
U8X8_A(0x50),
|
||||
|
@ -136,7 +196,7 @@ according to section 6.8:
|
|||
U8X8_A(0xaa),
|
||||
U8X8_A(0x11),
|
||||
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x11),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
|
@ -157,7 +217,7 @@ according to section 6.8:
|
|||
/* Timing part of the LUT, 20 Phases with 4 bit each: 10 bytes */
|
||||
U8X8_A(0xff),
|
||||
U8X8_A(0xff),
|
||||
U8X8_A(0x1f),
|
||||
U8X8_A(0x3f),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
|
@ -165,7 +225,7 @@ according to section 6.8:
|
|||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
U8X8_A(0x00),
|
||||
|
||||
|
||||
#ifdef OLD
|
||||
/* take the values from the 200x200 SSD1607 device, this looks better */
|
||||
U8X8_C(0x32), /* write LUT register*/
|
||||
|
@ -206,9 +266,15 @@ according to section 6.8:
|
|||
|
||||
#endif
|
||||
|
||||
U8X8_CA(0x03, 0x00), /* Gate Driving voltage: 15V (lowest value)*/
|
||||
U8X8_CA(0x04, 0x0a), /* Source Driving voltage: 15V (mid value and POR)*/
|
||||
|
||||
//U8X8_CA(0x22, 0xc0), /* display update seq. option: enable clk, enable CP, .... todo: this is never activated */
|
||||
|
||||
//U8X8_CA(0x0b, 7), /* Set Delay of gate and source non overlap period, POR = 7 */
|
||||
U8X8_CA(0x2c, 0xa8), /* write vcom value*/
|
||||
U8X8_CA(0x3a, 0x1a), /* dummy lines */
|
||||
U8X8_CA(0x3b, 0x08), /* gate time */
|
||||
U8X8_CA(0x3a, 0x16), /* dummy lines POR=22 (0x016) */
|
||||
U8X8_CA(0x3b, 0x08), /* gate time POR=0x08*/
|
||||
U8X8_CA(0x3c, 0x33), /* select boarder waveform */
|
||||
U8X8_CA(0x22, 0xc4), /* display update seq. option: clk -> CP -> LUT -> initial display -> pattern display */
|
||||
|
||||
|
@ -226,6 +292,22 @@ according to section 6.8:
|
|||
U8X8_END() /* end of sequence */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
total_refresh_time = (refresh_lines + dummy_lines*2)*TGate*TS_Sum/f_OSC
|
||||
|
||||
f_OSC=1MHz (according to the datasheets)
|
||||
refreh_lines = 296 (for the waveshare display, 0x045 cmd)
|
||||
dummy_lines = 22 (for the upcoming u8g2 code, 0x03a cmd)
|
||||
TGate = 62 (POR default, 0x03b cmd)
|
||||
TS_Sum: Sum of all TS entries of the second part of the LUT
|
||||
f_OSC: 1MHz according to the datasheet.
|
||||
|
||||
so we have
|
||||
|
||||
total_refresh_time = 21080*TS_Sum/1000000 = 21ms * TS_Sum
|
||||
*/
|
||||
|
||||
static const uint8_t u8x8_d_il3820_to_display_seq[] = {
|
||||
|
||||
|
||||
|
@ -234,15 +316,14 @@ static const uint8_t u8x8_d_il3820_to_display_seq[] = {
|
|||
U8X8_CA(0x22, 0xc4), /* display update seq. option: clk -> CP -> LUT -> initial display -> pattern display */
|
||||
U8X8_C(0x20), /* execute sequence */
|
||||
|
||||
U8X8_DLY(250), /* delay for 2000ms. This has to be tested, maybe it can be reduced */
|
||||
U8X8_DLY(250), /* delay for 1620ms. The current sequence takes 1582ms */
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(250),
|
||||
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(250),
|
||||
U8X8_DLY(120),
|
||||
|
||||
// 6 sep2017: removed the following code, i think the 0x020 exec cmd is missing
|
||||
//U8X8_CA(0x22, 0x03), /* disable clock and charge pump */
|
||||
|
@ -396,6 +477,10 @@ static uint8_t u8x8_d_il3820_296x128_generic(u8x8_t *u8x8, uint8_t msg, uint8_t
|
|||
u8x8_ClearDisplay(u8x8);
|
||||
/* write content to the display */
|
||||
u8x8_RefreshDisplay(u8x8);
|
||||
/* another update to ensure, that the buffers are cleared */
|
||||
u8x8_ClearDisplay(u8x8);
|
||||
/* write content to the display */
|
||||
u8x8_RefreshDisplay(u8x8);
|
||||
|
||||
break;
|
||||
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
//U8G2_UC1611_EA_DOGXL240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board
|
||||
//U8G2_SSD1606_172X72_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display
|
||||
//U8G2_SSD1607_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display
|
||||
//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, enable 16 bit mode for this display!
|
||||
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, enable 16 bit mode for this display!
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -66,12 +66,19 @@ uint16_t lut_measured_duration = 0;
|
|||
1: upper line
|
||||
2: lower line
|
||||
|
||||
00 black to black (upper line required)
|
||||
01 black to white (lower line required)
|
||||
10 white to black
|
||||
11 white to white
|
||||
|
||||
*/
|
||||
|
||||
uint8_t lut_level[LUT_WAVE_CNT][LUT_ARRAY_LEN];
|
||||
uint8_t lut_time[LUT_ARRAY_LEN];
|
||||
#define LUT_DY 3
|
||||
|
||||
u8g2_uint_t cursor_x1, cursor_x2;
|
||||
|
||||
uint8_t lut_time_to_width[16] =
|
||||
{
|
||||
2, // 0
|
||||
|
@ -116,7 +123,7 @@ void read_lut(const uint8_t *lut)
|
|||
}
|
||||
}
|
||||
|
||||
void draw_lut_wave(u8g2_t *u8g2, uint8_t w, uint8_t cx, u8g2_uint_t y)
|
||||
void draw_lut_wave(u8g2_t *u8g2, uint8_t w, uint8_t cx, uint8_t is_cursor, u8g2_uint_t y)
|
||||
{
|
||||
uint8_t i;
|
||||
u8g2_uint_t x1, y1;
|
||||
|
@ -139,8 +146,13 @@ void draw_lut_wave(u8g2_t *u8g2, uint8_t w, uint8_t cx, u8g2_uint_t y)
|
|||
|
||||
if ( i == cx )
|
||||
{
|
||||
u8g2_DrawHLine(u8g2, x1, y-LUT_DY-1, x2-x1+1);
|
||||
u8g2_DrawHLine(u8g2, x1, y+LUT_DY+1, x2-x1+1);
|
||||
cursor_x1 = x1;
|
||||
cursor_x2 = x2;
|
||||
if ( is_cursor )
|
||||
{
|
||||
u8g2_DrawHLine(u8g2, x1, y-LUT_DY-1, x2-x1+1);
|
||||
u8g2_DrawHLine(u8g2, x1, y+LUT_DY+1, x2-x1+1);
|
||||
}
|
||||
}
|
||||
|
||||
x1 = x2;
|
||||
|
@ -159,9 +171,9 @@ void draw_all_lut(u8g2_t *u8g2, uint8_t cx, uint8_t cy)
|
|||
for( i = 0; i < LUT_WAVE_CNT; i++ )
|
||||
{
|
||||
if ( i == cy )
|
||||
draw_lut_wave(u8g2, i, cx, y);
|
||||
draw_lut_wave(u8g2, i, cx, 1, y);
|
||||
else
|
||||
draw_lut_wave(u8g2, i, 255, y); // 255: no cursor
|
||||
draw_lut_wave(u8g2, i, cx, 0, y); // 255: no cursor
|
||||
|
||||
y += (LUT_DY+2)*2;
|
||||
}
|
||||
|
@ -186,6 +198,9 @@ void draw_all_lut(u8g2_t *u8g2, uint8_t cx, uint8_t cy)
|
|||
y+=1;
|
||||
if ( cy == LUT_WAVE_CNT )
|
||||
{
|
||||
u8g2_SetDrawColor(u8g2, 2);
|
||||
u8g2_DrawBox(u8g2, cursor_x1, 0, cursor_x2-cursor_x1+1, (LUT_DY+2)*2*4-1 );
|
||||
|
||||
u8g2_SetDrawColor(u8g2, 0);
|
||||
}
|
||||
else
|
||||
|
@ -434,7 +449,7 @@ uint8_t u8x8_d_test_hook(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_p
|
|||
// 0x0c4: clk -> CP -> LUT -> pattern display
|
||||
u8x8_cad_SendCmd(u8x8, 0x020); // execute
|
||||
start =millis();
|
||||
end = start + 2000;
|
||||
end = start + 4000;
|
||||
//pinMode(A2, INPUT);
|
||||
delay(10);
|
||||
for(;;)
|
||||
|
@ -547,9 +562,65 @@ void show_lut_on_editor(void)
|
|||
|
||||
const uint8_t LUTDefault_full[31] =
|
||||
{
|
||||
0x50, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
0x50, 0xAA, 0x55, 0xAA, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0x3F, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
// same as LUTDefault_full, but dubled size
|
||||
const uint8_t w01[30] =
|
||||
{
|
||||
0x00, 0x00, 0x44, 0xaa, 0xaa,
|
||||
0x55, 0x55, 0xaa, 0xaa, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x01, 0xff, 0xff, 0xff, 0xff,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
// same as w01, but timing adjisted, should be identical to LUTDefault_full
|
||||
const uint8_t w02[30] =
|
||||
{
|
||||
0x00, 0x00, 0x44, 0xaa, 0xaa,
|
||||
0x55, 0x55, 0xaa, 0xaa, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x11, 0x5a, 0x5a, 0x5a, 0x5a,
|
||||
0x0a, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
// speed optimized, lesser flickering version
|
||||
// ticks=71
|
||||
// measued=1441ms
|
||||
const uint8_t w03[30] =
|
||||
{
|
||||
0x00, 0x40, 0x04, 0xa6, 0xa8,
|
||||
0x65, 0x19, 0xaa, 0x98, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x20, 0x26, 0x26, 0x26, 0xff,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
|
||||
// speed optimized, lesser flickering version
|
||||
// ticks=71
|
||||
// measued=1441ms
|
||||
const uint8_t w04[30] =
|
||||
{
|
||||
0x00, 0x88, 0x88, 0x88, 0x98,
|
||||
0x99, 0x99, 0x99, 0x11, 0x11,
|
||||
0x11, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
0x20, 0x26, 0x26, 0x26, 0xff,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
void setup(void)
|
||||
|
@ -568,7 +639,7 @@ void setup(void)
|
|||
|
||||
init_lut();
|
||||
read_lut(LUTDefault_full);
|
||||
|
||||
//read_lut(w04);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
|
||||
Command 0x03a: Set number of dummy line period (7 bits)
|
||||
Range = 0..127
|
||||
POR = 22
|
||||
|
||||
Command 0x03b: Set Gate (TGate) Line Width (4 bits)
|
||||
bits TGate Hz m (0x3a:22)
|
||||
0000 30
|
||||
0001 34
|
||||
0010 38
|
||||
0011 38
|
||||
0100 44
|
||||
0101 46
|
||||
0110 52
|
||||
0111 56
|
||||
1000 62 50Hz 20ms [POR]
|
||||
1001 68
|
||||
1010 78 25ms
|
||||
|
||||
Command 0x0b: Set Delay of gate and source non overlap period
|
||||
0010 4
|
||||
...
|
||||
0101 10 [POR]
|
||||
...
|
||||
1110 28
|
||||
--> no influence on update time
|
||||
|
||||
Formula:
|
||||
update_time = total_TS_ticks * 20ms + 10ms
|
||||
|
||||
|
||||
Ticks Measured Speed Measured Speed Calclated Calculated
|
||||
0x3a:26 0x3a:22
|
||||
[Milliseconds] ticks*20+10
|
||||
137 2808 2750
|
||||
97 1992 1950
|
||||
92 1888
|
||||
87 1788 1767 1750
|
||||
72 1482 1463 1450
|
||||
0 11
|
||||
1 31
|
||||
2 51 51
|
||||
10 215 212 210
|
||||
20 415
|
||||
|
||||
|
||||
update/refresh duration:
|
||||
|
||||
(refresh_lines + dummy_lines*2)*TGate*TS_Sum/f_OSC
|
||||
|
||||
f_OSC=1MHz (according to the datasheets)
|
||||
refreh_lines = 296 (for the waveshare display, 0x045 cmd)
|
||||
dummy_lines = 22 (for the upcoming u8g2 code, 0x03a cmd)
|
||||
TGate = 62 (POR default, 0x03b cmd)
|
||||
TS_Sum: Sum of all TS entries of the second part of the LUT
|
||||
f_OSC: 1MHz according to the datasheet.
|
||||
so we have
|
||||
|
||||
total_refresh_time = 21080*TS_Sum/1000000 = 21ms * TS_Sum
|
||||
|
||||
--> this is more or less close to the measure values.
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
//U8G2_UC1611_EA_DOGXL240_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // SW SPI, Due DOGXL240 Test Board
|
||||
//U8G2_SSD1606_172X72_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display
|
||||
//U8G2_SSD1607_200X200_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // eInk/ePaper Display
|
||||
//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, enable 16 bit mode for this display!
|
||||
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, enable 16 bit mode for this display!
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue