⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mega16lcdyxd240128t6963c.c

📁 Mega16驱动240×128 LCD(T6963c).c
💻 C
📖 第 1 页 / 共 3 页
字号:
//;--  束  -- **  宋体, 12  **39 SU
0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,
0x23,0x08,0x05,0x80,0x05,0x40,0x09,0x30,0x31,0x0E,0xC1,0x04,0x01,0x00,0x01,0x00,
//;--  寻  --  **  宋体, 12  **40 XUN
0x00,0x00,0x3F,0xF8,0x00,0x08,0x1F,0xF8,0x00,0x08,0x00,0x08,0x3F,0xF8,0x00,0x20,
0x7F,0xFE,0x00,0x20,0x08,0x20,0x04,0x20,0x06,0x20,0x04,0x20,0x00,0xA0,0x00,0x40,
//;--  方  -- **  宋体, 12  **41 FANG
0x02,0x00,0x01,0x00,0x00,0x80,0xFF,0xFE,0x02,0x00,0x02,0x00,0x03,0xF0,0x02,0x10,
0x04,0x10,0x04,0x10,0x08,0x10,0x08,0x10,0x10,0x10,0x20,0x90,0xC0,0x60,0x00,0x00,
//;--  式  -- **  宋体, 12  **42 SHI3
0x00,0xA0,0x00,0x98,0x00,0x90,0x7F,0xFC,0x00,0x80,0x00,0x80,0x00,0x80,0x3E,0x80,
0x08,0x40,0x08,0x40,0x08,0x40,0x0B,0x20,0x1C,0x22,0x70,0x12,0x20,0x0A,0x00,0x04,
//;--  找  -- **  宋体, 12  **43 ZHAO
0x10,0x40,0x10,0x50,0x10,0x48,0xFE,0x40,0x11,0xFE,0x10,0x40,0x14,0x40,0x18,0x48,
0x30,0x28,0xD0,0x30,0x10,0x20,0x10,0x70,0x11,0x92,0x16,0x0A,0x50,0x06,0x20,0x02,
//;--  补  -- **  宋体, 12  **44 BU
0x20,0x20,0x18,0x20,0x10,0x20,0xFE,0x20,0x04,0x20,0x08,0x30,0x12,0x28,0x34,0x24,
0x58,0x22,0x94,0x22,0x12,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,
//;--  偿  -- **  宋体, 12  **45 CHANG
0x10,0x40,0x1A,0x48,0x11,0x4C,0x21,0x50,0x27,0xFE,0x74,0x04,0xA0,0x00,0x23,0xF8,
0x20,0x00,0x27,0xFE,0x20,0x80,0x21,0x90,0x22,0x08,0x27,0xFC,0x22,0x08,0x00,0x00,
//;--  向  -- **  宋体, 12  **46 XIANG
0x02,0x00,0x04,0x00,0x3F,0xFC,0x20,0x04,0x20,0x04,0x27,0xE4,0x24,0x24,0x24,0x24,
0x24,0x24,0x24,0x24,0x27,0xE4,0x24,0x24,0x20,0x04,0x20,0x14,0x20,0x08,0x00,0x00,
//;--  脱  -- **  宋体, 12  **47 TUO
0x01,0x08,0x3C,0xCC,0x24,0x90,0x25,0xFC,0x3D,0x04,0x25,0x04,0x25,0x04,0x25,0xFC,
0x3C,0x50,0x24,0x50,0x24,0x50,0x44,0x50,0x44,0x92,0x54,0x92,0x89,0x0E,0x02,0x00,
//;--  正  -- **  宋体, 12  **48 ZHENG
0x00,0x00,0x7F,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x10,0x80,0x10,0xFC,
0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0x10,0x80,0xFF,0xFE,0x00,0x00,0x00,0x00,
//;--  新  --  **  宋体, 12  **49 XIN1
0x10,0x00,0x08,0x0E,0x7F,0x70,0x22,0x40,0x14,0x40,0xFF,0x7E,0x08,0x48,0x08,0x48,
0xFF,0x48,0x08,0x48,0x2C,0x48,0x2A,0x88,0x4A,0x88,0x89,0x08,0x2A,0x08,0x10,0x08,
//;--  文  --  **  宋体, 12  **50 WEN
0x02,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x08,0x20,0x08,0x20,0x08,0x20,0x04,0x40,
0x04,0x40,0x02,0x80,0x01,0x00,0x02,0x80,0x04,0x60,0x18,0x1E,0xE0,0x08,0x00,0x00,
//;--  件  -- **  宋体, 12  **51 JIAN2
0x10,0x40,0x1A,0x40,0x13,0x40,0x32,0x40,0x23,0xFC,0x64,0x40,0xA4,0x40,0x28,0x40,
0x2F,0xFE,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,
//;--  打  -- **  宋体, 12  **52 DA 
0x10,0x00,0x10,0x00,0x13,0xFE,0x10,0x20,0xFE,0x20,0x10,0x20,0x14,0x20,0x18,0x20,
0x30,0x20,0xD0,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x50,0xA0,0x20,0x40,
//;--  已  -- **  宋体, 12  **53 YI
0x00,0x00,0x3F,0xF0,0x00,0x10,0x00,0x10,0x00,0x10,0x20,0x10,0x3F,0xF0,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x04,0x20,0x04,0x20,0x06,0x3F,0xFC,0x00,0x00,0x00,0x00,
//;--  有  -- **  宋体, 12  **54 YOU
0x01,0x00,0x01,0x00,0x7F,0xFE,0x02,0x00,0x04,0x00,0x0F,0xF0,0x18,0x10,0x28,0x10,
0x4F,0xF0,0x88,0x10,0x08,0x10,0x0F,0xF0,0x08,0x10,0x08,0x90,0x08,0x70,0x08,0x20,
//;--  名  -- **  宋体, 12  **55 MING
0x04,0x00,0x04,0x00,0x07,0xF8,0x08,0x10,0x10,0x20,0x24,0x40,0x42,0x80,0x01,0x00,
0x06,0x00,0x1F,0xF8,0xE8,0x08,0x08,0x08,0x08,0x08,0x0F,0xF8,0x08,0x08,0x00,0x00,
//;--  行  -- **  宋体, 12  **56 HANG
0x08,0x00,0x1C,0x00,0x31,0xFC,0x40,0x00,0x88,0x00,0x0C,0x00,0x1B,0xFE,0x30,0x20,
0x50,0x20,0x90,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0x20,0x10,0xA0,0x10,0x40,
//;--  色  -- **  宋体, 12  **57 SE2
0x04,0x00,0x04,0x00,0x07,0xF0,0x08,0x20,0x10,0x40,0x3F,0xF0,0x51,0x10,0x11,0x10,
0x11,0x10,0x1F,0xF0,0x10,0x00,0x10,0x04,0x10,0x04,0x10,0x04,0x0F,0xFC,0x00,0x00,
//;--  布  --  **  宋体, 12  **58 BU1
0x02,0x00,0x03,0x00,0x02,0x00,0xFF,0xFE,0x04,0x80,0x04,0x80,0x08,0x80,0x1F,0xF8,
0x28,0x88,0x48,0x88,0x88,0x88,0x08,0x88,0x08,0xA8,0x08,0x90,0x00,0x80,0x00,0x80,
//;--  长  -- **  宋体, 12  **59 CHANG1
0x08,0x00,0x08,0x10,0x08,0x20,0x08,0x40,0x09,0x80,0x0E,0x00,0x08,0x00,0xFF,0xFE,
0x0A,0x00,0x09,0x00,0x08,0x80,0x08,0x40,0x09,0x30,0x0A,0x1C,0x0C,0x08,0x08,0x00,
//;--  点  -- **  宋体, 12  **60 DIAN
0x01,0x00,0x01,0x00,0x01,0xF8,0x01,0x00,0x01,0x10,0x1F,0xF8,0x10,0x10,0x10,0x10,
0x10,0x10,0x1F,0xF0,0x10,0x10,0x01,0x10,0x28,0x88,0x24,0x44,0x44,0x44,0x00,0x00,
//;--  动  -- **  宋体, 12  **61 DONG
0x00,0x20,0x00,0x20,0x7E,0x20,0x00,0x20,0x00,0xFC,0xFF,0x24,0x10,0x24,0x10,0x24,
0x24,0x24,0x22,0x24,0x4F,0x44,0xFA,0x44,0x40,0x84,0x01,0x14,0x02,0x08,0x00,0x00,
//;--  速  -- **  宋体, 12  **62 SU
0x00,0x80,0x40,0x80,0x2F,0xFC,0x20,0x80,0x00,0x80,0x07,0xF8,0xE4,0x88,0x24,0x88,
0x27,0xF8,0x21,0xA0,0x22,0x98,0x2C,0x88,0x20,0x80,0x50,0x80,0x8F,0xFE,0x00,0x00,
//;--  密  -- **  宋体, 12  **63 MI
0x02,0x00,0x01,0x00,0x3F,0xFE,0x42,0x24,0x49,0x50,0x29,0x48,0x48,0xA4,0x0B,0x34,
0x1F,0xE0,0xE0,0x00,0x41,0x00,0x11,0x08,0x11,0x08,0x11,0x08,0x1F,0xF8,0x00,0x00,
//;--  纱  -- **  宋体, 12  **64 SHA
0x10,0x20,0x10,0x20,0x20,0x20,0x25,0x28,0x45,0xA4,0xF9,0x22,0x12,0x22,0x24,0x20,
0x40,0x24,0xFC,0x28,0x00,0x10,0x0C,0x20,0xF0,0x40,0x41,0x80,0x06,0x00,0x18,0x00,
//;--  器  -- **  宋体, 12  **65 QI
0x3E,0x7C,0x22,0x44,0x22,0x44,0x3E,0x7C,0x01,0x10,0x01,0x08,0xFF,0xFC,0x06,0xC0,
0x18,0x30,0xE0,0x0E,0x3E,0xFC,0x22,0x88,0x22,0x88,0x22,0x88,0x3E,0xF8,0x00,0x00,
//;--  定  -- **  宋体, 12  **66 DING
0x02,0x00,0x01,0x00,0x3F,0xFE,0x20,0x04,0x40,0x08,0x1F,0xF0,0x01,0x00,0x11,0x00,
0x11,0x00,0x11,0xF0,0x11,0x00,0x29,0x00,0x25,0x00,0x43,0x00,0x81,0xFC,0x00,0x00,
//;--  厘  --  **  宋体, 12  **67 LI
0x00,0x00,0x3F,0xFE,0x20,0x00,0x2F,0xF8,0x28,0x88,0x2F,0xF8,0x28,0x88,0x28,0x88,
0x2F,0xF8,0x28,0x88,0x40,0x80,0x4F,0xFC,0x40,0x80,0x80,0x80,0xBF,0xFE,0x00,0x00,
//;--  米  -- **  宋体, 12  **68 MI
0x01,0x00,0x21,0x08,0x11,0x08,0x09,0x10,0x09,0x20,0xFF,0xFE,0x05,0x80,0x05,0x40,
0x09,0x40,0x09,0x20,0x11,0x20,0x11,0x18,0x21,0x0E,0x41,0x04,0x81,0x00,0x01,0x00,
//;--  单  -- **  宋体, 12  **69 DAN
0x08,0x20,0x06,0x30,0x04,0x40,0x3F,0xF8,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,
0x3F,0xF8,0x21,0x08,0x01,0x00,0xFF,0xFE,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
//;--  双  --  **  宋体, 12  **70 SHUANG
0x00,0x00,0x7E,0xFC,0x02,0x84,0x02,0x84,0x42,0x84,0x24,0x48,0x14,0x48,0x08,0x48,
0x0C,0x50,0x16,0x20,0x13,0x20,0x22,0x50,0x40,0x88,0x81,0x06,0x02,0x04,0x00,0x00,
//;--  断  -- **  宋体, 12  **71 DUAN
0x04,0x00,0x44,0x0E,0x65,0x70,0x55,0x40,0x56,0x40,0x44,0x40,0x7F,0x7E,0x4C,0x48,
0x56,0x48,0x55,0x48,0x64,0x48,0x44,0x88,0x44,0x88,0x7F,0x08,0x02,0x08,0x00,0x08,
//;--  次  -- **  宋体, 12  **72 CI
0x01,0x00,0x41,0x00,0x25,0x00,0x25,0xFE,0x2A,0x44,0x0A,0x48,0x14,0x40,0x10,0x40,
0x20,0xC0,0xE0,0xA0,0x41,0x20,0x42,0x10,0x44,0x08,0x18,0x0E,0x60,0x04,0x00,0x00,
//;--  班  -- **  宋体, 12  **73 BAN
0x01,0x00,0xF9,0x7E,0x21,0x10,0x21,0x10,0x21,0x10,0x25,0x10,0xFD,0x7E,0x25,0x10,
0x29,0x10,0x21,0x10,0x21,0x10,0x3A,0x10,0xC2,0x10,0x04,0xFE,0x08,0x00,0x10,0x00,
//;--  产  -- **  宋体, 12  **74 CHANG2
0x01,0x00,0x00,0x80,0x7F,0xFE,0x08,0x10,0x06,0x20,0x24,0x44,0x3F,0xFE,0x20,0x00,
0x20,0x00,0x20,0x00,0x20,0x00,0x20,0x00,0x40,0x00,0x40,0x00,0x80,0x00,0x00,0x00,
//;--  量  -- **  宋体, 12  **75 LIANG
0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x00,0x00,0xFF,0xFE,0x11,0x10,
0x1F,0xF0,0x11,0x10,0x1F,0xF0,0x01,0x00,0x1F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x00,
//;--  织  -- **  宋体, 12  **76 ZHI2
0x10,0x00,0x11,0xFC,0x21,0x04,0x29,0x04,0x49,0x04,0xF1,0x04,0x11,0x04,0x21,0xFC,
0x40,0x00,0xF8,0x00,0x00,0x90,0x00,0x88,0x19,0x0C,0xE2,0x06,0x04,0x04,0x00,0x00,
//;--  总  -- **  宋体, 12  **77 ZONG
0x08,0x20,0x04,0x20,0x04,0x40,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x10,0x1F,0xF0,
0x00,0x00,0x01,0x00,0x08,0x88,0x28,0x84,0x28,0x16,0x68,0x12,0x07,0xF0,0x00,0x00,
//;--  车  -- **  宋体, 12  **78 CHE
0x02,0x00,0x02,0x00,0x7F,0xFC,0x04,0x00,0x04,0x80,0x08,0x80,0x10,0x80,0x3F,0xFC,
0x00,0x80,0x00,0x80,0xFF,0xFE,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,
//;--  机  -- **  宋体, 12  **79 JI
0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x88,
0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x00,
//;--  状  --  **  宋体, 12  **80 ZHUANG
0x10,0xA0,0x10,0x90,0x10,0x98,0x90,0x88,0x50,0x80,0x5F,0xFE,0x10,0xA0,0x10,0xA0,
0x31,0x20,0x51,0x20,0x91,0x10,0x12,0x10,0x12,0x08,0x14,0x0E,0x18,0x04,0x10,0x00,
//;--  态  -- **  宋体, 12  **81 TAI
0x01,0x00,0x01,0x00,0x7F,0xFC,0x01,0x00,0x02,0x80,0x02,0x40,0x05,0x20,0x08,0x98,
0x30,0x06,0x01,0x00,0x04,0x88,0x24,0x84,0x24,0x12,0x64,0x12,0x43,0xF0,0x00,0x00,
//;--  其  -- **  宋体, 12  **82 QI1
0x08,0x20,0x08,0x20,0x7F,0xFC,0x08,0x20,0x08,0x20,0x0F,0xE0,0x08,0x20,0x0F,0xE0,
0x08,0x20,0x08,0x20,0xFF,0xFE,0x08,0x40,0x0C,0x20,0x18,0x10,0x30,0x18,0x40,0x10,
//;--  它  -- **  宋体, 12  **83 TA
0x02,0x00,0x01,0x00,0x3F,0xFE,0x20,0x04,0x40,0x08,0x08,0x00,0x08,0x20,0x08,0x70,
0x09,0x80,0x0E,0x00,0x08,0x00,0x08,0x08,0x08,0x08,0x08,0x0C,0x07,0xF8,0x00,0x00,
//;--  防  --  **  宋体, 12  **84 FANG1
0x00,0x80,0x7C,0x40,0x48,0x40,0x53,0xFE,0x50,0x80,0x60,0x80,0x50,0x80,0x48,0xF8,
0x49,0x08,0x49,0x08,0x69,0x08,0x52,0x08,0x42,0x08,0x44,0x08,0x48,0x28,0x40,0x10,

//;--    -- **  宋体, 12  **0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
				};
				
#pragma	data:	eeprom
#pragma data:	data
					
//******************************************************************************


/*
********************************************************************************
Function Area
********************************************************************************
*/
void delay_us(uint n)
{
	uint i=0;
	for(i=0;i<n;i++)
		NOP();
}

void delay_1ms(void)
{	 
	uint i;
	for(i=1;i<(uint)(xtal*143-2);i++);
}

void delay(uint n)
{
	uint i=0;
	for(i=0;i<n;i++)
		delay_1ms();
}

void McuInit(void)
{
	MCUCR=0x00;
	DDRA =0xFF;
	PORTA=0xFF;
	DDRB =0xFF;
	PORTB=0xFF;
	DDRC =0xFF;
	PORTC=0xFF;
	DDRD =0xFF;
	PORTD=0xFF;	
}
	 
uchar ReadSta(void) 
{
	uchar data;
//	NOP();NOP();NOP();
	WR_SET;
	CD_SET;
	NOP();NOP();NOP();
	RD_CLR;
	NOP();NOP();NOP();
	IN_DIR;
	DDRB=0x00;
	NOP();NOP();NOP();	
	data=PINB;
	RD_SET;
	CD_CLR;
	NOP();NOP();NOP();
	return data;
}
uchar ReadData(void) 
{
	uchar data;
	while ( (ReadSta()&0x03) !=0x03);
//	NOP();NOP();NOP();
	WR_SET;
	CD_CLR;
	NOP();NOP();NOP();
	RD_CLR;
	NOP();NOP();NOP();
	IN_DIR;
	DDRB=0x00;
	NOP();NOP();NOP();	
	data=PINB;
	RD_SET;
	CD_CLR;
	NOP();NOP();NOP();
	return data;
}
void WriteCmd(uchar command)
{
	while ( (ReadSta()&0x03) !=0x03);
	RD_SET;
	CD_SET;
	OUT_DIR;
	DDRB=0xFF;
	PORTB=command;
//	NOP();NOP();NOP();	
	WR_CLR;
	NOP();NOP();NOP();
	WR_SET;
	CD_CLR;

}

void WriteData(uchar data)
{
	while ( (ReadSta()&0x03) !=0x03);
	RD_SET;
	CD_CLR;
	OUT_DIR;
	DDRB=0xFF;
	PORTB=data;
//	NOP();NOP();NOP();	
	WR_CLR;
	NOP();NOP();NOP();
	WR_SET;
}
void WrTwoParCmd(uchar par1,uchar par2,uchar command)
{
	WriteData(par1);
	WriteData(par2);
	WriteCmd(command);
}
void WrOneParCmd(uchar par,uchar command)
{
	WriteData(par);
	WriteCmd(command);
}


void WrCGRAM(void)
{
	uint i,j,len;
		
	WrTwoParCmd(0x00,0x00,OFFSET);
	WrTwoParCmd(0x00,0x04,ADPSET);
	while((ReadSta()&0x08)!=8);
	WriteCmd(AWRON);
	for(i=0;i<10;i++) {				//8*8
		for(j=0;j<8;j++)
			WriteData(GrCode[i*8+j]);
	}
	len=(uchar)sizeof(ChCode);		//16*16
	for (j=0;j<len;j++) {
		for(i=0;i<16;i+=2) 
			WriteData(ChCode[j][i]);
		for(i=1;i<16;i+=2) 
			WriteData(ChCode[j][i]);
		for(i=16;i<32;i+=2) 
			WriteData(ChCode[j][i]);
		for(i=17;i<32;i+=2) 
			WriteData(ChCode[j][i]);			

	}
	WriteCmd(AWROFF);
	
}

void LcdResetTxt(void)
{
	uint i;

	WrTwoParCmd(0x00,0x00,CUPSET);	
	WrTwoParCmd(0x00,0x00,TXHOME);
	WrTwoParCmd(0x1E,0x00,TXAREA);

	WrTwoParCmd(0x00,0x00,ADPSET);
	WrTwoParCmd(0x00,0x00,ADPSET);//No Repeat--False Code 
	while((ReadSta()&0x08)!=8);
	WriteCmd(AWRON);	
	for(i=0;i<(LCDCOLUMN*LCDLINE);i++)
		WriteData(0);
	WriteCmd(AWROFF);	
}

void LcdResetGr(void)
{
	uint i;

	WrTwoParCmd(0x00,0x08,GRHOME);
	WrTwoParCmd(0x00,0x08,GRHOME);	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -