资源描述:
《msp430单片机1602显示》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、/****************POWSOS__430************************程序功能:静态显示各种字符----------------------------------------------------测试说明:观察液晶显示****************************************************/#include#include"Cry1602.h"#include"Cry1602.c"ucharshuzi[]={"0123
2、456789"};ucharzimu1[]={"abcdefghigklmnopqrstuvwxyz"};ucharzimu2[]={"ABCDEFGHIGKLMNOPQRSTUVWXYZ"};uchar*fuhao="~`!@#$%^&*()_+-=/
3、,.、;'<>?:""";uchar*jieshu="Thisistheend!";/***********************主函数************************/voidmain(void){/*下面六行程序关闭所有的IO口*/P
4、1DIR=0XFF;P1OUT=0XFF;P2DIR=0XFF;P2OUT=0XFF;P3DIR=0XFF;P3OUT=0XFF;P4DIR=0XFF;P4OUT=0XFF;P5DIR=0XFF;P5OUT=0XFF;P6DIR=0XFF;P6OUT=0XFF;uchari;otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitt
5、eeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitte
6、eSecretaryandrecorderoftheCountypartyCommitteeSecretary,MinistersandWDTCTL=WDT_ADLY_1000;//间隔定时器,定时1000msP6DIR
7、=BIT2;P6OUT
8、=BIT2;//关闭电平转换LcdReset();DispNChar(3,0,10,shuzi);//延时2sfor(i=0;i<3;i++){IFG1&=~WDTIFG;while(!(IFG1&WDTIFG));IFG1&=~WDTIFG;}LcdWriteCo
9、mmand(0x01,1);//清除显示DispNChar(0,0,26,zimu1);//延时2sfor(i=0;i<3;i++){IFG1&=~WDTIFG;while(!(IFG1&WDTIFG));IFG1&=~WDTIFG;}LcdWriteCommand(0x01,1);//清除显示DispNChar(0,0,26,zimu2);//延时2sfor(i=0;i<3;i++){otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJia
10、ngxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,S
11、henmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,MinistersandIFG1&=~WDTIFG;while(!(IFG1&WDTIFG));IFG1&=~WDTIFG;}LcdWriteCommand(0x01,1);//清除显示Di