Power up/power down bug fix., clean, new HW seq

- Fixed epaper power up / power down bug that caused problems on some epaper panels (random vertical black lines). Some informations on how to properly pwr up/down TPS65186 Epaper PMIC is missing in datasheet.
- Better cleaning (for some reason, whilte color can easly "overcharge" screen, so now the are less white frames than black ones). [This problem is visible if the panel is refreshed multiple times in a row, screen after has been powerd down starts to fade]
- Improved HW sequence (there was some issue with line clock and start pulse vertical signal)
- Removed vscan_write() function (it's not needed anymore).
- Some minor bug fixes
This commit is contained in:
BornaBiro 2020-09-21 00:07:28 +02:00
parent 48bee38bca
commit e16f608d31
2 changed files with 70 additions and 72 deletions

View File

@ -199,14 +199,14 @@ void Inkplate::display1b()
uint8_t dram;
einkOn();
cleanFast(0, 1);
cleanFast(1, 12);
cleanFast(1, 16);
cleanFast(2, 1);
cleanFast(0, 11);
cleanFast(2, 1);
cleanFast(1, 12);
cleanFast(1, 16);
cleanFast(2, 1);
cleanFast(0, 11);
for (int k = 0; k < 3; ++k)
for (int k = 0; k < 4; ++k)
{
uint8_t *DMemoryNewPtr = DMemoryNew + 59999;
vscan_start();
@ -304,11 +304,11 @@ void Inkplate::display3b()
{
einkOn();
cleanFast(0, 1);
cleanFast(1, 12);
cleanFast(1, 16);
cleanFast(2, 1);
cleanFast(0, 11);
cleanFast(2, 1);
cleanFast(1, 12);
cleanFast(1, 16);
cleanFast(2, 1);
cleanFast(0, 11);
@ -370,7 +370,6 @@ void Inkplate::display3b()
}
delayMicroseconds(230);
}
cleanFast(2, 1);
cleanFast(3, 1);
vscan_start();
einkOff();
@ -490,29 +489,64 @@ void Inkplate::cleanFast(uint8_t c, uint8_t rep)
}
}
//Turn off epaper power supply and put all digital IO pins in high Z state
void Inkplate::einkOff()
{
if (getPanelState() == 0)
return;
OE_CLEAR;
GMOD_CLEAR;
GPIO.out &= ~(DATA | LE | CL);
CKV_CLEAR;
SPH_CLEAR;
SPV_CLEAR;
VCOM_CLEAR;
delay(6);
PWRUP_CLEAR;
WAKEUP_CLEAR;
delay(50);
pinsZstate();
setPanelState(0);
}
//Turn on supply for epaper display (TPS65186) [+15 VDC, -15VDC, +22VDC, -20VDC, +3.3VDC, VCOM]
void Inkplate::einkOn()
{
if (getPanelState() == 1)
return;
setPanelState(1);
pinsAsOutputs();
WAKEUP_SET;
PWRUP_SET;
VCOM_SET;
delay(1);
Wire.beginTransmission(0x48);
Wire.write(0x09);
Wire.write(B00011011); //Power up seq.
Wire.write(B00000000); //Power up delay (3mS per rail)
Wire.write(B00011011); //Power down seq.
Wire.write(B00000000); //Power down delay (6mS per rail)
Wire.endTransmission();
PWRUP_SET;
//Enable all rails
Wire.beginTransmission(0x48);
Wire.write(0x01);
Wire.write(B00111111);
Wire.endTransmission();
delay(40);
pinsAsOutputs();
LE_CLEAR;
OE_CLEAR;
CL_CLEAR;
SPH_SET;
GMOD_SET;
SPV_SET;
CKV_CLEAR;
OE_CLEAR;
VCOM_SET;
Wire.beginTransmission(0x48);
Wire.write(0x0D);
Wire.write(B10000000);
Wire.endTransmission();
delay(2);
delay(5);
Wire.beginTransmission(0x48);
Wire.write(0x00);
@ -521,32 +555,10 @@ void Inkplate::einkOn()
Wire.requestFrom(0x48, 1);
setTemperature(Wire.read());
LE_CLEAR;
OE_CLEAR;
CL_CLEAR;
SPH_SET;
GMOD_SET;
SPV_SET;
CKV_CLEAR;
pinModeMCP(7, INPUT_PULLUP);
while(!digitalReadMCP(7));
OE_SET;
}
void Inkplate::einkOff()
{
if (getPanelState() == 0)
return;
setPanelState(0);
GMOD_CLEAR;
OE_CLEAR;
GPIO.out &= ~(DATA | CL | LE);
SPH_CLEAR;
SPV_CLEAR;
PWRUP_CLEAR;
WAKEUP_CLEAR;
VCOM_CLEAR;
pinsZstate();
setPanelState(1);
}
// LOW LEVEL FUNCTIONS
@ -576,25 +588,13 @@ void Inkplate::vscan_start()
CKV_SET;
}
void Inkplate::vscan_write()
{
CKV_CLEAR;
LE_SET;
LE_CLEAR;
delayMicroseconds(0);
SPH_CLEAR;
CL_SET;
CL_CLEAR;
SPH_SET;
CKV_SET;
}
void Inkplate::hscan_start(uint32_t _d)
{
SPH_CLEAR;
GPIO.out_w1ts = (_d) | CL;
GPIO.out_w1tc = DATA | CL;
SPH_SET;
CKV_SET;
}
void Inkplate::vscan_end()
@ -602,8 +602,7 @@ void Inkplate::vscan_end()
CKV_CLEAR;
LE_SET;
LE_CLEAR;
delayMicroseconds(1);
CKV_SET;
delayMicroseconds(0);
}
void Inkplate::pinsZstate()

View File

@ -51,7 +51,6 @@ private:
void display3b();
void cleanFast(uint8_t c, uint8_t rep);
void vscan_start();
void vscan_write();
void vscan_end();
void hscan_start(uint32_t _d = 0);
void pinsZstate();