I got this strange artifacts in the upper left corner and lower right on every bitmap that I send to this serial LCD from seeedstudio (seeedstudio.com/depot/serial … p-287.html):
This is my code (could be useful for those who bought this lcd screen too because runs natively from arduino ide):
[code]// Demo LCD TOPWAY LM6059BCW
// Author: Erwin Ried
// Webpage: http://erwin.ried.cl
// Based on: http://www.seeedstudio.com/depot/images/product/LM6059BCW-Manual-Rev0.3.pdf
#define CS1 2 // Chip Select (LOW= enable LCD)
#define RST 3 // Reset signal (HIGH= normal, LOW= Init)
#define A0 4 // Register Select (HIGH= Display Data, LOW= Control)
#define CLOCK 7
#define DATA 6
// Example logo
byte logo[]={
0x03,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,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,
0xF8,0x08,0x08,0x00,0xF0,0x08,0x08,0x08,0xF0,0x00,0xF8,0x48,0x48,0x48,0x30,0x00,
0xF8,0x00,0x80,0x00,0xF8,0x00,0xE0,0x50,0x48,0x50,0xE0,0x00,0x38,0x40,0x80,0x40,
0x38,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,
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,
0x80,0x10,0x20,0x00,0x60,0x20,0xA0,0x20,0x20,0xA0,0x20,0x60,0x00,0x00,0x00,0xF0,
0x03,0x00,0xF0,0x00,0x01,0xE2,0x02,0x02,0xF1,0x00,0x83,0x80,0xF0,0x80,0x80,0x20,
0x21,0xE2,0x21,0x22,0x21,0x20,0x03,0x00,0xC0,0x40,0x53,0xE0,0x40,0x40,0xE3,0x50,
0x40,0xC0,0x40,0x00,0x40,0x20,0x10,0xE0,0x80,0xF0,0x80,0xE0,0x00,0xF0,0x80,0x80,
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,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,
0x10,0xF9,0x04,0x40,0x44,0x25,0x14,0xFF,0x14,0x24,0x45,0x44,0x00,0x21,0x61,0x3F,
0x91,0x51,0x3F,0x00,0x00,0x3F,0x00,0x00,0xFF,0x00,0x08,0x88,0xFF,0x04,0x0A,0x04,
0xFF,0x44,0x44,0x44,0xFC,0x00,0x00,0x02,0x02,0x03,0xFA,0xAB,0xAA,0xAA,0xAB,0xAA,
0xFB,0x02,0x02,0x00,0x04,0xFE,0x81,0x42,0x3A,0x0A,0x7A,0xA2,0x4F,0x30,0x4F,0x80,
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,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,0x80,0x00,0x00,0x00,0x80,0x00,0x00,
0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,
0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,
0x00,0x80,0x00,0x00,0x00,0x80,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,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,0x00,0x00,0x00,0x88,0x54,0x22,0x01,0x00,0x01,0xFA,0x01,0x00,0x01,0x02,
0xF9,0x70,0x81,0x02,0xC1,0x30,0xF9,0x02,0xE1,0x90,0xB1,0x02,0x01,0xE0,0x11,0x12,
0xE1,0x00,0xF1,0x92,0x91,0x10,0x01,0xE2,0x11,0x10,0xE1,0x02,0x01,0x80,0x71,0x0A,
0x71,0x80,0x01,0x02,0x01,0x00,0x01,0x22,0x54,0x88,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,
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,0x08,0x15,0x22,0x40,0x80,0x40,0x2F,0x48,0x88,0x48,0x28,
0x4F,0x80,0x47,0x2C,0x47,0x80,0x4F,0x20,0x47,0x88,0x48,0x27,0x40,0x87,0x48,0x28,
0x47,0x80,0x4C,0x28,0x48,0x87,0x40,0x21,0x4D,0x89,0x47,0x20,0x4C,0x83,0x41,0x21,
0x41,0x83,0x4C,0x20,0x40,0x80,0x40,0x22,0x15,0x08,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,
0x00,0xC0,0x40,0x40,0x40,0x40,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x40,0x40,0xC0,
0x40,0x40,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,
0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0xC0,0x40,0x40,0x80,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xC0,0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x80,
0x40,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40,0x40,0x40,0x00,
0x00,0x00,0x00,0x80,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x40,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC0,0x9F,0x02,0x02,0x02,0x00,0x00,0x09,0x12,0x12,0x12,0x0C,0x00,0x00,0x00,0x1F,
0x00,0x00,0x00,0x1F,0x01,0x02,0x04,0x1F,0x00,0x00,0x00,0x00,0x00,0x1F,0x10,0x10,
0x10,0x10,0x00,0x0F,0x10,0x10,0x10,0x08,0x00,0x1F,0x10,0x10,0x08,0x07,0x00,0x00,
0x00,0x00,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x10,0x18,0x14,0x12,0x11,0x00,0x0D,
0x12,0x12,0x12,0x0D,0x00,0x11,0x0A,0x04,0x0A,0x11,0x00,0x0F,0x12,0x12,0x12,0x0C,
0x00,0x06,0x05,0x04,0x1F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x05,0x05,0x05,
0x02,0x00,0x00,0x11,0x1F,0x10,0x00,0x00,0x11,0x0A,0x04,0x0A,0x11,0x00,0x0E,0x15,
0x15,0x15,0x06,0x00,0x00,0x10,0x1F,0x10,0x00,0x00,0x12,0x15,0x15,0x15,0x88,0xC0
};
// Shift out override (Reverse clock HIGH/LOW)
void shiftOut(uint8_t dataPin, uint8_t clockPin, byte val)
{
for (int i = 0; i < 8; i++) {
digitalWrite(dataPin, !!(val & (1 << (7 - i))));
digitalWrite(clockPin, LOW);
digitalWrite(clockPin, HIGH);
}
}
// Send Byte as command or data to LCD
void sendByte(byte b, boolean isData)
{
digitalWrite(CLOCK,HIGH);
digitalWrite(A0,isData);
digitalWrite(CS1,LOW);
shiftOut(DATA, CLOCK, b);
digitalWrite(CS1,HIGH);
}
// Send command to LCD
void sendCommand(byte b)
{
sendByte(b, false);
}
// Send data to LCD
void sendData(byte b)
{
sendByte(b, true);
}
// Send a whole screen to the LCD (164x64/8 = 1312byte)
void sendScreen(byte screen[])
{
int i,j;
for(i=0; i<8; i++)
{
sendCommand(0xb0 | i); // Data page 0-7
sendCommand(0x10); // Data Column 4
sendCommand(0x00);
for(j=0; j<128; j++)
sendData(screen[(i*128)+j]);
}
}
byte actualContrast = 0x17;
void setContrast(int level) // 0= set/reset, >0= darker, <0= lighter
{
if(level>0 && actualContrast<0x3F)
actualContrast++;
else
if(level<0 && actualContrast>0x00)
actualContrast–;
sendCommand(0x81);
sendCommand(actualContrast);
}
void startLcd()
{
// Initialization
digitalWrite(RST,HIGH);
digitalWrite(RST,LOW);
delay(1);
digitalWrite(RST,HIGH);
delay(800);
sendCommand(0xab); // New
sendCommand(0xaf); // Display on
sendCommand(0x40); // Display start line=0
sendCommand(0xc8); // Common output mode select= reverse
sendCommand(0xa6); // Normal display
sendCommand(0xa4); // Display all point= off
sendCommand(0xa3); // LCD bias = 1/9 a2
sendCommand(0x2f); // Power control = all on
sendCommand(0x25); // Rab Ratio 26
setContrast(0); // Default contrast
}
void setup()
{
pinMode(CS1,OUTPUT);
pinMode(RST,OUTPUT);
pinMode(A0,OUTPUT);
pinMode(CLOCK,OUTPUT);
pinMode(DATA,OUTPUT);
startLcd();
sendScreen(logo);
}
void loop()
{
// Something to do…
}
[/code]
Anyone knows why can this happen? Thanks!