5.9 KiB
The UC8176 datasheet does not include descriptions of LUT-related instructions, but the UC8151 manual does, and the format is the same, so the UC8151 manual has also been included.
The OTP directory contains OTP data read from the screens:
bw.txt: Black & white screen3c.txt: Black, white, and red 3-color screen
You can extract the built-in LUT waveforms from the OTP data as a reference to facilitate custom LUT waveforms.
The following are examples of LUT waveforms extracted from OTP (all tested to match the display effect at room temperature around 20°C when the 2 screens supported by this project do not load external LUTs):
Black & White Screen:
// OTP location: 0x300
static const unsigned char LUTC[] = {
0x60, 0x19, 0x19, 0x00, 0x00, 0x01,
0x00, 0x19, 0x19, 0x00, 0x00, 0x02,
0x00, 0x19, 0x00, 0x00, 0x00, 0x01,
0x00, 0x25, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
};
static const unsigned char LUTWW[] = {
0x50, 0x19, 0x19, 0x00, 0x00, 0x01,
0x90, 0x19, 0x19, 0x00, 0x00, 0x02,
0x40, 0x19, 0x00, 0x00, 0x00, 0x01,
0xA0, 0x25, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char LUTBW[] = {
0x50, 0x19, 0x19, 0x00, 0x00, 0x01,
0x90, 0x19, 0x19, 0x00, 0x00, 0x02,
0x40, 0x19, 0x00, 0x00, 0x00, 0x01,
0xA0, 0x25, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char LUTWB[] = {
0xA0, 0x19, 0x19, 0x00, 0x00, 0x01,
0x90, 0x19, 0x19, 0x00, 0x00, 0x02,
0x80, 0x19, 0x00, 0x00, 0x00, 0x01,
0x50, 0x25, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char LUTBB[] = {
0xA0, 0x19, 0x19, 0x00, 0x00, 0x01,
0x90, 0x19, 0x19, 0x00, 0x00, 0x02,
0x80, 0x19, 0x00, 0x00, 0x00, 0x01,
0x50, 0x25, 0x26, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
};
3-Color Screen:
// OTP location: 0x400
static const unsigned char LUTC[] = {
0x00, 0x3F, 0x01, 0x3F, 0x05, 0x01,
0x48, 0x78, 0x01, 0x78, 0x01, 0x01,
0x48, 0x10, 0x01, 0x10, 0x01, 0x0B,
0x48, 0x78, 0x01, 0x78, 0x01, 0x01,
0x40, 0x03, 0x01, 0x21, 0x0A, 0x04,
0x00, 0x04, 0x01, 0x17, 0x0A, 0x09,
0x00, 0x07, 0x90, 0x07, 0x05, 0x01,
0x00, 0x00,
};
static const unsigned char LUTWW[] = {
0x44, 0x3F, 0x3F, 0x3F, 0x05, 0x01,
0x84, 0x78, 0x01, 0x78, 0x01, 0x01,
0x88, 0x10, 0x01, 0x10, 0x01, 0x0B,
0x40, 0x78, 0x01, 0x78, 0x01, 0x01,
0x00, 0x03, 0x01, 0x21, 0x0A, 0x04,
0x00, 0x04, 0x01, 0x17, 0x0A, 0x09,
0x88, 0x07, 0x01, 0x07, 0x05, 0x01,
};
static const unsigned char LUTR[] = {
0x48, 0x3F, 0x3F, 0x3F, 0x05, 0x01,
0x84, 0x78, 0x01, 0x78, 0x01, 0x01,
0x84, 0x10, 0x01, 0x10, 0x01, 0x0B,
0x8C, 0x78, 0x01, 0x78, 0x01, 0x01,
0x8C, 0x03, 0x01, 0x21, 0x0A, 0x04,
0xCC, 0x04, 0x01, 0x17, 0x0A, 0x09,
0x90, 0x07, 0x01, 0x07, 0x05, 0x01,
};
static const unsigned char LUTW[] = {
0x44, 0x3F, 0x3F, 0x3F, 0x05, 0x01,
0x84, 0x78, 0x01, 0x78, 0x01, 0x01,
0x88, 0x10, 0x01, 0x10, 0x01, 0x0B,
0x40, 0x78, 0x01, 0x78, 0x01, 0x01,
0x00, 0x03, 0x01, 0x21, 0x0A, 0x04,
0x00, 0x04, 0x01, 0x17, 0x0A, 0x09,
0x90, 0x07, 0x01, 0x07, 0x05, 0x01,
};
static const unsigned char LUTB[] = {
0x48, 0x3F, 0x3F, 0x3F, 0x05, 0x01,
0x84, 0x78, 0x01, 0x78, 0x01, 0x01,
0x84, 0x10, 0x01, 0x10, 0x01, 0x0B,
0x40, 0x78, 0x01, 0x78, 0x01, 0x01,
0x00, 0x03, 0x01, 0x21, 0x0A, 0x04,
0x00, 0x04, 0x01, 0x17, 0x0A, 0x09,
0xFF, 0x07, 0x01, 0x07, 0x05, 0x01,
};
Using the following LUT and setting the driver to BW mode allows the 3-color screen to be used as a black & white screen, reducing refresh time from 15s to around 2-3s:
- Further optimization is needed; the display effect is slightly lighter than the default 3-color LUT
- There should be room for optimization of refresh time; theoretically, a LUT supporting partial refresh could also be created
// OTP location: 0x200, from bw.txt
static const unsigned char LUTC[] = {
0x00, 0x28, 0x28, 0x00, 0x00, 0x01,
0x60, 0x32, 0x32, 0x00, 0x00, 0x02,
0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
0x00, 0x32, 0x32, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00,
};
static const unsigned char LUTWW[] = {
0x50, 0x28, 0x32, 0x00, 0x00, 0x01,
0x90, 0x32, 0x00, 0x00, 0x00, 0x02,
0x40, 0x14, 0x32, 0x00, 0x00, 0x01,
0xA0, 0x32, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
};
static const unsigned char LUTBW[] = {
0x50, 0x28, 0x32, 0x00, 0x00, 0x01,
0x90, 0x32, 0x00, 0x00, 0x00, 0x02,
0x40, 0x14, 0x32, 0x00, 0x00, 0x01,
0xA0, 0x32, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
};
static const unsigned char LUTWB[] = {
0xA0, 0x28, 0x32, 0x00, 0x00, 0x01,
0x90, 0x32, 0x00, 0x00, 0x00, 0x02,
0x80, 0x14, 0x32, 0x00, 0x00, 0x01,
0x50, 0x32, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
};
static const unsigned char LUTBB[] = {
0xA0, 0x28, 0x32, 0x00, 0x00, 0x01,
0x90, 0x32, 0x00, 0x00, 0x00, 0x02,
0x80, 0x14, 0x32, 0x00, 0x00, 0x01,
0x50, 0x32, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
};