全文预览

基于MSP430G2553的简易信号发生器

上传者:蓝天 |  格式:doc  |  页数:17 |  大小:962KB

文档介绍
1,107,103,99,95,92,88,84,80,77,73,69,66,62,59,56,52,49,46,43,40,37,34,32,29,27,24,22,20,18,16,14,12,10,9,8,6,5,4,3,2,2,1,1,0,0,0,0,0,1,1,2,2,3,4,5,6,8,9,10,12,14,16,18,20,22,24,27,29,32,34,37,40,43,46,49,52,56,59,62,66,69,73,77,80,84,88,92,95,99,103,107,111,115,119,123};/************************************************************名称:LCD_Write_cmd()*功能:写一个命令到LCD12864*入口参数:cmd:待写入的命令,无符号字节形式*出口参数:无*说明:写入命令时,RW=0,RS=0扩展成24位串行发送*格式:11111RW0RS0xxxx0000xxxx0000*|最高的字节|命令的bit7~4|命令的bit3~0|***********************************************************/voidwrite_cmd(ucharcmd){uchari,high4bits,low4bits;ulonglcdcmd;high4bits=cmd&0xf0;low4bits=cmd&0x0f;lcdcmd=((ulong)0xf8<<16)+((ulong)high4bits<<8)+((ulong)low4bits<<4);CS_1;SCLK_0;for(i=0;i<24;i++){SID_0;if(lcdcmd&0x00800000)SID_1;lcdcmd<<=1;delay_ms(1);

收藏

分享

举报
下载此文档