Sie sind auf Seite 1von 7

LM12864L

0.1

2006-2-9

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

Ref:LM12864L-AppNote-v0.1
1/7

LM12864L


1 ..................................................................................................................................... 3
2 ..................................................................................................................................... 3
2.1 ................................................................................................................................ 3
2.2 ................................................................................................................. 4
2.3 ........................................................................................................................ 4
2.4 ..................................................................................................................... 5
2.5 ........................................................................................................................ 6

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

Ref:LM12864L-AppNote-v0.1
2/7

LM12864L

LM12864L 12864 LM12864


S6B0108 S6B0107

*
*
*
*

STN-LCD
VLCD
Sumsang S6B0107/S6B0108 /
8

2
2.1
AT89S52 I/O 8

LM12864L

Vcc

5V

vDD
BLA
25k

5V

AT89S52

V0

vout

BLK

vSS

DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7

P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7

RS
R/W
E
CS1
CS2
/RST

P3.1
P3.7
P3.6
P3.4
P3.3
P3.5

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

EA
RST

1F
10k

30pF

XTAL2
XTAL1
VSS

12MHz

30pF

1
2
3
4
5
6
7

14
15
16
17
18
19
20

VSS
VDD
V0
RS
R/W
E
DB0

DB7
CS1
CS2
/RST
VOUT
BLA
BLK

Ref:LM12864L-AppNote-v0.1
3/7

LM12864L

2.2

RS

R/W

DB7

DB6

DB5

DB4

DB3

DB2

DB1

DB0

1/0

Y
X

0
0
0

0
0
0

0
1
1

1
0
1

Y 0-63
1
1 X 0-7
Z 0-63

0=1=
Y
X

=0=1
=0=1
=0=1
Y
1

*2

1
1

*1.
CS1=1CS2=0
1
CS1=0CS2=1
2
*2.
*3. Samsung S6B0108

*2
*2
*2
*1
*2
*1

2.3
X

0
1
2
3
4
5
6
7

D0

D7
D0

D7
D0

D7
D0

D7
D0

D7
D0

D7
D0

D7
D0

D7

12864

Y
00H 3FH
00H 3FH

CS1 = 1 CS2 = 0
CS1 = 0 CS2 = 1

1 Z =0
2 .
3 CS1=1 CS2=1 .

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

Ref:LM12864L-AppNote-v0.1
4/7

LM12864L

2.4

Read the status word

Hardware reset

Select the controller to operate

open both controllers

Select the instruction register

RS=0
Select the data read

Read the status word from the port

P1

R/W=1

E=0

E=1

Open the screen display


Set the display start line

Enable is set high

Write data or instructions

Busy

Read the status word

Instruction / data register


Ready
Data: RS = 1; instruction: RS = 0

RS=1RS=0

E=1

Select the data is written

R/W=0

E=0

P1
Into the data or instructions
to the port P1

*
Note: In this manual reference procedure to streamline the process delay waiting to replace the process of
reading the status word.

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

Ref:LM12864L-AppNote-v0.1
5/7

LM12864L

2.5
:
//LM12864L
//TOPWAYLOGO
#include<stdio.h>
#include<reg52.h>
#include<intrins.h>

//

#define uchar unsigned char


#define uint unsigned int

//0~255
//0~65535

#define lcd_bus
P1
sbit
RS
=
P3^1;
sbit
RW
=
P3^7;
sbit
E
=
P3^6;
sbit
CS1 =
P3^4;
sbit
CS2 =
P3^3;
sbit
_RST =
P3^5;
uchar code LOGO[]={

//
//

// LOGO.bmp
// x=128x64
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,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,0x80,
0x80,0x80,0x80,0x80,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,
0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,0xE0,
0xE0,0x60,0x60,0x60,0x60,0x20,0x20,0xA0,
0xA0,0xA0,0x20,0x20,0x20,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,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,0x80,0x80,0x80,0x80,0x80,0x80,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,
0xE0,0xE0,0xE0,0xE0,0xE0,0xF0,0xF0,0xF0,
0xF0,0xF0,0xF8,0xF8,0xF8,0xF8,0xF8,0xFC,
0xFC,0xFC,0xFC,0xFC,0xFE,0xFE,0xFE,0xFE,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x7F,0x7F,0x3F,0xBF,0x9F,0xDF,
0xDF,0xEF,0xEF,0xE7,0xF7,0xF7,0xF3,0xFB,
0xFB,0xFB,0xFD,0xFD,0xFD,0xFE,0xFE,0xFE,
0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0x04,0x06,0x06,0x06,0x06,
0x06,0x02,0x03,0x03,0x03,0x03,0x03,0x03,
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
0x07,0x07,0x07,0x07,0x07,0x0F,0x0F,0x0F,
0x0F,0x0F,0x1F,0x9F,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0x7F,0x7F,0x3F,0x1F,
0x9F,0xCF,0xE7,0xE7,0xF3,0xFB,0xF9,0xFD,
0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,
0xE0,0xF8,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0x7F,0x3F,0x1F,0x9F,0xCF,
0xE7,0xF3,0xF9,0xF8,0xFC,0xFE,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,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x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFE,
0xFF,0x3F,0xDF,0xE7,0xFB,0xFC,0xFE,0xFF,
0xFF,0xEF,0xEF,0xEF,0x0F,0x0F,0xEF,0xEF,
0xEF,0xFF,0xBF,0x1F,0x0F,0xEF,0xEF,0xEF,
0xEF,0x0F,0x1F,0xBF,0xFF,0xFF,0x0F,0x0F,
0x0F,0xAF,0xAF,0xAF,0x8F,0xDF,0xFF,0xEF,
0x8F,0x1F,0x7F,0x3F,0x0F,0xCF,0x0F,0x1F,
0xFF,0x3F,0x0F,0xCF,0xFF,0xFF,0x7F,0x3F,
0x0F,0x6F,0x6F,0x0F,0x3F,0x7F,0xFF,0xEF,
0xCF,0xCF,0x1F,0x3F,0x1F,0xCF,0xEF,0xEF,
0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x07,0x09,
0x0E,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0E,0x0E,0x0F,0x0F,
0x0F,0x0F,0x0F,0x0F,0x0E,0x0E,0x0E,0x0E,
0x0E,0x0E,0x0F,0x0F,0x0F,0x0F,0x0E,0x0E,
0x0E,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x0F,0x0E,0x0E,0x0E,0x0F,0x0F,0x0F,0x0E,
0x0E,0x0E,0x0F,0x0F,0x0F,0x0F,0x0E,0x0E,
0x0F,0x0F,0x0F,0x0F,0x0E,0x0E,0x0F,0x0F,
0x0F,0x0F,0x0E,0x0E,0x0E,0x0F,0x0F,0x0F,
0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
//
//------------------------------------------void delay(uint m)
//
{
//12MHz
uint i,j;
// 1ms
for(i=0;i<m;i++)
for(j=0;j<109;j++);
_nop_();
}
//------------------------------------------//
//------------------------------------------void SdData (uchar ddata)
{
delay(0);
//

Ref:LM12864L-AppNote-v0.1
6/7

LM12864L

RS
RW
lcd_bus
E
E

=
=
=
=
=

1;
0;
ddata;
1;
0;

//

//------------------------------------------//
//------------------------------------------void SdCmd(uchar command)
{
delay(0);
//
RS
=
0;
RW
=
0;
lcd_bus =
command;
//
E
=
1;
E
=
0;
}

SdCmd(0xb8+i);
CS1 =
1;
CS2 =
0;
for(j=0;j<64;j++)
SdData(0x00);
CS1 =
0;
CS2 =
1;
for(k=64;k<128;k++)
SdData(0x00);

//
// 1

// 2

//------------------------------------------//
//------------------------------------------void Init()
{
_RST
=
0;
delay(150);
_RST
=
1;
//
delay(100);
CS1=1;
CS2=1;
//
SdCmd(0x3f);
//
SdCmd(0xc0);
//
}

//------------------------------------------//
//------------------------------------------void ShowPics(uchar code *bmp)
{
uchar
i,j,k;
for(i=0;i<8;i++)
{
CS1 =
1
CS2 =
1
//
SdCmd(0x40);
//
SdCmd(0xb8+i);
//
CS1 =
1;
CS2 =
0;
// 1
for(j=0;j<64;j++)
SdData(bmp[i*128+j]); //
CS1 =
0;
CS2 =
1;
// 2
for(k=64;k<128;k++)
SdData(bmp[i*128+k]); //
}
}

//------------------------------------------//
//------------------------------------------void CleanScreen()
{
uchar
i,j,k;
for(i=0;i<8;i++)
{
CS1 =
1
CS2 =
1
//
SdCmd(0x40);
//

//------------------------------------------//
//------------------------------------------main()
{
Init();
//
CleanScreen();
//
ShowPics(LOGO);
//LOGO
while(1)
{};
}
//end of program

URL: http://www.topwaydisplay.com
http://www.topwaysz.com

Ref:LM12864L-AppNote-v0.1
7/7

Das könnte Ihnen auch gefallen