仿真生成文字
先看看效果吧
字符点阵生成
利用PCtoLCD2002工具生成,输入中秋节快乐
生成字模,保存。
修改字模
打开生成的字模.txt文件如下:
- 需要删除0x字符,并且合并两项;
- 删除
中(0) 秋(1) 节(2) 快(3) 乐(4)
等信息;
中(0) 秋(1) 节(2) 快(3) 乐(4)
{0x00,0x00,0x00,0x00,0x0F,0xF0,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0xFF,0xFF},
{0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x0F,0xF0,0x00,0x00,0x00,0x00,0x00,0x00},/*"中",0*/
{0x24,0x10,0x24,0x60,0x25,0x80,0x7F,0xFF,0xC4,0x80,0x44,0x61,0x01,0x02,0x0E,0x0C},
{0x00,0x70,0xFF,0x80,0x00,0x60,0x01,0x18,0x02,0x04,0x0C,0x02,0x00,0x01,0x00,0x00},/*"秋",1*/
{0x20,0x00,0x22,0x00,0x22,0x00,0x22,0x00,0xFA,0x00,0x22,0x00,0x23,0xFF,0x22,0x00},
{0x22,0x00,0x22,0x10,0xFA,0x08,0x22,0x10,0x23,0xE0,0x20,0x00,0x20,0x00,0x00,0x00},/*"节",2*/
{0x00,0x80,0x07,0x00,0x00,0x00,0xFF,0xFF,0x08,0x00,0x04,0x81,0x10,0x82,0x10,0x8C},
{0x10,0xB0,0xFF,0xC0,0x10,0xB0,0x10,0x8C,0x1F,0x82,0x00,0x81,0x00,0x81,0x00,0x00},/*"快",3*/
{0x00,0x00,0x00,0x04,0x07,0x08,0x39,0x10,0x21,0x60,0x21,0x02,0x21,0x01,0x2F,0xFE},
{0x41,0x00,0x41,0x00,0xC1,0x40,0x41,0x20,0x01,0x10,0x01,0x0C,0x00,0x00,0x00,0x00},/*"乐",4*/
修改后的txt文件:
代码语言:javascript复制0000
0000
0FF0
0820
0820
0820
0820
FFFF
0820
0820
0820
0820
0FF0
0000
0000
0000
2410
2460
2580
7FFF
C480
4461
0102
0E0C
0070
FF80
0060
0118
0204
0C02
0001
0000
2000
2200
2200
2200
FA00
2200
23FF
2200
2200
2210
FA08
2210
23E0
2000
2000
0000
0080
0700
0000
FFFF
0800
0481
1082
108C
10B0
FFC0
10B0
108C
1F82
0081
0081
0000
0000
0004
0708
3910
2160
2102
2101
2FFE
4100
4100
C140
4120
0110
010C
0000
0000
readmemh读取
在code中读取.txt文件
代码语言:javascript复制initial begin
$readmemh("C:/Users/Dell/Desktop/my_char_display/char_display/中秋节快乐.txt",memory);
end
仿真效果
源码获取
https://github.com/shuiqzhang/char_display