打印

LaunchPad实验四——12864并行显示

[复制链接]
5993|30
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
nwx8899|  楼主 | 2012-6-27 21:38 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 nwx8899 于 2012-7-21 14:30 编辑

1 液晶介绍

2 电路连接

3 取字模

3 project

4 效果预览





5 源代码
/***********************************************
**** LAUNCH PAD 学习之LCD 12864***
**** MCU: MSP430 ***
**** 作者: nwx***
**** ***
**** ***
**** 实验现象:LCD显示 LOG ***
**** *** 2012.6.27
****P1.0~P1.7 数据口 P2.0 P2.1 P2.2 en rs Psb***
***********************************************/
#include <msp430g2452.h>
#define uchar unsigned char
#define uint unsigned int
#define BUTTON BIT3 //P1.3为板上按键S2


const uchar table[]="欢迎参加TI在线培训!";
const uchar table1[]="LaunchPad ";
const uchar table2[]=" 点火开始!";
uchar num;
void delay_1ms(void)
{
uint i;
for (i=0;i<1140;i++);
}

/*-- 调入了一幅图像:C:\Users\Administrator\Desktop\launchpad.bmp --*/
/*-- 宽度x高度=128x64 --*/
const uchar image[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x03,0xFF,0xFE,0x7F,0xFF,
0x01,0xF8,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x3F,0xFF,0xE3,0xFF,0xFE,0x7F,0xFF,
0x07,0xFF,0x00,0x07,0xC7,0xF8,0x0F,0xFF,0x00,0x38,0x70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F,0xFF,0x87,0x8F,0xFF,0x8F,0xF0,0x3E,0x1C,0x0F,
0x7F,0xFF,0xC0,0x3F,0xC7,0xF8,0x0F,0xFF,0x03,0x87,0xFF,0xC7,0xE0,0x3C,0x18,0x0F,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x01,0xFF,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}; //第一幅图像数据
const uchar image1[]=
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,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,0xFF,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0x87,0xFE,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xF0,0x00,0x0E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x80,0x1F,0xFF,0xF0,0x00,0x06,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE1,0xF0,0xFF,0xFF,0xF0,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x3F,0xFF,0xFF,0xF8,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x1F,0xEF,0xFF,0xF8,0x00,0x06,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x7F,0x07,0xFF,0xFC,0x00,0x0E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x01,0xF8,0x03,0xFF,0xFC,0x00,0x0E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF8,0x03,0xE0,0x03,0xFF,0xFE,0x00,0x3C,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x1C,0x0F,0x80,0x01,0xFF,0xFE,0x00,0x78,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x3E,0x00,0x01,0xFF,0xFE,0x00,0xF0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x7C,0x00,0x00,0xFF,0xFE,0x03,0xE0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x00,0x00,0xFF,0xFE,0x07,0xC0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x03,0xC0,0xFF,0xFE,0x1F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x03,0x80,0x0F,0xE0,0x7F,0xFF,0x7E,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xC0,0x03,0x00,0xFF,0xE0,0x7F,0xFF,0xF8,0x00,
0x00,0x00,0x00,0x00,0x03,0xFE,0x00,0x00,0x01,0x03,0xFF,0xC0,0x7F,0xFF,0xE0,0x00,
0x00,0x00,0x00,0x00,0x1F,0xC0,0x00,0x00,0x41,0x9F,0xFC,0x00,0x7F,0xFF,0x80,0x00,
0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0x1F,0xC1,0xFF,0xE0,0x00,0x7F,0xFF,0x00,0x00,
0x00,0x00,0x00,0x03,0xE0,0x00,0x03,0xFE,0x07,0xFE,0x00,0x00,0x7F,0xF8,0x00,0x00,
0x00,0x00,0x00,0x0F,0x00,0x00,0xFF,0xC0,0x3F,0xF0,0x00,0x00,0x7F,0xE0,0x00,0x00,
0x00,0x00,0x00,0x3C,0x00,0x07,0xF8,0x00,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00,0x00,
0x00,0x00,0x00,0xF0,0x00,0x7E,0x00,0x01,0xF0,0xC0,0x00,0x1F,0xFC,0x00,0x00,0x00,
0x00,0x00,0x03,0x80,0x03,0xF0,0x00,0x01,0x80,0x40,0x03,0xFF,0xE0,0x00,0x00,0x00,
0x00,0x00,0x0E,0x00,0x1F,0x80,0x00,0x00,0x00,0x7F,0xFF,0xFE,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x00,0x7C,0x00,0x00,0x00,0x00,0x7F,0xFF,0xF0,0x00,0x00,0x00,0x00,
0x00,0x00,0x70,0x01,0xE0,0x00,0x00,0x0C,0x00,0x3F,0xF8,0x60,0x00,0x00,0x00,0x00,
0x00,0x01,0xE0,0x07,0x80,0x00,0x00,0x38,0x00,0x30,0x00,0xC0,0x00,0x00,0x00,0x00,
0x00,0x03,0x80,0x3C,0x00,0x00,0x00,0xF0,0x38,0x30,0x01,0xC0,0x00,0x00,0x00,0x00,
0x00,0x0E,0x00,0x70,0x00,0x00,0x01,0xC0,0x70,0x30,0x03,0x80,0x00,0x00,0x00,0x00,
0x00,0x1C,0x01,0xC0,0x00,0x00,0x07,0x00,0xE0,0x30,0x07,0x00,0x00,0x00,0x00,0x00,
0x00,0x70,0x07,0x00,0x00,0x00,0x1C,0x01,0x80,0x60,0x1E,0x00,0x00,0x00,0x00,0x00,
0x00,0xE0,0x0C,0x00,0x00,0x00,0xF8,0x03,0x00,0xE0,0x78,0x00,0x00,0x00,0x00,0x00,
0x03,0x80,0x38,0x00,0x00,0x01,0xC0,0x0E,0x01,0xC1,0xE0,0x00,0x00,0x00,0x00,0x00,
0x07,0x00,0xF0,0x00,0x00,0x0F,0x00,0x1C,0x07,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,
0x0E,0x01,0xC0,0x00,0x00,0xFC,0x00,0x70,0x1F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x18,0x01,0x00,0x00,0x0F,0xE0,0x01,0xE0,0x3F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,
0x70,0x00,0x00,0x01,0xFE,0x00,0x03,0x80,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xE0,0x00,0x00,0x03,0xE0,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xC0,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x18,0x00,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0xF8,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xF0,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xE0,0x00,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xC0,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0x80,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0xFF,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,

}; //第二幅图像数据

/*****************************************
*
* N ms延时函数
*
****************************************/
void delay_nms(uint n)
{
uint i=0;
for (i=0;i<n;i++)
delay_1ms();
}


void write_com(uint com)
{
//lcdrs = 0;
P2OUT&= 0xfd; //P2.1 RS =0
P1OUT = com;
delay_nms(5);
//lcden = 1;
P2OUT|= 0x01;
delay_nms(5);
P2OUT&= 0xfe;
}

void write_dat(uint dat)
{
//lcdrs = 1;
P2OUT |= 0x02;
P1OUT = dat;
delay_nms(5);
//lcden=1;
P2OUT|= 0x01;
delay_nms(5);
// lcden=0;
P2OUT&= 0xfe;

}
void disp_str(uchar addr,const uchar *pt,uchar num)
{
uchar i;
write_com(addr);
for(i=0;i<(num*2);i++)
write_dat(*(pt++));
}
void init()
{
//PSB=1;//并口模式
P2OUT |= BIT2;
delay_nms(15);
//EN=0;
P2OUT&= 0xfe;
delay_nms(5);
write_com(0x30);
delay_nms(1);
write_com(0x08);//清屏
delay_nms(1);
write_com(0x0c);//开显示,关光标
delay_nms(1);
write_com(0x01);
delay_nms(1);
write_com(0x06);//第一行显示位置
delay_nms(1);
}

void lcd12864_image(const uchar *p)
{
int x,y;
write_com(0x34); //扩展指令集动作,绘图显示OFF
for (y=0;y<32;y++) //送上半屏显示数据
{
write_com(0x80|y); //送显示Y坐标0x80-0x9f
write_com(0x80); //送显示X坐标0x80
for (x=0;x<16;x++)
{
write_dat(*p);
p++;
}
}

for (y=0;y<32;y++) //送下半屏显示数据
{
write_com(0x80|y); //送显示Y坐标0x80-0x9f
write_com(0x88); //送显示X坐标0x88
for (x=0;x<16;x++)
{
write_dat(*p);
p++;
}
}
write_com(0x36); //扩展指令集动作,绘图显示ON
}
void displayfirst()//显示第一个界面
{
write_com(0x01); //清除显示(清零DDRAM)


disp_str(0x98,table,18);
lcd12864_image(image);//送图像显示数据
delay_nms(5000);

}
void displaysecond()//显示第二个界面
{
write_com(0x01); //清除显示(清零DDRAM)

disp_str(0x80,table1,18);
disp_str(0x98,table2,18);
lcd12864_image(image1);//送图像显示数据
delay_nms(5000);
}

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1DIR |= 0xff; // P1.2 output
P2DIR |= 0xff;
init();
while(1)
{
if(BUTTON==0x00)

{displayfirst();}
else
{displaysecond();}
}

}

IMG_20120627_161428.jpg (1.55 MB )

IMG_20120627_161428.jpg

IMG_20120627_163013.jpg (1.42 MB )

IMG_20120627_163013.jpg

12863-3.jpg (24.95 KB )

12863-3.jpg

相关帖子

沙发
821081701| | 2012-6-28 09:28 | 只看该作者
不错,这个要顶!

使用特权

评论回复
板凳
gaoyang9992006| | 2012-6-28 10:29 | 只看该作者
不错,顶一个

使用特权

评论回复
地板
shenmulzb1985| | 2012-6-28 11:52 | 只看该作者
很给力的啊,顶了

使用特权

评论回复
5
joing1999| | 2012-6-30 10:50 | 只看该作者
我有全套液晶代码……

使用特权

评论回复
6
tianm| | 2012-6-30 11:26 | 只看该作者
我有全套液晶代码……
joing1999 发表于 2012-6-30 10:50


全套啊:L

使用特权

评论回复
7
ouyangliic| | 2012-7-1 15:55 | 只看该作者
mark

使用特权

评论回复
8
kuki0702| | 2012-7-2 16:07 | 只看该作者
真不错,赞一个

使用特权

评论回复
9
cgd| | 2012-7-2 16:29 | 只看该作者
顶一个!!

使用特权

评论回复
10
tuotuotuo| | 2012-7-7 16:29 | 只看该作者
我下到板子上为什么,没显示呢?

使用特权

评论回复
11
nwx8899|  楼主 | 2012-7-7 17:03 | 只看该作者
10# tuotuotuo
?

什么型号

使用特权

评论回复
12
益友电子| | 2012-7-7 17:14 | 只看该作者
好东西,感谢分享资料了!

使用特权

评论回复
13
yytpy2008| | 2012-7-13 18:44 | 只看该作者
430不是3.3V供电吗?为什么这个LCD是5V的呢

使用特权

评论回复
14
魑魅2001| | 2012-7-20 20:19 | 只看该作者
代码的子函数少,试试看

使用特权

评论回复
15
天涯小小| | 2012-7-21 10:58 | 只看该作者
这也能算酷,21ic现在怎么了?

使用特权

评论回复
16
nwx8899|  楼主 | 2012-7-21 14:14 | 只看该作者
17# 天涯小小
管理员给个鼓励而已
大侠别在意啊

使用特权

评论回复
17
lws5678| | 2012-8-10 16:31 | 只看该作者
不错,很给力!

使用特权

评论回复
18
逆光漂泊| | 2012-8-11 10:04 | 只看该作者
好东东

使用特权

评论回复
19
ZG11211| | 2012-10-23 17:00 | 只看该作者
我超级郁闷,第一次上手12864就遇到COG的,指令和扫描方式都和网上常见的不同,

使用特权

评论回复
20
angerbird| | 2012-10-23 17:48 | 只看该作者
很很不错的,我也顶一下了啊

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名: 宁静致远

61

主题

805

帖子

2

粉丝