LCD12864(ST7920)的C8051驱动(并行)

发布者:诚信与爱最新更新时间:2016-01-13 来源: eefocus关键字:LCD12864  ST7920  C8051 手机看文章 扫描二维码
随时随地手机看文章
//--------------------st_12864.h------------------------

#ifndef _LCD12864_ST7920
#define _LCD12864_ST7920
#ifndef uint8
#define uint8 unsigned char
#endif
#ifndef uint16
#define uint16 unsigned int
#endif
extern void st_writeCmd(uint8 CMD);
extern void st_writeDat(uint8 DAT);
//extern void Delay(uint16 ms);
extern uint8 st_checkBusy(void);
extern void st_drawFull(uint8 x, uint8 y, const uint8 *Draw);
//extern void Picture_Set_XY(uint8 x, uint8 y);
extern void st_sendstr(uint8 x, uint8 y, uint8 *p);
extern void st_init(void);
extern void st_setDraw(void);
extern void st_flash(uint16 delay_t,uint8 times);
extern void st_moveChar(uint8 step,uint8 dirction,uint16 time);
extern void st_drawFree(uint8 x1,uint8 y1,uint8 x2,uint8 y2,const uint8 *dat);
extern void st_readRam(uint8 x,uint8 y);
extern void st_drawPixel(uint8 x,uint8 y,uint8 color);
extern void st_clr(void);
extern void st_drawRectangle(uint8, uint8, uint8, uint8, uint8, uint8);
extern void st_drawVerticalLine(uint8 x1, uint8 y1, uint8 y2, uint8 color);
extern void st_drawLevelLine(uint8 x1, uint8 y1, uint8 x2, uint8 color);
extern void st_setChar(void);
#endif

//---------------------------------------------
//--------------------st_12864.c-------------------------
/
//12864接口
#define ST_DATA P1
#define DATA_PORT P1
//st7920指令
#define ST_CLEAR 0x01    
#define ST_HOME 0x02    
#define ST_ENTRY_MODE 0x06  
#define ST_DISPLAY_OFF 0x08  
#define ST_DISPLAY_ON 0x0c  
#define ST_FUN_8 0x30    
#define ST_FUN_8_BAS 0x30  
#define ST_FUN_8_EXT 0x34  

#define ST_FUN_8_G 0x36  
#define ST_BUSY P1&0x80    
sbit st_rs=P0^1;
sbit st_rw=P0^2;
sbit st_e=P0^3;
void st_writeCmd(uint8 CMD);
void st_writeDat(uint8 DAT);
void Delay(uint16 ms);
uint8 st_checkBusy(void);
void st_drawFull(uint8 x,uint8 y,const uint8*Draw);
//void Picture_Set_XY(uint8 x,uint8 y);
void st_sendstr(uint8 x,uint8 y,uint8*p);
void st_init(void);
void st_setDraw(void);
void st_flash(uint16 delay_t,uint8 times);
void st_moveChar(uint8 step,uint8 dirction,uint16 time);
void st_drawFree(uint8 x1,uint8 y1,uint8 x2,uint8 y2, const uint8 *dat);
void st_readRam(uint8 x,uint8 y);
void st_drawPixel(uint8 x,uint8 y,uint8 color);
void st_clr(void);
void st_drawRectangle(uint8,uint8,uint8,uint8,uint8,uint8);
void st_drawVerticalLine(uint8 x1,uint8 y1,uint8 y2,uint8 color);
void st_drawLevelLine(uint8 x1,uint8 y1,uint8 x2,uint8 color);
void st_setChar(void);
uint8 readdispdata[2];

void st_init(void)
{
    EA=0;
delay_ms(50);
    //功能设置 8位数据,基本指令
    st_writeCmd(ST_FUN_8);
//delay_us(120);
st_writeCmd(ST_FUN_8_BAS);
//st_writeCmd(ST_FUN_8_G);
//delay_us(50);
    //显示状态ON,游标OFF,反白OFF
    st_writeCmd(ST_DISPLAY_ON);
//delay_us(120);
//清屏
    st_writeCmd(ST_CLEAR);
//delay_ms(12);
    //地址归位
    //st_writeCmd(ST_HOME);
//delay_us(120);
    //设置进入地址
    st_writeCmd(ST_ENTRY_MODE);
delay_us(1);
EA=1;
}
void st_flash(uint16 delay_t,uint8 times)
{
    uint8 j ;
    for(j=0;j     {
        //st_writeCmd(0x08);  //关闭显示
        st_writeCmd(ST_FUN_8_EXT); //关图形模式
        delay_ms(delay_t); //软件延时
        //st_writeCmd(0x0c);  //开显示
        st_writeCmd(ST_FUN_8_G); //开图形模式
        delay_ms(delay_t);    //软件延时
    }
}

void st_moveChar(uint8 step,uint8 dirction,uint16 time)
{
    uint8 i ;
    //移动的步数
    for(i=0;i     {
        st_writeCmd(dirction);
        //文字移动方向
        delay_ms(time);
        //控制移动时间
    }
}

//写控制命令函数
void st_writeCmd(uint8 CMD)
{
while(st_checkBusy());
    //检测液晶内部是否忙
    st_rs=0;
    st_rw=0;
    DATA_PORT=CMD ;
    st_e=1;
    delay_us(2);
    st_e=0;
delay_us(2);
}

//写数据函数
void st_writeDat(uint8 DAT)
{
    while(st_checkBusy());
    //检测液晶内部是否忙
    st_rs=1;
delay_us(2);
    st_rw=0;
    DATA_PORT=DAT ;
    st_e=1;
    delay_us(2);
    st_e=0;
delay_us(2);
}

uint8 st_checkBusy(void)
{
    uint8 temp ;
    //st_e=0;
//delay_us(1);
DATA_PORT=0xff;
    st_rs=0;
    delay_us(1);//nop();
    st_rw=1;
    delay_us(2);//nop();
    st_e=1;
    delay_us(2);//nop();
    temp=DATA_PORT;
    delay_us(1);//nop();
    st_e=0;
    delay_us(1);//nop();
    temp&=0x80 ;
//st_e=1;
//delay_us(1);
    return(temp);
}

void st_sendstr(uint8 x,uint8 y,uint8*p)
{
    EA=0;
if(y==0)
    {
        st_writeCmd((0x80+x));
    }
    if(y==1)
    {
        st_writeCmd((0x90+x));
    }
    if(y==2)
    {
        st_writeCmd((0x88+x));
    }
    if(y==3)
    {
        st_writeCmd((0x98+x));
    }
    while(*p!=0)
    {
        st_writeDat(*p++);
    }
EA=1;
}

void st_setDraw(void)
{
    EA=0;
st_writeCmd(ST_CLEAR);
    //清屏
    delay_ms(2);//Delay(20);
    //延时
    st_writeCmd(ST_FUN_8_G);
    //8BIT控制界面,扩充指令集,,绘图显示ON
    delay_us(1);//Delay(20);
    //延时
    //st_drawRectangle(0,0,127,63,32,0);
    //add by july
EA=1;
}
void st_setChar(void)
{
    EA=0;
st_writeCmd(ST_FUN_8_BAS);
    //8BIT控制界面,扩充指令集,,绘图显示ON
    st_writeCmd(ST_CLEAR);
    //清屏
    delay_ms(2);//Delay(20);
    //延时
EA=1;
}

void st_drawFull(uint8 x,uint8 y,const uint8*Draw)
{
    uint8 i,j,temp_x,temp_y ;
    EA=0;
temp_x=x ;
    temp_y=y ;
    temp_x|=0x80 ;
    temp_y|=0x80 ;
    for(i=0;i<32;i++)
    {
        st_writeCmd(temp_y++);
        //设置绘图区的Y地址坐标
        //if(temp_y>0x87)temp_y=0x90;
        st_writeCmd(temp_x);
        //设置绘图区的X地址坐标
        for(j=0;j<16;j++)
        {
            st_writeDat(*Draw);
            Draw++;
        }
    }
    temp_x=x ;
    temp_y=y ;
    temp_x|=0x88 ;
    temp_y|=0x80 ;
    j=0 ;
    for(i=32;i<64;i++)
    {
        st_writeCmd(temp_y++);
        //设置绘图区的Y地址坐标
        st_writeCmd(temp_x);
        //设置绘图区的X地址坐标
        for(j=0;j<16;j++)
        {
            st_writeDat(*Draw);
            Draw++;
        }
    }
    EA=1;
}

//----------------------------------------------------add by july
void st_drawFree(uint8 x1,uint8 y1,uint8 x2,uint8 y2,const uint8 *dat)
{
    uint8 i,j,xx1,yy1,y1y2,x1x2 ;
    EA=0;
y1y2=y2-y1 ;
    x1x2=x2-x1 ;
    xx1=x1|0x80 ;
    yy1=y1|0x80 ;
    //xx20x80;
    //yy20x80;
    for(i=0;i     {
        //sendchar(i);
        if(y1++<32)
        {
            st_writeCmd(yy1++);
            st_writeCmd(xx1);
            for(j=0;j             {
                st_writeDat(*dat);
                dat++;
            }
        }
        else
        {
            st_writeCmd(yy1++-32);
            st_writeCmd(xx1+8);
            for(j=0;j             {
                st_writeDat(*dat);
                dat++;
            }
        }
    }
EA=1;
}
//--------------读显示数据-----------add by july
void st_readRam(uint8 x,uint8 y)
{
    //uint8 temp;
    EA=0;
if(y>31)
    {
        y-=32 ;
        x+=8 ;
    }
    
    st_writeCmd(y|0x80);
    st_writeCmd(x|0x80);
    
    while(st_checkBusy());
    //检测液晶内部是否忙
    DATA_PORT=0XFF ;
    st_rs=1;
    delay_us(2);//nop();
    st_rw=1;
    delay_us(2);//nop();
    //Set_input();
    //nop();
    st_e=1;
    delay_us(20);//Delay_us(20);
    //sendchar(PINA);
    st_e=0;
    delay_us(1);//nop();
    st_e=1;
    delay_us(20);//Delay_us(20);
    //sendchar(PINA);
    readdispdata[0]=ST_DATA ;
    st_e=0;
    delay_us(1);//nop();
    st_e=1;
    delay_us(20);//Delay_us(20);
    //sendchar(PINA);
    readdispdata[1]=ST_DATA ;
    st_e=0;
    delay_us(1);//nop();
    //Set_output();
EA=1;
}
//----------------写一个像素------------------------add by july
void st_drawPixel(uint8 x,uint8 y,uint8 color)
{
    uint8 realx,modx1=8,modx2=8 ;
    EA=0;
realx=x/16 ;
    //sendchar(realx);
    modx1=x%16 ;
    if(modx1>7)
    {
        modx2=modx1%8 ;
        modx1=8 ;
    }
    st_readRam(realx,y);
    if(color)
    {
        
        readdispdata[0]|=0x80>>modx1 ;
        readdispdata[1]|=0x80>>modx2 ;
        
    }
    else
    {
        readdispdata[0]&=~(0x80>>modx1);
        readdispdata[1]&=~(0x80>>modx2);
        
    }
    if(y>31)
    {
        y-=32 ;
        realx+=8 ;
    }
    
    st_writeCmd(y|0x80);
    st_writeCmd(realx|0x80);
    //sendchar(realx);
    st_writeDat(readdispdata[0]);
    st_writeDat(readdispdata[1]);
EA=1;
}
//--------------lcd clear----------------add by july
void st_clr(void)
{
    st_writeCmd(0x01);
    //清屏
    //Delay(20);    //延时
    //st_writeCmd(0x36);   //8BIT控制界面,扩充指令集,,绘图显示ON
}
//---------draw line--------------------add by july
void st_drawLevelLine(unsigned char x1,unsigned char y1,unsigned char x2,unsigned char color)
{
    unsigned char i ;
    for(i=x1;i<=x2;i++)
    {
        st_drawPixel(i,y1,color);
        
    }
}
void st_drawVerticalLine(unsigned char x1,unsigned char y1,unsigned char y2,unsigned char color)
{
    unsigned char i ;
    for(i=y1;i<=y2;i++)
    {
        st_drawPixel(x1,i,color);
        
    }
}
//-----------------draw rectangle------------------add by july
void st_drawRectangle(unsigned char lf,unsigned char tp,unsigned char rt,unsigned char bt,unsigned char w,unsigned char cl)
{
    unsigned char i ;
    for(i=0;i     {
        st_drawLevelLine(lf,tp,rt,cl);
        st_drawVerticalLine(rt,tp,bt,cl);
        st_drawLevelLine(lf,bt,rt,cl);
        st_drawVerticalLine(lf,tp,bt,cl);
        
    }
}
//---------------------------------------------

//--------------------pic.h-------------------------
code const uint8 PIC1[][16]=                  // 数据表
{
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X60,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X98,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0X04,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X02,0XF4,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0XB2,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,0X18,0X04,0XE2,0X00,
0X00,0X00,0X00,0X00,0X00,0X01,0XE0,0X00,0X1F,0XFF,0X80,0X00,0X06,0X04,0XA2,0X00,
0X00,0X00,0X00,0X00,0X00,0X0E,0X00,0X03,0XFF,0XFF,0XF8,0X00,0X07,0X82,0X94,0X00,
0X00,0X00,0X00,0X00,0X00,0XF8,0X00,0X0F,0XFF,0XFF,0XFE,0X00,0X03,0XC2,0X04,0X00,
0X00,0X00,0X00,0X00,0X07,0XC0,0X00,0X7F,0XFF,0XFF,0XFF,0X00,0X03,0XE1,0X98,0X00,
0X00,0X00,0X00,0X00,0X3F,0X00,0X01,0XFF,0XFF,0XFF,0XFF,0X00,0X07,0XF0,0X60,0X00,
0X00,0X00,0X00,0X00,0XFC,0X00,0X03,0XFF,0XFF,0XFF,0XFE,0X00,0X0F,0XF8,0X00,0X00,
0X00,0X00,0X00,0X03,0XF0,0X00,0X0F,0XFF,0XFF,0XFF,0XF8,0X00,0X3F,0XF8,0X00,0X00,
0X00,0X00,0X00,0X0F,0XE0,0X00,0X1F,0XFF,0XFF,0XFF,0XFC,0X00,0XFF,0XF8,0X00,0X00,
0X00,0X00,0X00,0X3F,0XC0,0X00,0X1F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,
0X00,0X00,0X00,0XFF,0X80,0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,
0X00,0X00,0X01,0XFF,0X00,0X00,0X3F,0XF8,0X00,0X00,0X03,0XFF,0XFF,0XF0,0X00,0X00,
0X00,0X00,0X03,0XFF,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X3F,0XFF,0XF0,0X00,0X00,
0X00,0X00,0X0F,0XFF,0X00,0X00,0X0E,0X00,0X00,0X00,0X00,0X07,0XFF,0XE0,0X00,0X00,
0X00,0X00,0X1F,0XFF,0X00,0X00,0X03,0XF0,0XE0,0X00,0X00,0X03,0XFF,0XE0,0X00,0X00,
0X00,0X00,0X3F,0XFF,0X80,0X00,0X00,0X3F,0XFF,0X00,0X00,0X01,0XFF,0X80,0X00,0X00,
0X00,0X00,0X7F,0XFF,0XC0,0X00,0X00,0X00,0X01,0XC0,0X00,0X01,0XFF,0X00,0X00,0X00,
0X00,0X00,0X7F,0XFF,0XF0,0X00,0X00,0X00,0X00,0XF0,0X00,0X00,0XFE,0X00,0X00,0X00,
0X00,0X00,0XFF,0XFF,0XFE,0X00,0X00,0X00,0X0F,0XF8,0X00,0X01,0XFC,0X00,0X00,0X00,
0X00,0X00,0XFF,0XFF,0XFF,0XFB,0X00,0X0F,0XFF,0XF8,0X00,0X01,0XF0,0X00,0X00,0X00,
0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X03,0XC0,0X00,0X00,0X00,
0X00,0X00,0XFF,0XFF,0X03,0XFF,0XFF,0XFF,0XFF,0XF0,0X00,0X07,0X80,0X00,0X00,0X00,
0X00,0X00,0XFF,0XFC,0X00,0X7F,0XFF,0XFF,0XFF,0XE0,0X00,0X1C,0X00,0X00,0X00,0X00,
0X00,0X00,0X7F,0XF8,0X00,0XFF,0XFF,0XFF,0XFF,0XC0,0X00,0X30,0X00,0X00,0X00,0X00,
0X00,0X00,0X7F,0XE0,0X00,0XFF,0XFF,0XFF,0XFF,0X00,0X00,0XC0,0X00,0X00,0X00,0X00,
0X00,0X00,0X3F,0XC0,0X00,0XFF,0XFF,0XFF,0XFC,0X00,0X03,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X1F,0XC0,0X00,0X7F,0XFF,0XFF,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X0F,0XC0,0X00,0X1F,0XFF,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X07,0XC0,0X00,0X00,0XFF,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1E,0X06,0X04,0X02,0X03,0XC1,0XC0,0X48,0X00,0X20,0X0C,0X07,0X83,0XC0,0X00,
0X00,0X1A,0X06,0X04,0X02,0X06,0XC3,0X40,0X48,0X00,0X20,0X0C,0X04,0X86,0XC0,0X00,
0X00,0X18,0X02,0X04,0X02,0X06,0X03,0X40,0X68,0X00,0X20,0X0C,0X04,0X86,0X00,0X00,
0X00,0X18,0X02,0X04,0X02,0X02,0X01,0X40,0X68,0X00,0X20,0X0C,0X04,0X82,0X00,0X00,
0X00,0X08,0X02,0X04,0X02,0X06,0X03,0X40,0X68,0X00,0X20,0X0C,0X04,0X83,0X00,0X00,
0X00,0X04,0X02,0X04,0X02,0X02,0X03,0X40,0X78,0X00,0X20,0X14,0X07,0X01,0X80,0X00,
0X00,0X02,0X02,0X04,0X02,0X02,0X01,0X40,0X58,0X00,0X20,0X14,0X04,0X80,0X80,0X00,
0X00,0X02,0X02,0X04,0X02,0X06,0X01,0X40,0X58,0X00,0X20,0X16,0X04,0X80,0XC0,0X00,
0X00,0X02,0X02,0X04,0X02,0X02,0X03,0X40,0X58,0X00,0X20,0X1E,0X04,0X80,0XC0,0X00,
0X00,0X1A,0X02,0X04,0X02,0X06,0XC3,0X40,0X58,0X00,0X20,0X12,0X04,0X86,0XC0,0X00,
0X00,0X1A,0X02,0X06,0X02,0X02,0XC1,0X40,0X58,0X00,0X30,0X12,0X05,0X82,0XC0,0X00,
0X00,0X0E,0X02,0X07,0X02,0X03,0X81,0XC0,0X48,0X00,0X38,0X32,0X07,0X83,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,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,  
};
//---------------------------------------------

关键字:LCD12864  ST7920  C8051 引用地址:LCD12864(ST7920)的C8051驱动(并行)

上一篇:LCD1602的C8051驱动
下一篇:KEIL C51的#pragma NOIV

推荐阅读最新更新时间:2024-03-16 14:43

基于ATmega128的迷你数控雕刻机系统设计
为了实现对迷你数控雕刻机的控制,提出了一种基于ATmega128的迷你数控雕刻机系统设计方案,并完成系统了的硬件电路设计和软件设计。该系统的硬件电路设计部分主要是电源电压转换电路以及以ATmega128单片机为主控芯片的控制主板与各模块相连电路;软件设计部分主要是利用AVR Studio开发环境编程,实现ATmega128单片机对步进电机、主轴电机、超声波传感器等部件的控制以及实现与PC机握手。重点设计了利用键盘操作板对雕刻头的初步定位系统。实际应用表明,该系统具有操作简便、安全可靠等特点,达到了设计要求。 随着艺术模型、机械加工、工装模具等产业的飞速发展,对加工设备提出的要求越来越高,雕刻机作为上述产业的重要组成部分也发生了快速
[单片机]
基于ATmega128的迷你数控雕刻机系统设计
【51单片机快速入门指南】6.2:SPI 、八线、四线控制 LCD12864 屏幕及Proteus的仿真
普中51-单核-A2 STC89C52 Windows 10 20H2 Proteus 8 Frofessional v8.9 SP2 Keil uVision V5.29.0.0 PK51 Prof.Developers Kit Version:9.60.0.0 移植自发布一个ST7920的LCD12864 Proteus仿真模型,支持串口和4bit模式通讯 —— cdhigh 参考资料:《LCD12864液晶显示模块数据手册(带字库)》 硬知识 LCD12864简介 LCD12864液晶屏,背面3个COB牛屎堆,一个主控芯片ST7920,另外两个是移位芯片ST7921. 主控芯片ST7920的
[单片机]
【51单片机快速入门指南】6.2:SPI 、八线、四线控制 <font color='red'>LCD12864</font> 屏幕及Proteus的仿真
LCD12864 驱动 ,采用串行方式
/******************************************** file&: lcd.h Description: LCD12864 驱动 ,采用串行方式, Author: kassey@126.com July,22th,2005 ********************************************/ #i nclude reg52.h #i nclude intrins.h sbit SCLK =P1^3 //E sbit SID =P1^4; //RW sbit RST =P1^2; // low active 可以不用,也就是说,只用两条线和LCD通信 #define
[单片机]
单片机+lcd12864液晶万年历C程序
这个是主界面 这个是主菜单界面 这个是设置时间的子界面 这个是设置日期 设置背景光 这是设置了按键音和闹铃以后,主界面出现状态 标志 闹铃的界面,喇叭出现铃声。 生日倒计时提醒功能。 全部完整的源代码下载: http://www.51hei.com/bbs/dpj-20391-1.html 下面是12864.h文件:/*------------------------------------ 名称:LCD9012驱动模块 编写:YuMin_Dong 时间:2013.01.21 -----------------------
[单片机]
单片机+<font color='red'>lcd12864</font>液晶万年历C程序
基于51单片机电子万年历设计 lcd12864+24c02+ds1302
作品名称:基于51单片机电子万年历设计 作评功能:1:实现ds1302的读写 2:lcd12864的显示 3:24c02的读写 4:更改日期,时间 5:整点报时,闹钟的功能 6:阴阳历的转换 硬件部分:普中开发板(程序内明确标明接线方式) 软件部分:原创 1:代码规范:易于更改 2:封装良好,可以直接移植。 单片机源程序如下: #include reg51.h //此文件中定义了单片机的一些特殊功能寄存器 #include lcd12864.h #include ds1302.h #include 24c
[单片机]
基于51单片机电子万年历设计 <font color='red'>lcd12864</font>+24c02+ds1302
浅谈C8051单片机在变风量空调控制系统中的应用
1、前言:   变风量(Variable Air Volume, 简称VAV)空调系统是通过变风量箱去调节送入房间的风量和新回风混合比,并相应调节空调机组的风量或新回风混合比来控制某一空调区域温度的一种空调系统。变风量空调系统可以根据空调载荷的变化及室内要求参数的改变,自动调节空调送风量(达到最小送风量时调节送风温度),以满足室内人员的舒适要求或者其它的工艺要求。同时根据实际送风量自动调节送风机的转速,最大限度的减少风机动力、节约能量。与定风量空调系统相比,变风量空调系统具有节能性、舒适性、环保性、灵活性等优点。 2、硬件电路设计   2.1、风阀与水阀执行电路的设计   本控制器将温度、湿度、CO2传感器检测到的模拟信号
[单片机]
浅谈<font color='red'>C8051</font>单片机在变风量空调控制系统中的应用
STM8控制LCD12864液晶屏实验
第一部分 并口传输显示中英文 主要是以下几个函数: 首先:写一个LCD_write函数来给LCD发送数据.根据时序图,发送数据是RW要置0,E要产生下降沿,RS置1为数据,RS置0为命令,由于是并口传输PSB置1. 其次:能够给LCD发命令后,我们就要使用LCD_init函数发送初始化命令。初始化命令至少包括:1、设置显示,2、功能设定,3、初始化清屏3个部分。 写命令时注意每个命令都有自己的运行时间,记得保证足够延时。 第三:写一个LCD_display函数可以分行分列显示内容。 void LCD_write(u8 data,u8 cmd_flag); void LCD_init(void); void LCD_
[单片机]
STM8控制<font color='red'>LCD12864</font>液晶屏实验
C8051 F12X中多bank的分区跳转处理
在8051核单片机庞大的家族中,C8051F系列作为其中的后起之秀,是目前功能最全、速度最快的8051衍生单片机之一,正得到越来越广泛的应用。它集成了嵌入式系统的许多先进技术,有丰富的模拟和数字资源.是一个完全意义上的SoC产品。 C805IFl2X作为该系列中的高端部分,具有最快100MIPS的峰值速度,集成了最多的片上资源。其128 KB的片上Flash和8 KB的片上RAM足以满足绝大多数应用的需求。使用C8051F12X,只需外加为数不多的驱动和接口,就可构成较大型的完整系统。只是其中128 KB的Flash存储器不可避免地要处理bank分区问题。 幸运的是Keil C51开发环境对C8051F系列有良好的支持,包括一般的跨
[单片机]
小广播
添点儿料...
无论热点新闻、行业分析、技术干货……
设计资源 培训 开发板 精华推荐

最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

换一换 更多 相关热搜器件
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved