MSP-EXP430F5529实验板液晶显示汉字现乱码
具体情况:使用查码显示汉字的方式,自建了一个汉字表,然后查码输出汉字。我依次单个单个显示的,在显示第一个汉字时,老是不清楚,有额外的像素点在这个汉字的周围,从第二个字开始就好了,液晶上看到的汉字没有多余的像素点了,但是如果后面显示的是和第一个字相同的汉字,则它也是乱码,不知道这是什么原因啊
例如:
Dogs102x6_chinesecharDrawXY(101,63,"电",0); //第一个汉字是乱码
Dogs102x6_chinesecharDrawXY(10,0,"电",0); //和第一个汉字相同,也是乱码。如果上面那个显示的不是"电",这个显示的也正常
Dogs102x6_chinesecharDrawXY(23,0,"子",0); //后面开始正常了
Dogs102x6_chinesecharDrawXY(36,0,"工",0); //
Dogs102x6_chinesecharDrawXY(49,0,"程",0); //
Dogs102x6_chinesecharDrawXY(62,0,"世",0); //
Dogs102x6_chinesecharDrawXY(75,0,"界",0); //
显示汉字的函数:
void Dogs102x6_chinesecharDrawXY(uint8_t x, uint8_t y, char *cchar, uint8_t style)
{
uint8_t k;
for (k = 0; k < GB_12_num; k ++)
{
if ((GB_12[k].Index[0] == *cchar) && (GB_12[k].Index[1] == *(cchar + 1)))
{
Dogs102x6_Font12x12DrawXY(x,y,GB_12[k].Msk,style); //参照实验板提供的液晶驱动程序改写的
}
}
}
//汉字字模的数据结构定义
typedef struct typFNT_GB12 // 汉字字模数据结构
{
char Index[2]; // 汉字内码索引
uint16_t Msk[24]; // 点阵码数据
}GB12;
// 汉字字模表
// 汉字库: 宋体12.dot 纵向取模上高位,数据排列:从左到右从上到下
const struct typFNT_GB12 GB_12[] = // 数据表
{
"我", 0x11,0x51,0x52,0xFF,0x92,0x10,0x10,0xFF,0x11,0x52,0x34,0x10,
0x00,0x20,0x10,0xF0,0x00,0x20,0x40,0x80,0x40,0x20,0x10,0x70,
"爱", 0x02,0x4C,0x6A,0x5A,0x4B,0x6E,0x5A,0x8A,0x9B,0xAA,0x0E,0x0A,
0x10,0x20,0x50,0x90,0x20,0xA0,0x40,0xA0,0x20,0x10,0x10,0x10,
"电", 0x00,0x3F,0x24,0x24,0x24,0xFF,0x24,0x24,0x24,0x7F,0x20,0x00,
0x00,0x80,0x80,0x80,0x80,0xE0,0x90,0x90,0x90,0x90,0x10,0x70,
"子", 0x00,0x04,0x84,0x84,0x84,0x84,0x9F,0xA4,0xC4,0x84,0x0C,0x04,
0x00,0x00,0x00,0x20,0x10,0x10,0xF0,0x00,0x00,0x00,0x00,0x00,
"工", 0x00,0x40,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0xC0,0x40,0x00,
0x20,0x20,0x20,0x20,0x20,0xE0,0x20,0x20,0x20,0x20,0x60,0x20,
"程", 0x51,0x56,0x7F,0x92,0x91,0x04,0xF4,0x94,0x97,0x94,0xF4,0x04,
0x80,0x00,0xF0,0x00,0x10,0x10,0x90,0x90,0xF0,0x90,0xB0,0x10,
"世", 0x08,0x08,0x7F,0x08,0x08,0xFF,0x08,0x08,0x08,0xFF,0x08,0x08,
0x00,0x00,0xF0,0x10,0x10,0xD0,0x90,0x90,0x90,0xD0,0x10,0x10,
"界", 0x00,0x00,0xF9,0xA9,0xAB,0xFC,0xAA,0xAA,0xA9,0xF9,0x01,0x01,
0x80,0x90,0x10,0x20,0xC0,0x00,0x00,0xF0,0x00,0x00,0x80,0x00,
};
感觉第一个查得有问题,但不知道是什么问题,大家有遇到个这种情况的吗,是什么原因啊
此帖出自
小平头技术问答
一周热门 更多>