S6B0724芯片的LCD128*64的AVR128驱动程序
以下是用S6B0724做驱动芯片的128*64的AVR128驱动程序,已经测试通过。请大家放心使用,呵呵!
/*************************************************************/
#i nclude avr/io.h>
/*************************************************************/
/* 宏定义替换 */
/*************************************************************/
#define uchar unsigned char //宏定义替换
#define uint unsigned int //宏定义替换
#define ulong unsigned long //宏定义替换
/*************************************************************/
/* 接口定义替换 */
/*************************************************************/
//#define LCM_DB P0 //数据总线定义
//sbit LCM_nRST = P1^0; //低电平复位
//sbit LCM_nCS = P2^7; //片选A15
//sbit LCM_DnI = P2^0; //数据与指令的接口A8
//sbit LCM_nWR = P3^6; //写选通线
//sbit LCM_nRD = P3^7; //读选通线
#define LCM_DB PORTA //数据总线定义
#define LCM_nRST PC7 //低电平复位
#define LCM_nCS PC6 //片选A15
#define LCM_DnI PC5 //数据与指令的接口A8
#define LCM_nWR PC4 //写选通线
#define LCM_nRD PC3 //读选通线
#define SETBIT(x,y) (x |= (1y)) // Set bit y in byte x
#define CLRBIT(x,y) (x = (~(1y)))// Clear bit y in byte x
#define CHKBIT(x,y) (x (1y)) // Check bit y in byte x
/*************************************************************/
/* 字模数组 */
/*************************************************************/
/*-- 调入了一幅图像:D:\LCD\商行.bmp --*/
/*-- 宽度x高度=128x64 纵向倒序 --*/
uchar zimo[]={
0x00,0x00,0x00,0x00,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,0x40,0xC0,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x80,0x80,0x80,0xC0,0x80,0x80,
0x80,0x80,0x00,0x00,0x40,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0xC0,0x80,0x00,0x00,
0x00,0x40,0x80,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,
0x80,0x80,0x80,0xC0,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,0x40,0x20,0x97,0x5D,0x35,0x95,
0x75,0x15,0x17,0xF0,0x00,0x00,0x22,0x12,0xFF,0x0A,0x00,0xAA,0x2A,0xFF,0xAA,0xAA,
0xBE,0x08,0x00,0x04,0x04,0xFC,0x80,0x48,0x08,0xFE,0x08,0x08,0xFF,0x00,0x80,0x00,
0x04,0x04,0xFD,0x00,0x82,0x42,0x32,0x0F,0x12,0x22,0xC2,0x02,0x00,0x00,0x7F,0x49,
0x49,0x49,0xFF,0x49,0x49,0x49,0x7F,0x00,0x80,0x00,0x08,0x08,0x08,0x08,0x08,0x08,
0xFE,0x0A,0x09,0x08,0x08,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,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x40,0xE0,0x00,0x00,0x00,0x00,0xC0,0x21,0x20,0x22,0xC1,0x00,
0x00,0xC2,0x22,0x21,0x20,0xC0,0x00,0x02,0x03,0x02,0x81,0x00,0x01,0x03,0x02,0x82,
0x42,0x22,0x20,0x60,0x00,0x01,0x00,0x80,0x40,0xE3,0x00,0x00,0x00,0x61,0x23,0xE0,
0x22,0x61,0x00,0x01,0x02,0x82,0x62,0x82,0x02,0x02,0x22,0xE2,0x20,0x20,0x20,0xC0,
0x00,0x40,0x89,0x12,0x02,0x12,0xD2,0x12,0x9B,0xD0,0x90,0x90,0x10,0x00,0x00,0x02,
0x03,0xF8,0xA8,0xA8,0xA8,0xA8,0xA8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x00,
0x00,0x1C,0x23,0x22,0x23,0x1C,0x00,0x00,0x09,0x06,0x1F,0x06,0x09,0x00,0x00,0x1F,
0x22,0x21,0x21,0x1E,0x00,0x04,0x0B,0x08,0x28,0x3F,0x20,0x00,0x00,0x00,0x20,0x3F,
0x20,0x00,0x00,0x20,0x38,0x27,0x04,0x27,0x38,0x20,0x20,0x3F,0x21,0x21,0x21,0x1E,
0x00,0x08,0x7C,0x02,0x04,0x7F,0x40,0x22,0x15,0x0A,0x14,0x23,0x40,0x00,0x00,0x7E,
0x2A,0x2A,0x2A,0x7E,0x00,0x7E,0x2A,0x2A,0x2A,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0xAB,
0x65,0xA5,0x2F,0x30,0xAB,0x65,0xA5,0x2F,0x00,0x00,0x90,0xDC,0xB3,0x88,0x50,0x95,
0x15,0xF5,0x95,0x9F,0x50,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x5F,0x51,0x55,0x55,0xFF,0x55,0x55,0x51,0x5F,0x00,
0x00,0x00,0x00,0xFC,0x44,0x44,0x46,0x45,0x44,0x44,0x44,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x72,0x02,0x7F,0x42,
0x22,0x1A,0x17,0x32,0x52,0x12,0x02,0x00,0x10,0x08,0xF4,0x93,0x92,0x92,0xFA,0x96,
0x92,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x80,0x82,0x03,0x42,
0x82,0x02,0xE2,0x0F,0x82,0x42,0x02,0x02,0x02,0x80,0x64,0x44,0x42,0xE2,0x44,0x42,
0x49,0x4F,0x40,0x01,0x02,0x24,0x40,0x00,0x41,0x42,0x46,0x60,0x40,0x40,0x40,0x40,
0x00,0x00,0x00,0x00,0xE0,0xA9,0xA5,0xA1,0xAD,0xA1,0xE1,0x0D,0x01,0x01,0x05,0x09,
0x00,0x00,0x00,0x0F,0x04,0x04,0x04,0x24,0x24,0x24,0xA4,0xAF,0x60,0x20,0x00,0x01,
0x02,0x06,0x80,0x80,0xE0,0x80,0x40,0xC0,0x40,0x60,0x40,0xC8,0x48,0x0F,0x09,0x8F,
0x89,0x89,0x8F,0x29,0x2F,0x28,0xA8,0x60,0x20,0x20,0x27,0x08,0x08,0x08,0xC8,0x48,
0x48,0x48,0x48,0x4E,0x40,0xE0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x13,0x12,0xFE,0x92,0x00,0xFE,
0x2A,0x2A,0x2B,0x2A,0xFE,0x00,0x00,0x02,0x01,0x1F,0xD5,0x55,0x55,0x5F,0x55,0x55,
0xD5,0x15,0x10,0x00,0x21,0xF2,0x08,0x10,0xFC,0x03,0x88,0x56,0x2B,0x52,0x8E,0x00,
0x00,0x00,0xF8,0xA8,0xAB,0xAA,0xFA,0x02,0xFA,0xAA,0xAB,0xA8,0xF8,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x82,0x62,0x1E,0x20,0x2A,0xFF,0x2A,0x20,0x0F,0x34,0x42,
0x80,0x00,0x10,0x08,0xFF,0x04,0x12,0x12,0xB3,0x5A,0x53,0xB2,0x92,0x12,0x00,0x20,
0x60,0x3F,0x10,0x10,0x3F,0x81,0x41,0x3D,0x41,0xBF,0x00,0x00,0x00,0x00,0xFF,0x92,
0x92,0x92,0x92,0x92,0x92,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,
0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,
0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
S6B0724芯片 LCD128*64 AVR128 相关文章:
- AVR128的程序——独立按键控制LED灯闪烁(11-22)
- AVR128的程序——数码管0~7顺序闪烁(11-22)
- AVR128的程序——独立按键控制数码管0~99递增(11-22)
- AVR128的程序——定时器(11-22)
- AVR128的程序——独立按键控制蜂鸣器鸣叫(11-22)
- AVR128的程序——步进电机点动正反控制(11-22)