#includemsp430x14x.h#defineCPU_F((double)1000000)#definedelay_us(x)__delay_cycles((long)(CPU_F*(double)x/1000000.0))#definedelay_ms(x)__delay_cycles((long)(CPU_F*(double)x/1000.0))#defineres1P4OUT|=BIT6;//复位,0复位#defineres0P4OUT&=~BIT6;#definesce1P4OUT|=BIT5;//片选#definesce0P4OUT&=~BIT5;//片选#definedc1P4OUT|=BIT4;//1写数据,0写指令#definedc0P4OUT&=~BIT4;#definesdin1P4OUT|=BIT3;//数据#definesdin0P4OUT&=~BIT3;#definesclk1P4OUT|=BIT2;//时钟#definesclk0P4OUT&=~BIT2;unsignedcharzimu[]={/*--文字:0--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0xF8,0x04,0x04,0x04,0xF8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,/*--文字:1--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x00,0x08,0xFC,0x00,0x00,0x00,0x00,0x02,0x03,0x02,0x00,0x00,/*--文字:2--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x18,0x84,0x44,0x24,0x18,0x00,0x03,0x02,0x02,0x02,0x02,0x00,/*--文字:3--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x08,0x04,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,/*--文字:4--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x40,0xB0,0x88,0xFC,0x80,0x00,0x00,0x00,0x00,0x03,0x02,0x00,/*--文字:5--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x3C,0x24,0x24,0x24,0xC4,0x00,0x01,0x02,0x02,0x02,0x01,0x00,/*--文字:6--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0xF8,0x24,0x24,0x2C,0xC0,0x00,0x01,0x02,0x02,0x02,0x01,0x00,/*--文字:7--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x0C,0x04,0xE4,0x1C,0x04,0x00,0x00,0x00,0x03,0x00,0x00,0x00,/*--文字:8--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0xD8,0x24,0x24,0x24,0xD8,0x00,0x01,0x02,0x02,0x02,0x01,0x00,/*--文字:9--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x38,0x44,0x44,0x44,0xF8,0x00,0x00,0x03,0x02,0x02,0x01,0x00,/*--文字::--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:.--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0x00,0x00,0x1C,0x22,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=6x12--*//*--高度不是8的倍数,现调整为:宽度x高度=6x16--*/0xC0,0x20,0x20,0x40,0x00,0x00,0x03,0x04,0x04,0x02,0x00,0x00,};unsignedcharmaohao[]={/*--文字::--*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00};unsignedcharjiaohao[]={/*--文字:+---48*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00,/*--文字:+--49*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:---50*//*--宋体12;此字体下对应的点阵为:宽x高=8x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00};unsignedcharhanzi[]={/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*--文字:欢--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x0A,0x32,0xC2,0x32,0x1E,0x08,0x07,0xE4,0x04,0x14,0x0C,0x00,0x04,0x03,0x00,0x03,0x08,0x04,0x03,0x00,0x03,0x04,0x08,0x00,/*--文字:迎--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x11,0xF2,0x00,0xFE,0x82,0x41,0x00,0xFE,0x02,0x02,0xFE,0x00,0x08,0x07,0x08,0x09,0x08,0x08,0x08,0x0F,0x08,0x09,0x09,0x00,/*--文字:使--*//*--宋体9;此字体下对应的点阵为:宽x高=12x12--*//*--高度不是8的倍数,现调整为:宽度x高度=12x16--*/0x20,0x10,0xFC,0x03,0xF4,0x54,0x54,0xFF,0x54,0x54,0x74,0x00,0x00,0x00,0x0F,0x00,0x08,0x0