51单片机用汇编语言驱动16*16点阵显示“机电工程系”汉字

2024-12-17 12:51:12
推荐回答(4个)
回答1:

硬件线路没要求的话,简单 

;16X16LED点阵流动显示

;逐列、逆向(低位开始)扫描

ORG 0000H

AJMP MAIN

ORG 0030H

MAIN: MOV DPTR,#TAB ;字码表初址赋值

MOV R1,#00H ;列控制码

MOV R4,#96 ;移动" "及"机电工程系"6个字符,共96列

CM: MOV R5,#5 ;每屏反复显示5次

MOV R3,#16 ;列数

C1: MOV R2,#0 ;取码指针

C16: MOV P0,#00H

MOV P2,#00H ;关显示

CLR P3.0

MOV A,R2

MOVC A,@A+DPTR ;取当前列显示字码的第一个字节

MOV P0,A ;送1~8行控制口

INC R2

MOV A,R2

MOVC A,@A+DPTR ;取当前列的显示字码的第二个字节

MOV P2,A ;送9~15行控制口

INC R2

MOV P1,R1 ;送列控制码

INC R1

    ACALL D1MS ;显示2MS

ACALL D1MS

DJNZ R3,C16 ;一屏16列是否显示完

MOV R3,#16

DJNZ R5,C1 ;未显示5次,继续

INC DPTR ;一屏反复显示5次完,字码表初值加2

INC DPTR

DJNZ R4,CM ;96列未移动完,继续

AJMP MAIN ;96列移动完,返回,重新从" "开始显示

D1MS: MOV R6,#2

MOV R7,#248

DJNZ R7,$

DJNZ R6,$-4

RET

TAB:   ;(0)  (1) 机(2) 电(3) 工(4) 程(5) 系(6)

DB 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H;

DB 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H;" ",0

DB 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H;

DB 000H, 000H, 000H, 000H, 000H, 000H, 000H, 000H;" ",1

DB 000H, 008H, 040H, 00CH, 040H, 006H, 0FEH, 07FH;

DB 0FEH, 07FH, 020H, 023H, 020H, 032H, 000H, 01CH;

DB 0E0H, 00FH, 0F0H, 003H, 0D0H, 00FH, 0F0H, 01FH;

DB 030H, 010H, 000H, 010H, 000H, 01CH, 000H, 01CH;"机",2

DB 000H, 000H, 000H, 000H, 0E0H, 001H, 0E0H, 007H;

DB 020H, 007H, 020H, 005H, 0FEH, 03FH, 0FEH, 07FH;

DB 090H, 042H, 010H, 042H, 0F0H, 043H, 0F0H, 041H;

DB 000H, 040H, 000H, 078H, 000H, 038H, 000H, 000H;"电",3

DB 000H, 000H, 000H, 010H, 000H, 010H, 000H, 010H;

DB 020H, 010H, 020H, 010H, 020H, 010H, 0E0H, 01FH;

DB 0F0H, 00FH, 010H, 008H, 010H, 008H, 010H, 008H;

DB 000H, 008H, 000H, 008H, 000H, 008H, 000H, 000H;"工",4

DB 080H, 010H, 080H, 018H, 090H, 00CH, 090H, 006H;

DB 0F8H, 0FFH, 0FCH, 0FFH, 04CH, 026H, 040H, 024H;

DB 070H, 025H, 078H, 025H, 048H, 03FH, 0E8H, 03FH;

DB 0B8H, 012H, 0B8H, 012H, 000H, 010H, 000H, 010H;"程",5

DB 000H, 000H, 000H, 000H, 000H, 040H, 008H, 074H;

DB 048H, 034H, 068H, 006H, 078H, 047H, 0D8H, 0FDH;

DB 0CCH, 0FEH, 066H, 002H, 026H, 00BH, 000H, 01BH;

DB 000H, 032H, 000H, 020H, 000H, 000H, 000H, 000H;"系",6

END

回答2:

{
/* 以下是 '机' 的 16点阵宋体 字模,32 byte */
0x10,0x00,0x11,0xF0,0x11,0x10,0x11,0x10,
0xFD,0x10,0x11,0x10,0x31,0x10,0x39,0x10,
0x55,0x10,0x55,0x10,0x91,0x10,0x11,0x12,
0x11,0x12,0x12,0x12,0x12,0x0E,0x14,0x00,
};
{
/* 以下是 '电' 的 16点阵宋体 字模,32 byte */
0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,
0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,
0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,
0x21,0x0A,0x01,0x02,0x01,0x02,0x00,0xFE,
};
{
/* 以下是 '工' 的 16点阵宋体 字模,32 byte */
0x00,0x00,0x00,0x00,0x7F,0xFC,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
0x01,0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,
};
{
/* 以下是 '程' 的 16点阵宋体 字模,32 byte */
0x08,0x00,0x1D,0xFC,0xF1,0x04,0x11,0x04,
0x11,0x04,0xFD,0xFC,0x10,0x00,0x30,0x00,
0x39,0xFE,0x54,0x20,0x54,0x20,0x91,0xFC,
0x10,0x20,0x10,0x20,0x13,0xFE,0x10,0x00,
};
{
/* 以下是 '系' 的 16点阵宋体 字模,32 byte */
0x00,0xF8,0x3F,0x00,0x04,0x00,0x08,0x20,
0x10,0x40,0x3F,0x80,0x01,0x00,0x06,0x10,
0x18,0x08,0x7F,0xFC,0x01,0x04,0x09,0x20,
0x11,0x10,0x21,0x08,0x45,0x04,0x02,0x00,
};

回答3:

http://wenku.baidu.com/view/46afa4dbce2f0066f53322b5?fr=prin 用取模软件把你的这些字取模,替换文档里的字就好了,纵向取模

回答4:

这个!关键是你想怎么实现!可惜咱汇编不会啊!c语言不行吗