📄 init_nt39106.c
字号:
#include "Delay.c"
#include "Trans_Com_16.c"
#include "Trans_Dat_16.c"
void init_LCD(void)
{
Reset=1;
Delay(1);
Reset=0;
Delay(1);
Reset=1;
Trans_Com_16(0x0008); // osc start
Trans_Dat_16(0x0202); // osc start
Trans_Com_16(0x0012); // osc start
Trans_Dat_16(0x0019); // osc start
Trans_Com_16(0x0013); //0001
Trans_Dat_16(0x131e); //0001
Delay(1);
Trans_Com_16(0x0010); // 4140; osc start
Trans_Dat_16(0x0604); // 4140; osc start
Delay(1);
Trans_Com_16(0x0011); //0001
Trans_Dat_16(0x0002); //0001
Delay(1);
Trans_Com_16(0x0010); // osc start
Trans_Dat_16(0x4643); // osc start
Delay(1);
Trans_Com_16(0x0012); //0014 ;0014 for other cf
Trans_Dat_16(0x0012); //0014 ;0014 for other cf
Delay(1);
Trans_Com_16(0x0010); //0015
Trans_Dat_16(0x4730); //0015
Delay(1);
Trans_Com_16(0x0013); //341e ;2e1b for other cf
Trans_Dat_16(0x2c18); //341e ;2e1b for other cf
Delay(1);
Trans_Com_16(0x0000); //osc start
Trans_Dat_16(0x0005);
Trans_Com_16(0x0001); //Driver output control
Trans_Dat_16(0x011b); //SM=SG=0 SS=1 dots:528*220
Trans_Com_16(0x0002); //lcd drive AC control
Trans_Dat_16(0x0700); //1 field
Trans_Com_16(0x0003); //entry mode
Trans_Dat_16(0x1030); //#7030H ;BGR=1
Trans_Com_16(0x0004); //compare register
Trans_Dat_16(0x0000); //compare register
Trans_Com_16(0x0005); //compare register
Trans_Dat_16(0x0000); //compare register
Trans_Com_16(0x0021); //RAM address set
Trans_Dat_16(0x0000);
//Trans_Com_16(0x0007);
//Trans_Dat_16(0x0037); //0100H ;r control(1) display off
Trans_Com_16(0x0008); //0405H ;r control(2)
Trans_Dat_16(0x0202); //0405H ;r control(2)
Trans_Com_16(0x0009); //r control(3)
Trans_Dat_16(0x0000); //r control(3)
Trans_Com_16(0x000B); //frame cycle control
Trans_Dat_16(0x0004); //#5403H ;1008H ;frame cycle control
Trans_Com_16(0x000c); //external display interface control(1)
Trans_Dat_16(0x0003);
Trans_Com_16(0x0040); //gate scan starting position
Trans_Dat_16(0x0000); //gate scan starting position
Trans_Com_16(0x0041); //#00afH ;vertical scroll control
Trans_Dat_16(0x0000); //#00afH ;vertical scroll control
Trans_Com_16(0x0042); //first display drive position
Trans_Dat_16(0xdb00); //first display drive position
Trans_Com_16(0x0043); //second sisplay drive position
Trans_Dat_16(0x0000); //second sisplay drive position
Trans_Com_16(0x0044); //first display drive position
Trans_Dat_16(0xaf00); //first display drive position
Trans_Com_16(0x0045); //second display drive position
Trans_Dat_16(0xdb00); //second display drive position
//gamme set
Trans_Com_16(0x0030); //0300H ;r control(4)
Trans_Dat_16(0x0303); //0300H ;r control(4)
Trans_Com_16(0x0031); //0300H ;r control(4)
Trans_Dat_16(0x0303); //0300H ;r control(4)
Trans_Com_16(0x0032); //TCL
Trans_Dat_16(0x0303); //TCL
Trans_Com_16(0x0033);
Trans_Dat_16(0x0303); //0300H ;r control(4)
Trans_Com_16(0x0034);
Trans_Dat_16(0x0404);
Trans_Com_16(0x0035);
Trans_Dat_16(0x0404);
Trans_Com_16(0x0036);
Trans_Dat_16(0x0404);
Trans_Com_16(0x0037);
Trans_Dat_16(0x0303);
Trans_Com_16(0x0038);
Trans_Dat_16(0x0000);
Trans_Com_16(0x0039); //MOV DPTR,#0000H ;0300H ;r control(4)
Trans_Dat_16(0x0000);
Trans_Com_16(0x0010); //display control
Trans_Dat_16(0x4040); //display control
Trans_Com_16(0x0007); //display control
Trans_Dat_16(0x0005); //display control
Delay(1);
Trans_Com_16(0x0007);
Trans_Dat_16(0x0025);
Trans_Com_16(0x0007);
Trans_Dat_16(0x0027);
Delay(1);
Trans_Com_16(0x0007);
Trans_Dat_16(0x0037);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -