16X16点阵汉字显示程序

合集下载

16×16点阵显示汇编程序

16×16点阵显示汇编程序

ORG 0000HAJMP READYORG 000BHAJMP INT_0;只需更改点阵数据和要显示的总字数READY:MOV P0,#0FFHMOV P1,#0FFHMOV P2,#0FFHMOV P3,#0FFHMOV SP,#70HMOV 36H,#2DMOV 37H,#00H;************************************************ MOV 3AH,#17D ;设置要显示的总字数;************************************************ LCALL DATA_CHUSHISETB EASETB ET0MOV TMOD,#01HMOV TH0,#0A6HMOV TL0,#00HSETB TR0;主程序MAIN:ACALL DISP_READYACALL KEYAJMP MAIN;*********************************************** DA TA_CHUSHI:MOV 35H,#00HMOV 38H,#00HMOV 39H,#01H ;初始化时已显示第一个字MOV 3BH,#0A0H ;暂存r0指向地址MOV DPTR,#DATA1MOV R0,#0A0H ;点阵数据存放地址MOV 30H,#32D ;数据字节数SEND_DATA0:MOV A,#00HMOVC A,@A+DPTRMOV @R0,AINC R0INC DPTRDJNZ 30H,SEND_DA TA0;*********************************************** MOV R0,#0C0H ;点阵数据存放地址MOV 30H,#32D ;数据字节数SEND_DATA1:MOV A,#00HMOVC A,@A+DPTRMOV @R0,AINC R0INC DPTRDJNZ 30H,SEND_DA TA1;*********************************************** MOV DPTR,#DATA1+32MOV R0,#80H ;点阵数据存放地址MOV 30H,#32D ;数据字节数SEND_DATA2:MOV A,#00HMOVC A,@A+DPTRMOV @R0,AINC R0INC DPTRDJNZ 30H,SEND_DA TA2RET;*********************************************** KEY:MOV P3,#0FFHMOV A,P3ANL A,#00000011BCJNE A,#00000011B,KEY_PANDUANRETKEY_PANDUAN:MOV 34H,AACALL KEY_DELAYMOV A,P3ANL A,#00000011BCJNE A,34H,KEY_EXITACALL KEY_CHULIKEY_EXIT: RET;***************************KEY_CHULI:JB ACC.0,KEY_2MOV A,37HADD A,#40HMOV 37H,ALCALL DATA_CHUSHIRETKEY_2: JB ACC.1,KEY_CHULI_EXITINC 36HINC 36HMOV A,36HCJNE A,#14D,CHANGE_36HMOV A,#2DCHANGE_36H:MOV 36H,AMOV 35H,#00HRETKEY_CHULI_EXIT:RET;*************************** KEY_DELAY:DL Y_LP1: MOV R1,#20MOV R6,#50DL Y_LP2:NOPNOPNOPDJNZ R6,DL Y_LP2DJNZ R7,DL Y_LP1END_DL YMS:RET;***************************;显示程序DISP_READY:MOV R0,3BHMOV 30H,#16DMOV 31H,#00HDISP:MOV A,@R0MOV P0,AINC R0MOV A,@R0MOV P2,AMOV P1,31HACALL DISP_DELAYMOV P0,#00HMOV P1,#0FFHMOV P2,#00HINC 31HINC R0DJNZ 30H,DISPDISP_EXIT:RET;显示延时DISP_DELAY:MOV 32H,#2D1:MOV 33H,#150DJNZ 33H,$DJNZ 32H,D1RET;中断处理程序INT_0:PUSH ACCMOV TH0,#0A6HMOV TL0,#00HINC 35HMOV A,35HCJNE A,36H,INT0_EXITMOV 35H,#00HACALL WHICH_WAYINT0_EXIT:POP ACCRETI;********************************************* WHICH_W AY:MOV A,37HCJNE A,#00H,WAY2ACALL YIDONG1RETWAY2: CJNE A,#40H,WAY3ACALL YIDONG2RETWAY3: CJNE A,#80H,WAY4ACALL YIDONG3RETWAY4: ACALL YIDONG4RET;********************************************* YIDONG1: MOV 50H,#0A1HMOV 51H,#0C1HMOV 3CH,#16DINC 38HMOV A,38HCJNE A,#16D,YIDONG1_THEN1MOV 38H,#00HINC 39HMOV A,39HCJNE A,3AH,YIDONG1_THENMOV 39H,#00HMOV DPTR,#DATA1YIDONG1_THEN:MOV 3CH,#32DMOV R1,#0C0HYIDONG1_SEND_DA TA:MOV A,#00HMOVC A,@A+DPTRMOV @R1,AINC R1INC DPTRDJNZ 3CH,YIDONG1_SEND_DA TAMOV 3CH,#16DYIDONG1_THEN1:MOV R1,51HMOV A,@R1RLC AMOV @R1,ADEC R1MOV A,@R1RLC AMOV @R1,AMOV R1,50HMOV A,@R1RLC AMOV @R1,ADEC R1MOV A,@R1RLC AMOV @R1,AINC 50HINC 50HINC 51HINC 51HDJNZ 3CH,YIDONG1_THEN1RET;********************************************* YIDONG2:MOV 50H,#0A0HMOV 51H,#80HMOV 3CH,#16DINC 38HMOV A,38HCJNE A,#16D,YIDONG2_THEN1MOV 38H,#00HINC 39HMOV A,39HCJNE A,3AH,YIDONG2_THENMOV 39H,#00HMOV DPTR,#DA TA1YIDONG2_THEN:MOV 3CH,#32DMOV R1,#80HYIDONG2_SEND_DA TA:MOV A,#00HMOVC A,@A+DPTRMOV @R1,AINC R1INC DPTRDJNZ 3CH,YIDONG2_SEND_DATAMOV 3CH,#16DYIDONG2_THEN1:MOV R1,51HMOV A,@R1RRC AMOV @R1,AINC R1MOV A,@R1RRC AMOV @R1,AMOV R1,50HMOV A,@R1RRC AMOV @R1,AINC R1MOV A,@R1RRC AMOV @R1,AINC 50HINC 50HINC 51HINC 51HDJNZ 3CH,YIDONG2_THEN1RET;********************************************* YIDONG3:INC 3BHINC 3BHMOV 30H,#01HINC 38HMOV A,38HCJNE A,#16D,YIDONG3_EXITMOV 3BH,#0A0HMOV 38H,#00HMOV 3CH,#32DMOV 50H,#0A0HMOV 51H,#0C0HYIDONG3_LOOP:MOV R1,51HMOV A,@R1MOV R1,50HMOV @R1,AINC 50HINC 51HDJNZ 3CH,YIDONG3_LOOPINC 39HMOV A,39HCJNE A,3AH,YIDONG3_THENMOV 39H,#00HMOV DPTR,#DATA1YIDONG3_THEN:MOV R1,#0C0HMOV 3CH,#32DYIDONG3_THEN2:MOV A,#00HMOVC A,@A+DPTRMOV @R1,AINC R1INC DPTRDJNZ 3CH,YIDONG3_THEN2 YIDONG3_EXIT:RET;********************************************* YIDONG4:DEC 3BHDEC 3BHMOV 30H,#01HINC 38HMOV A,38HCJNE A,#16D,YIDONG4_EXITMOV 3BH,#0A0HMOV 38H,#00HMOV 3CH,#32DMOV 50H,#0A0HMOV 51H,#80HYIDONG4_LOOP:MOV R1,51HMOV A,@R1MOV R1,50HMOV @R1,AINC 50HINC 51HDJNZ 3CH,YIDONG4_LOOPINC 39HMOV A,39HCJNE A,3AH,YIDONG4_THENMOV 39H,#00HMOV DPTR,#DATA1YIDONG4_THEN:MOV R1,#80HMOV 3CH,#32DYIDONG4_THEN2:MOV A,#00HMOVC A,@A+DPTRMOV @R1,AINC R1INC DPTRDJNZ 3CH,YIDONG4_THEN2YIDONG4_EXIT:RET;*********************************************DA TA1:DB00H,00H,03H,00H,73H,7EH,13H,66H,0FH,0E6H,4FH,0E6H,73H,7EH,17H,66H,07H,0E6H,37H ,0FEH,3FH,66H,2BH,66H,23H,66H,63H,7EH,63H,66H,00H,00HDB00H,00H,0FH,0FEH,7FH,0FEH,30H,0B0H,07H,0FEH,44H,0B6H,67H,0FEH,33H,0FCH,07H,0F CH,17H,0FCH,16H,04H,37H,0FCH,36H,62H,6FH,0FFH,20H,60H,00H,60HDB00H,00H,7EH,00H,7FH,0FCH,24H,84H,3CH,84H,3CH,84H,24H,84H,24H,84H,3CH,0FCH,24H ,00H,27H,48H,7FH,6CH,74H,0C6H,05H,86H,05H,02H,00H,00HDB00H,00H,06H,60H,06H,60H,06H,60H,66H,64H,26H,6CH,36H,6CH,36H,6CH,16H,68H,1EH,78 H,16H,60H,06H,60H,06H,60H,7FH,0FEH,7FH,0FEH,00H,00HDB00H,00H,18H,60H,18H,60H,1BH,0FEH,7DH,0FEH,7CH,60H,19H,60H,1BH,0FCH,3CH,8CH,7 8H,0C8H,18H,0D8H,18H,70H,18H,70H,3BH,0DEH,33H,06H,00H,00HDB00H,00H,01H,90H,01H,98H,01H,88H,7FH,0FEH,7FH,0FEH,03H,0C0H,07H,0C0H,05H,0E0H,0 DH,0B0H,19H,98H,31H,9CH,61H,8EH,01H,80H,01H,80H,00H,00HDB00H,00H,19H,98H,19H,98H,08H,30H,7FH,0FEH,60H,06H,60H,06H,1FH,0F8H,00H,0F0H,00H, 80H,7FH,0FEH,40H,80H,00H,80H,00H,80H,03H,80H,00H,00HDB00H,00H,00H,60H,7CH,20H,6BH,0FEH,6BH,02H,79H,04H,79H,0FCH,68H,00H,6FH,0FEH,64 H,0D0H,7CH,0D0H,78H,0D0H,60H,92H,63H,13H,66H,1EH,00H,00HDB00H,00H,18H,60H,18H,60H,17H,0FEH,30H,00H,33H,0FEH,70H,00H,53H,0FEH,12H,00H,10H,00H,13H,0FCH,13H,04H,13H,04H,13H,0FCH,13H,04H,00H,00HDB02H,00H,03H,00H,1FH,0F8H,10H,08H,1FH,0F8H,10H,08H,1FH,0F8H,10H,08H,1FH,0F8H,00 H,00H,0DH,88H,2CH,0CCH,6CH,16H,64H,30H,07H,0E0H,00H,00HDB00H,00H,00H,00H,3FH,0FCH,21H,84H,01H,80H,01H,80H,01H,80H,01H,80H,01H,80H,01H,80 H,01H,80H,01H,80H,41H,82H,7FH,0FEH,00H,00H,00H,00HDB00H,00H,0CH,00H,7DH,0FCH,19H,84H,19H,84H,7FH,0FCH,7CH,00H,19H,0FCH,3DH,0FEH, 3EH,20H,79H,0FCH,59H,0FCH,18H,20H,19H,0FEH,1BH,0FEH,00H,00HDB00H,00H,00H,7CH,3FH,0F0H,03H,80H,06H,38H,1FH,0E0H,1FH,90H,07H,18H,3DH,0FCH,1F H,0FEH,00H,90H,1CH,98H,30H,8CH,63H,86H,03H,80H,00H,00HDB00H,00H,00H,0C0H,00H,0C0H,7EH,0FEH,06H,0FEH,25H,84H,35H,2CH,1CH,20H,18H,60H,1 CH,70H,16H,70H,36H,0D8H,60H,0CCH,63H,86H,03H,02H,00H,00HDB00H,00H,20H,80H,33H,0BEH,32H,26H,12H,26H,02H,26H,72H,26H,12H,26H,12H,26H,13H,0A 6H,17H,0ACH,12H,20H,10H,20H,3FH,0FEH,41H,0FEH,00H,00HDB00H,00H,08H,0C0H,19H,0FCH,3BH,0FCH,3EH,6CH,58H,60H,19H,68H,1BH,64H,1EH,0E2H,1 8H,0C0H,04H,88H,34H,0CCH,34H,16H,27H,0F0H,27H,0F0H,00H,00HDB00H,00H,00H,00H,04H,00H,0EH,00H,0EH,00H,0EH,00H,0EH,00H,0EH,00H,0EH,00H,04H,00 H,00H,00H,0EH,00H,0EH,00H,00H,00H,00H,00H,00H,00HEND。

8 16X16LED点阵显示程序

8 16X16LED点阵显示程序

16×16按字显示程序:;P0和P2口输出字型码,P1口输出列线扫描。

ORG 0000HSJMP LOOPORG 0080HLOOP:MOV A,#00H ;开机初始化,清除画面MOV P0,A ;清除P0口ANL P2,#00 ;清除P2口MOV R2,#200D100MS: MOV R3,#250 ;延时100毫秒DJNZ R3,$DJNZ R2,D100MSMOV 20H,#00H ;字型码指针赋初值L100: MOV R1,#10 ;每个字的停留时间L16: MOV R6,#16 ;每个字16个16位码MOV R4,#00H ;列线扫描指针清零,接4-16译码器,。

MOV R0,20H ;字型码指针存入R0L3: MOV A,R4 ;列线扫描指针存入AMOV P1,A ;列线扫描输出INC R4 ;扫描指针加1,指向下一列MOV A,R0 ; 取码指针存入AMOV DPTR,#TABLE ;取数据表的上半部分的代码MOVC A,@A+DPTRMOV P0,A ; 输出到P0INC R0 ;取字型码指针加1,取下一个码。

MOV A,R0MOV DPTR,#TABLE ;取数据表下半部份的代码MOVC A,@A+DPTRMOV P2,A ;输出到P2口INC R0 ;取字型码指针加1,取下一个码。

MOV R3,#02 ;扫描1毫秒DELAY2:MOV R5,#248DJNZ R5,$DJNZ R3,DELAY2MOV A,#00H ;清除屏幕MOV P0,AANL P2,#00HDJNZ R6,L3 ;一个字16个码是否完成?DJNZ R1,L16 ;每个字的停留时间是否到了?MOV 20H,R0 ;取码指针存入20H(静态显示)CJNE R0,#224,L100 ;7个字224个码是否完成?JMP LOOP ;反复循环16×16滚动显示程序:ORG 0000HSJMP LOOPORG 0080HLOOP:MOV A,#00H ;开机初始化,清除画面MOV P0,A ;清除P0口ANL P2,#00 ;清除P2口MOV R2,#200D100MS: MOV R3,#250 ;延时100毫秒DJNZ R3,$DJNZ R2,D100MSMOV 20H,#00H ;字型码指针赋初值L100: MOV R1,#10 ;每个字的停留时间L16: MOV R6,#16 ;每个字16个16位码MOV R4,#00H ;列线扫描指针清零,接4-16译码器,。

16×16点阵LED显示屏整个过程及C语言程序(1).

16×16点阵LED显示屏整个过程及C语言程序(1).

16×16点阵LED显示屏整个过程及C语言程序7.1功能要求设计一个室内用16×16点阵LED图文显示屏,要求在目测条件下LED显示屏各点亮度均匀、充足,可显示图形和文字,显示图形或文字应稳定、清晰无串扰。

图形或文字显示有静止、移入移出等显示方式。

7.2方案论证从理论上说,不论显示图形还是文字,只要控制与组成这些图形或文字的各个点所在位置相对应的LED器件发光,就可以得到我们想要的显示结果,这种同时控制各个发光点亮灭的方法称为静态驱动显示方式。

16×16的点阵共有256个发光二极管,显然单片机没有这么多端口,如果我们采用锁存器来扩展端口,按8位的锁存器来计算,16×16的点阵需要256/8=32个锁存器。

这个数字很庞大,因为我们仅仅是16×16的点阵,在实际应用中的显示屏往往要大的多,这样在锁存器上花的成本将是一个很庞大的数字。

因此在实际应用中的显示屏几乎都不采用这种设计,而采用另一种称为动态扫描的显示方法。

动态扫描的意思简单地说就是逐行轮流点亮,这样扫描驱动电路就可以实现多行(比如16行)的同名列共用一套列驱动器。

具体就16×16的点阵来说,我们把所有同一行的发光管的阳极连在一起,把所有同一列的发光管的阴极连在一起(共阳的接法),先送出对应第一行发光管亮灭的数据并锁存,然后选通第一行使其燃亮一定的时间,然后熄灭;再送出第二行的数据并锁存,然后选通第二行使其燃亮相同的时间,然后熄灭;……第十六行之后又重新燃亮第一行,这样反复轮回。

当这样轮回的速度足够快(每秒24次以上),由于人眼的视觉暂留现象,我们就能看到显示屏上稳定的图形了。

采用扫描方式进行显示时,每行有一个行驱动器,各行的同名列共用一个列驱动器。

显示数据通常存储在单片机的存储器中,按8位一个字节的形式顺序排放。

显示时要把一行中各列的数据都传送到相应的列驱动器上去,这就存在一个显示数据传输的问题。

16x16点阵LED滚动显示汉字

16x16点阵LED滚动显示汉字

#include <iom8515v.h>#include <macros.h>/*RCS2--->PC0CCS1--->PC1CCS2--->PC2RCS1--->PC3'=1*/#define RCS1_1 PORTC |= BIT(PORTC3>#define RCS2_1 PORTC |= BIT(PORTC0>#define CCS1_1 PORTC |= BIT(PORTC1>#define CCS2_1 PORTC |= BIT(PORTC2>#define RCS1_0 PORTC &=~BIT(PORTC3>#define RCS2_0 PORTC &=~BIT(PORTC0>#define CCS1_0 PORTC &=~BIT(PORTC1>#define CCS2_0 PORTC &=~BIT(PORTC2>#define DOTLEDPORT PORTAunsigned int RollCount=0。

unsigned int SecondCount=0。

unsigned char SecondFlag=0。

const unsigned char DOTLEDBIT[]={0xfe ,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f,}。

unsigned char ScanDOTLEDCount=0。

unsigned char DOTLEDBuffer[32]。

#pragma interrupt_handler timer1_ovf_isr:7void timer1_ovf_isr(void>{TCNT1H = 0xFE。

TCNT1L = 0x0C。

//点阵LED扫描过程if(ScanDOTLEDCount<8>{DOTLEDPORT=DOTLEDBIT[ScanDOTLEDCount%8]。

16 16点阵显示程序

16 16点阵显示程序

16 16点阵显示程序以下是程序.#include "config.h"#define DOTLED_LINE_PORT PORTB#define DOTLED_LINE_DDR DDRB#define DOTLED_LINE_PIN PINB#define DOTLED_LINE_SCKT PB1#define DOTLED_LINE_SCKH PB5#define DOTLED_LINE_SDA PB3#define DOTLED_ROW_PORT PORTC#define DOTLED_ROW_DDR DDRC#define DOTLED_ROW_PIN PINC#define DOTLED_ROW_A0 PC0#define DOTLED_ROW_A1 PC1#define DOTLED_ROW_A2 PC2#define DOTLED_ROW_A3 PC3#define DOTLED_ROW_E PC4uint8 font[] = {/*-- 调入了一幅图像:这是您新建的图像 --*//*-- 宽度x高度=16x16 --*/0x00,0x00,0x00,0x00,0x08,0x38,0x18,0x44,0x08,0x44,0x08,0x04,0x08,0x08,0x08,0x10, 0x08,0x20,0x08,0x40,0x08,0x40,0x08,0x40,0x3E,0x7C,0x00,0x00,0x00,0x00,0x00,0x00 };static void TransmitByte(uint8 byte);static void SelectRow(uint8 row);static void FlipLatchLine(void);static void TransmitByte(uint8 byte){uint8 i;for(i = 0 ; i < 8 ; i ++)if(byte & (1 << i)){DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA);}else{DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SDA);}//__delay_cycles(100);DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKH);//__delay_cycles(100);DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKH);//__delay_cycles(100);}}static void SelectRow(uint8 row){//row -= 1;row |= DOTLED_ROW_PIN & 0xe0;DOTLED_ROW_PORT = row;}static void FlipLatchLine(void){DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKT);DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKT);}void InitDotLedPort(void){DOTLED_LINE_PORT &= ~(_BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH));DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA);DOTLED_LINE_DDR |= _BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH) | _BV(DOTLED_ LINE_SDA);DOTLED_ROW_PORT |= 0x1f;DOTLED_ROW_PORT &= 0xf0;DOTLED_ROW_DDR |= 0x1f;}void EnableRow(boolean IsEnable){if(IsEnable)DOTLED_ROW_PORT &= ~_BV(DOTLED_ROW_E); }else{DOTLED_ROW_PORT |= _BV(DOTLED_ROW_E); }}void PrintDotLed(uint8 * buffer){uint8 i , tmp;for(i = 0 ; i < 16 ; i ++){tmp = *buffer ++;TransmitByte(~tmp);tmp = *buffer ++;TransmitByte(~tmp);SelectRow(i);FlipLatchLine();}}void main(void){InitDotLedPort();EnableRow(TRUE);while(1){PrintDotLed(font);__delay_cycles(5000);}}//--------------------------------------------------------------------------- config.h文件#ifndef _CONFIG_H#define _CONFIG_H//#define GCCAVR#define CPU_CYCLES 7372800L#ifndef GCCAVR#define _BV(bit) (1 << (bit))#endif#define MSB 0x80#define LSB 0x01#define FALSE 0#define TRUE 1typedef unsigned char uint8;typedef unsigned int uint16;typedef unsigned long uint32;typedef unsigned char boolean;#include <ioavr.h>#include <inavr.h>#include "dotled.h"#endif//--------------------------------------------------------------------------- 16 16点阵显示电路。

16乘16点阵显示实验报告

16乘16点阵显示实验报告

实验报告实验名称: [16×16点阵显示实验] 姓名: []学号: [2011]指导教师: []实验时间: [2013年4月25日]信息与通信工程学院16×16点阵显示实验1实验要求任务1:将所给程序改正使结果为正显示;任务2:使显示四个字、八个字。

2实验原理2.1 LED显示器结构和原理1>8*8LED点阵的结构图1 8*8LED点阵结构图从图1中可以看出,8*8LED点阵共由64个发光二极管组成,每个发光二极管是放置在行线和列线的交叉点上,当对应的某一行置1高电平,且某一列置0低电平,则相应的发光二极管就亮;因此要用8*8LED点阵来显示一个字符或汉字,只需要根据字符或汉字图形中的线条或笔画,通过点亮多个发光二极管来勾勒出字符或汉字的线条或笔画就行了。

当要比较完美的显示一般的汉字,单个8*8LED点阵模块很难做到,因为LED的点数(也称为像素点)不够多,因此要显示汉字的话,需要多个8*8LED点阵拼合成一个显示屏。

假如用4个8*8LED点阵模块拼成16*16的点阵,即能满足一般汉字的显示。

但要显示信息量大的图形,则需要n个多个8*8LED点阵,拼装成一个大屏幕才行。

LED点阵显示器最大的特点是亮度高、功耗较低、寿命长、容易控制等,因此它的应用很广,常用在广场、车站、商业广告等室外的显示。

2>8*8LED点阵的封装和引脚规律64个发光二极管按照行共阳、列共阴4个一组的方式封装成一个模块,这样8*8LED 点阵模块就有8行、8列共16个引脚。

其实物图如图2,电路模块符号图如图3。

图2 8*8LED点阵实物图图3 8*8LED点阵符号图但8*8LED点阵的16个引脚并不是很有规律,千万不要想象成1~8个引脚是行,9~16个引脚是列。

而且不同产品的点阵外部引脚排列规律还可能不一样。

以下是NLB1388SRA 和LDM1388SRA两个型号点阵引脚对应行、列的关系表:行号H0 H1 H2 H3 H4 H5 H6 H7引脚号9 14 8 12 1 7 2 5列号L0 L1 L2 L3 L4 L5 L6 L7引脚号13 3 4 10 6 11 15 16 假如你买到一块新的8*8LED点阵,又没有关于它的相关资料,那你只有自己用万用表或通过VCC电源串接一个510欧姆的电阻来检测了。

单片机课程设计_16×16点阵式汉字显示

单片机课程设计_16×16点阵式汉字显示

目录摘要 (1)Abstract (2)1设计原理 (3)1.1 MCS-51单片机的结构及编程方法 (3)1.2 16*16点阵LED原理 (5)1.3 3-8译码器原理 (6)2.设计方案介绍 (7)2.1 设计总体思路 (7)2.2 与题目相关的具体设计 (7)2.3程序设计流程图 (8)3.源程序,原理图和仿真图 (9)3.1程序清单(见附录) (9)3.2电路图 (9)3.2.1电路原理图 (9)3.2.2电路图分析 (9)3.3仿真图 (10)4性能分析 (11)5.总结和心得 (12)6.参考文献 (13)附录:程序代码 (14)摘要LED点阵显示屏作为一种新兴的显示器件,是由多个独立的LED发光二极管封装而成. LED点阵显示屏可以显示数字或符号, 通常用来显示时间、速度、系统状态等。

文章给出了一种基于MCS-51单片机的16×16 点阵LED显示屏的设计方案。

包括系统具体的硬件设计方案,软件流程图和部分汇编语言程序等方面。

在负载范围内, 只需通过简单的级联就可以对显示屏进行扩展,是一种成本低廉的图文显示方案。

关键词:MCS-51;LED;单片机AbstractAs a popular display device component, LED dot-matrix display board consists of several independent LED (Light Emitting Diode). The LED dot-matrix display board can display the number or sign, and it is usually used to show time, speed, the state of system etc. This paper introduces a kind of simple 16x16 LED display screen design process based on MCS-51 single chip minicomputer . The detail hardware scheme, software flow and assemble language programmer design and so on is followed. The display part can be cascaded to meet the need. The practice proves the design is low-cost and effective.Key words: MCS-51;LED;MCU1设计原理1.1 MCS-51单片机的结构及编程方法MCS-51单片机的组成: CPU(进行运算、控制)、RAM(数据存储器)、ROM(程序存储器)、I/O口(串口、并口)、内部总线和中断系统等。

protues仿真16x16点阵动态显示文字

protues仿真16x16点阵动态显示文字

等等…………….源程序#include<reg52.h> sbit lh8=P3^6;sbit ll8=P3^7;#define uint unsigned intunsigned char code table[]={/*-- 文字: 宇 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x00,0x80,0x3F,0xFE,0x20,0x04,0x40,0x08,0x1F,0xF0,0x00,0x80,0x00,0x 80,0x7F,0xFC,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x02,0x80,0x01,0x 00,/*-- 文字: 洋 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x22,0x10,0x11,0x10,0x11,0x20,0x07,0xFC,0x80,0x40,0x50,0x40,0x57,0xFC,0x10,0x 40,0x20,0x40,0x2F,0xFE,0xE0,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x40,0x20,0x 40,/*-- 文字: 张 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0xF8,0x88,0x08,0x88,0x08,0x90,0x78,0xA0,0x40,0xC0,0x40,0x80,0x43,0x FE,0xF8,0xA0,0x48,0xA0,0x08,0x90,0x08,0x90,0x08,0x88,0x08,0xA4,0x29,0xC4,0x10,0 x80,/*-- 文字: 张 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0xF8,0x88,0x08,0x8C,0x08,0x90,0x78,0xA0,0x40,0xC0,0x40,0x80,0x43,0x FE,0xF8,0xA0,0x48,0xA0,0x08,0x90,0x08,0x90,0x08,0x88,0x08,0xA6,0x29,0xC4,0x10,0 x80,/*-- 文字: 石 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0xFF,0xFE,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00,0x07,0xF8,0x0C,0x 08,0x0C,0x08,0x14,0x08,0x24,0x08,0x44,0x08,0x84,0x08,0x07,0xF8,0x04,0x08,0x00,0x 00,/*-- 文字: 小 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x09,0x40,0x0D,0x20,0x19,0x10,0x11,0x 18,0x21,0x0C,0x41,0x06,0x81,0x04,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x 00,/*-- 文字: 你 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x09,0x00,0x09,0x80,0x11,0x04,0x13,0xFE,0x22,0x04,0x34,0x48,0x68,0x40,0xA2,0x 50,0x23,0x48,0x22,0x48,0x24,0x44,0x24,0x46,0x28,0x44,0x21,0x40,0x20,0x80,0x00,0x 00,/*-- 文字: 强 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x79,0xF8,0x09,0x08,0x09,0x08,0x79,0xF8,0x40,0x40,0x43,0xFC,0x42,0x 44,0x7A,0x44,0x0A,0x44,0x0B,0xFC,0x08,0x40,0x08,0x48,0x08,0x44,0x28,0x7E,0x13,0 xC4,/*-- 文字: 好 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x00,0x11,0xFC,0x10,0x08,0x10,0x10,0xFC,0x20,0x24,0x20,0x24,0x20,0x27,0x FE,0x44,0x20,0x64,0x20,0x18,0x20,0x08,0x20,0x14,0x20,0x26,0x20,0x44,0xA0,0x80,0x 40,//是0x00,0x00,0x0F,0xF0,0x08,0x10,0x0F,0xF0,0x08,0x10,0x0F,0xF0,0x00,0x00,0xFF,0x FE,0x01,0x00,0x09,0x00,0x09,0xF8,0x09,0x00,0x15,0x00,0x23,0x00,0x40,0xFE,0x00,0x 00,/*-- 文字: 快 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x80,0x20,0x80,0x20,0x80,0x37,0xF8,0xA8,0x88,0xA8,0x88,0xA0,0x88,0x2F,0x FE,0x20,0x80,0x21,0x40,0x21,0x40,0x21,0x20,0x22,0x10,0x22,0x18,0x24,0x0E,0x28,0x 04,/*-- 文字: 乐 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x30,0x01,0xF8,0x1F,0x00,0x10,0x80,0x10,0x80,0x10,0x80,0x3F,0xFC,0x10,0x 80,0x08,0x80,0x0C,0x90,0x18,0x88,0x30,0x8C,0x24,0x86,0x42,0x84,0x01,0x00,0x00,0x 00,/*-- 文字: 撒 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x25,0x10,0x25,0x18,0x2F,0xD0,0xF5,0x10,0x25,0x1E,0x2F,0xF4,0x20,0x24,0x37,0x E4,0x64,0x94,0xA7,0x94,0x24,0x88,0x27,0x88,0x24,0x94,0x24,0xA6,0xA5,0xC4,0x44,0 x80,/*-- 文字: 飞 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0xFF,0xC0,0x00,0x40,0x00,0x48,0x00,0x50,0x00,0x60,0x00,0x60,0x00,0x 50,0x00,0x48,0x00,0x40,0x00,0x20,0x00,0x22,0x00,0x12,0x00,0x0A,0x00,0x06,0x00,0x 00,/*-- 文字: 机 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x 88,0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x 00,/*-- 文字: 上 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0xF8,0x01,0x 00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x04,0x7F,0xFE,0x00,0x 00,/*-- 文字: 大 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x02,0x 80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18,0x20,0x0E,0x40,0x 04,/*-- 文字: 举 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x24,0x10,0x12,0x18,0x09,0x10,0x09,0x20,0xFF,0xFE,0x04,0x40,0x09,0x20,0x11,0x 10,0x2F,0xE8,0x41,0x06,0x81,0x00,0x3F,0xF8,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x 00,/*-- 文字: 发 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x02,0x00,0x22,0x40,0x22,0x30,0x22,0x10,0x7F,0xFE,0x24,0x00,0x04,0x00,0x07,0x E0,0x0C,0x20,0x0A,0x20,0x0A,0x20,0x11,0x40,0x20,0x80,0x41,0x60,0x86,0x1C,0x18,0 x08,/*-- 文字: 力 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x7F,0xFC,0x01,0x04,0x01,0x04,0x01,0x 04,0x01,0x04,0x02,0x04,0x02,0x04,0x04,0x04,0x04,0x04,0x08,0x04,0x10,0x28,0x20,0x 10,/*-- 文字: 开 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x7F,0xFE,0x04,0x20,0x04,0x20,0x04,0x20,0x04,0x20,0xFF,0xFE,0x04,0x 20,0x04,0x20,0x04,0x20,0x08,0x20,0x08,0x20,0x10,0x20,0x20,0x20,0x40,0x20,0x00,0x 00,/*-- 文字: 始 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x20,0x18,0x30,0x10,0x20,0x10,0x48,0xFC,0x84,0x25,0xFE,0x24,0x84,0x44,0x 00,0x44,0xFC,0x28,0x84,0x18,0x84,0x14,0x84,0x22,0x84,0x42,0xFC,0x80,0x84,0x00,0x 00,/*-- 文字: 了 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x7F,0xFC,0x00,0x18,0x00,0x60,0x01,0x80,0x01,0x00,0x01,0x00,0x01,0x 00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x 00,/*-- 文字: 大 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x02,0x 80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18,0x20,0x0E,0x40,0x 04,/*-- 文字: 解 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x00,0x21,0xFC,0x7C,0x44,0x88,0x44,0x7E,0x44,0x4A,0x9C,0x7F,0x08,0x4A,0 x90,0x4A,0xFE,0x7F,0x10,0x4A,0x10,0x4B,0xFE,0x4A,0x10,0x42,0x10,0x4A,0x10,0x84,0 x10,/*-- 文字: 放 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x40,0x08,0x60,0x08,0x40,0xFE,0xFE,0x20,0x84,0x20,0x84,0x3D,0x44,0x26,0x 48,0x24,0x28,0x24,0x30,0x24,0x10,0x24,0x30,0x44,0x48,0x44,0x8E,0x95,0x04,0x08,0x 00,/*-- 文字: 昆 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x20,0x40,0x20,0x 40,0x20,0x44,0x3E,0x4C,0x20,0x70,0x20,0x40,0x26,0x42,0x38,0x42,0x20,0x3E,0x00,0x 00,/*-- 文字: 仑 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x02,0x80,0x04,0x40,0x08,0x30,0x10,0x1C,0x68,0x08,0x08,0x 40,0x08,0xE0,0x09,0x80,0x0E,0x00,0x08,0x08,0x08,0x08,0x08,0x0C,0x07,0xF8,0x00,0x 00,/*-- 文字: 山 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x21,0x04,0x21,0x04,0x21,0x 04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x21,0x04,0x7F,0xFC,0x20,0x04,0x00,0x 00,/*-- 文字: 搭 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x21,0x10,0x21,0x10,0x27,0xFE,0xF9,0x10,0x21,0x50,0x20,0x40,0x28,0xA0,0x31,0x 10,0xE3,0xEE,0x2C,0x00,0x23,0xF8,0x22,0x08,0x22,0x08,0x22,0x08,0xA3,0xF8,0x42,0x 08,/*-- 文字: 街 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x11,0x00,0x19,0x1E,0x21,0x00,0x47,0xC0,0x99,0x00,0x11,0x1E,0x2F,0xE8,0x60,0x 08,0xA1,0x08,0x27,0xC8,0x21,0x08,0x21,0x08,0x21,0xC8,0x27,0x28,0x20,0x10,0x00,0x 00,/*-- 文字: 坊 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0x10,0x60,0x10,0x20,0x17,0xFE,0x10,0x80,0xFC,0x80,0x10,0x80,0x10,0x FC,0x10,0x84,0x16,0x84,0x18,0x84,0xE1,0x04,0x41,0x04,0x02,0x04,0x04,0x28,0x08,0x 10,/*-- 文字: 拉 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x80,0x10,0x60,0x10,0x20,0x11,0xFE,0xFC,0x00,0x10,0x08,0x15,0x0C,0x18,0x 88,0x30,0x88,0xD0,0x48,0x10,0x50,0x10,0x50,0x10,0x50,0x17,0xFE,0x50,0x00,0x20,0x 00,/*-- 文字: 萨 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x04,0x40,0x04,0x40,0xFF,0xFE,0x04,0x40,0x04,0x40,0x78,0x20,0x4B,0xFE,0x50,0x 88,0x60,0x50,0x53,0xFE,0x4A,0x00,0x6A,0x00,0x52,0x00,0x44,0x00,0x44,0x00,0x48,0x 00,/*-- 文字: 解 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x00,0x21,0xFC,0x7C,0x44,0x88,0x44,0x7E,0x44,0x4A,0x9C,0x7F,0x08,0x4A,0 x90,0x4A,0xFE,0x7F,0x10,0x4A,0x10,0x4B,0xFE,0x4A,0x10,0x42,0x10,0x4A,0x10,0x84,0 x10,/*-- 文字: 放 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x40,0x08,0x60,0x08,0x40,0xFE,0xFE,0x20,0x84,0x20,0x84,0x3D,0x44,0x26,0x 48,0x24,0x28,0x24,0x30,0x24,0x10,0x24,0x30,0x44,0x48,0x44,0x8E,0x95,0x04,0x08,0x 00,/*-- 文字: 路 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x80,0x78,0x80,0x48,0xFC,0x49,0x88,0x4A,0x48,0x7C,0x50,0x50,0x20,0x10,0x 58,0x5D,0x86,0x53,0xFC,0x51,0x08,0x51,0x08,0x5D,0x08,0xE1,0xF8,0x01,0x08,0x00,0 x00,/*-- 文字: s --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x60,0x00,0x60,0x 00,0x3C,0x00,0x06,0x00,0x06,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x 00,/*-- 文字: a --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x06,0x00,0x06,0x 00,0x3E,0x00,0x66,0x00,0x66,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x 00,/*-- 文字: d --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x3E,0x00,0x66,0x00,0x66,0x 00,0x66,0x00,0x66,0x00,0x66,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x 00,/*-- 文字: 豆 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0x7F,0xFE,0x00,0x00,0x00,0x00,0x1F,0xF0,0x10,0x10,0x10,0x10,0x10,0x 10,0x1F,0xF0,0x00,0x20,0x10,0x30,0x08,0x20,0x04,0x40,0xFF,0xFE,0x00,0x00,0x00,0x 00,/*-- 文字: 浆 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x80,0x48,0x80,0x28,0xFC,0x29,0x08,0x0A,0x90,0x28,0x60,0xC8,0x40,0x09,0x 80,0x01,0x18,0x7D,0xA0,0x05,0x40,0x09,0x20,0x11,0x18,0x61,0x0E,0x05,0x04,0x02,0 x00,/*-- 文字: 粉 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x10,0x10,0x98,0x94,0x90,0x54,0x90,0x59,0x08,0xFD,0x08,0x32,0x06,0x37,0x FC,0x58,0x88,0x54,0x88,0x50,0x88,0x90,0x88,0x11,0x08,0x11,0x08,0x12,0x50,0x14,0x 20,/*-- 文字: 蓝 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x40,0x08,0x40,0xFF,0xFE,0x08,0x40,0x04,0x80,0x24,0xFC,0x24,0xA0,0x25,0x 10,0x26,0x10,0x04,0x00,0x1F,0xF0,0x12,0x90,0x12,0x90,0x12,0x90,0xFF,0xFE,0x00,0x 00,/*-- 文字: 色 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x04,0x00,0x04,0x00,0x07,0xF0,0x08,0x20,0x10,0x40,0x3F,0xF0,0x51,0x10,0x11,0x 10,0x11,0x10,0x1F,0xF0,0x10,0x00,0x10,0x04,0x10,0x04,0x10,0x04,0x0F,0xFC,0x00,0x 00,/*-- 文字: 大 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x02,0x 80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18,0x20,0x0E,0x40,0x 04,/*-- 文字: 飞 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x00,0xFF,0xC0,0x00,0x40,0x00,0x48,0x00,0x50,0x00,0x60,0x00,0x60,0x00,0x 50,0x00,0x48,0x00,0x40,0x00,0x20,0x00,0x22,0x00,0x12,0x00,0x0A,0x00,0x06,0x00,0x 00,/*-- 文字: 机 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x00,0x10,0xF8,0x10,0x88,0xFE,0x88,0x10,0x88,0x10,0x88,0x38,0x88,0x34,0x 88,0x54,0x88,0x50,0x88,0x91,0x08,0x11,0x0A,0x12,0x0A,0x12,0x0A,0x14,0x06,0x10,0x 00,/*-- 文字: 数 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x08,0x20,0x49,0x30,0x2A,0x20,0x1C,0x20,0xFF,0x7E,0x1C,0x44,0x2B,0x44,0x48,0x C4,0x08,0x28,0xFF,0x28,0x12,0x10,0x34,0x10,0x0C,0x28,0x32,0x4E,0xC0,0x84,0x00,0x 00,/*-- 文字: 量 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x00,0x00,0xFF,0xFE,0x11,0x 10,0x1F,0xF0,0x11,0x10,0x1F,0xF0,0x01,0x00,0x1F,0xF8,0x01,0x00,0xFF,0xFE,0x00,0x 00,/*-- 文字: 大 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x01,0x00,0x02,0x 80,0x02,0x80,0x02,0x40,0x04,0x40,0x04,0x20,0x08,0x10,0x10,0x18,0x20,0x0E,0x40,0x 04,/*-- 文字: 幅 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x20,0x00,0x23,0xFE,0x20,0x00,0xF9,0xFC,0xA9,0x04,0xA9,0x04,0xA9,0xFC,0xA8,0 x00,0xAB,0xFE,0xAA,0x22,0xAB,0xFE,0xBA,0x22,0x22,0x22,0x23,0xFE,0x22,0x02,0x20,0 x00,/*-- 文字: 反 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x00,0x78,0x3F,0x80,0x20,0x00,0x20,0x00,0x3F,0xF0,0x28,0x10,0x28,0x10,0x24,0x 20,0x24,0x20,0x22,0x40,0x21,0x80,0x21,0x80,0x42,0x60,0x4C,0x1C,0xB0,0x08,0x00,0x 00,/*-- 文字: 抗 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x40,0x10,0x20,0x10,0x20,0xFD,0xFE,0x10,0x00,0x10,0x00,0x14,0xF0,0x18,0x 90,0x30,0x90,0xD0,0x90,0x10,0x90,0x11,0x10,0x11,0x12,0x52,0x12,0x24,0x0E,0x00,0x 00,/*-- 文字: 拉 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x10,0x80,0x10,0x60,0x10,0x20,0x11,0xFE,0xFC,0x00,0x10,0x08,0x15,0x0C,0x18,0x 88,0x30,0x88,0xD0,0x48,0x10,0x50,0x10,0x50,0x10,0x50,0x17,0xFE,0x50,0x00,0x20,0x 00,/*-- 文字: 萨 --*//*-- Fixedsys12; 此字体下对应的点阵为:宽x高=16x16 --*/0x04,0x40,0x04,0x40,0xFF,0xFE,0x04,0x40,0x04,0x40,0x78,0x20,0x4B,0xFE,0x50,0x 88,0x60,0x50,0x53,0xFE,0x4A,0x00,0x6A,0x00,0x52,0x00,0x44,0x00,0x44,0x00,0x48,0x 00};void delay(uint);void main(){uint zz=0,j=0;while(1){uint i,m=50;ll8=1;lh8=1;while(m--){ for(i=0;i<16;i++){P1=i;P2=table[j];lh8=0;lh8=1;P2=table[++j];ll8=0;//#pragma asm//nop//#pragma endasmll8=1;j++;delay(2);} j=zz;}zz+=32;j=zz;if(j==1792){j=0;zz=0;}}}void delay(uint a){uint x,y;for(x=a;x>0;x--)for(y=60;y>0;y--); }。

LED16×16点阵汉字显示设计(VHDL版)

LED16×16点阵汉字显示设计(VHDL版)

毕业设计(论文)开题报告设计(论文)题基于FPGA的LED 16×16点阵汉字显示设计目一、选题的背景和意义:LED点阵显示屏是集微电子技术、计算机技术、信息处理技术于一体的大型显示屏系统。

它以其色彩鲜艳,动态范围广,亮度高,寿命长,工作稳定可靠等优点而成为众多显示媒体以及户外作业显示的理想选择。

受到体育场馆用LED显示屏需求快速增长的带动,近年来,中国 LED显示屏应用逐步增多。

目前,LED已经广泛应用在银行、火车站、广告、体育场馆之中。

而随着奥运会、世博会的临近,LED显示屏将广泛的应用在体育场馆以及道路交通指示中,LED显示屏在体育广场中的应用将出现快速增长。

因此,本设计是很有必要的,之所以基于FPGA设计是因为现场可编程门阵列(FPGA)设计周期小,灵活度高,适合用于小批量系统,提高系统的可靠性和集成度。

并且采用编写灵活的VHDL语言编写主程序。

本设计可以方便的应用到各类广告宣传中。

二、课题研究的主要内容:1. 实现16×16点阵的汉字显示;2. 实现有限汉字显示;4. 实现汉字的滚动显示;5. 完成方案论证。

三、主要研究(设计)方法论述:通过去图书馆查阅书籍收集资料,同时在搜索引擎上检索资料,分析借鉴已有类似产品、设计方案与成功经验,选择几种可行方案比对,最后确定最切实可行的方案展开设计。

通过Multisim或Quartus软件对系统进行模拟仿真,对电路功能进行改进与完善。

在EDA试验箱上进行调试。

四、设计(论文)进度安排:时间(迄止日期)工作内容2010.5.17-5.23理解并确认毕业设计任务书,撰写完成毕业设计开题报告(第1周)2010.5.24-5.30完成调研与资料收集、整理(第2周)2010.5.31-6.6设计方案及原理框图确定(第3周)2010.6.7-7.4电路资料收集,单元电路设计(第4、5、6、7周)2010.7.5-7.18电路仿真与改进、完善(第8、9周)2010.19-8.1资料整理(第10、11周)2010..8.2-8.8书写毕业设计报告(第12周)2010.8.9-8.16(第13周)修改毕业设计报告并整理装订五、指导教师意见:指导教师签名:年月日六、系部意见:系主任签名:年月日目录摘要ABSTRACT第一章前言 (1)1.1本设计的研究背景和研究目的 (1)1.2LED点阵显示特点 (2)1.3FPGA设计的特点 (2)第二章系统设计 (4)2.1设计任务与要求 (4)2.1.1设计任务 (4)2.1.2设计要求 (4)2.2设计原理 (4)2.2.1总体设计方案 (4)2.2.2方案的比较 (5)2.3扫描控制模块 (6)2.3.1 LED的显示原理 (6)2.3.2汉字的存储 (7)2.4汉字显示 (7)2.4.1列循环扫描 (8)2.4.2字符样式设计 (10)2.4.3字母循环扫描及期间的延时环节 (14)2.5整个完整的程序 (15)第三章系统调试与仿真 (22)3.1开发环境介绍 (22)3.2调试与仿真 (22)3.2.1 创建工程 (22)3.2.2 编译前设置 (23)3.2.3 全程编译 (25)3.2.4时序仿真 (26)第四章结束语 (29)答谢辞 (29)参考文献 (29)摘要主要研究基于VHDL的 Led点阵汉字滚动显示。

C51多汉字显示(16x16点阵)

C51多汉字显示(16x16点阵)

1 采用自编的软件 2 专用的C程序 3 专用的字模软件


系统可以逐个显示多个汉字 系统可以左移显示多个汉字 系统可以上移显示多个汉字


列触发方式采用低电平(0)触发,行触发方式采用高电平(1) 触发 当某点所处的行为1,列为0的时候,该点被点亮
行 列 16 15 14 13 12 11 10 9 8 7 6 5 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 4 3 2 1


void clrscr() { //行驱动低无效 RowLow=(unsigned char)0x00; RowHigh=(unsigned char)0x00; //列驱动高无效 ColLow=(unsigned char)0xff; ColHigh=(unsigned char)0xff; } void lockdisplay() { //行驱动低无效 RowLow=(unsigned char)0x00; RowHigh=(unsigned char)0x00; }


列(一次2个字节)的输入是字模数据,左边字节取 反放入高位字节,右边字节取反放入低位字节 行(一次2个字节)的输入是行选通数据,它与汉字 字模的对应关系是从上到下为
0x8000,0x4000,0x2000,0x1000,0x0800,0x0400,0x0200,0x0100,0x0080,0x0 040,0x0020,0x0010,0x0008,0x0004,0x0002,0x0001
E1 E2 E3
Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
A0 A1
74LS138
A B C Y3 Y2 Y1 Y0 Y4 Y5 Y6 Y7

16×16点阵LED显示汉字

16×16点阵LED显示汉字

以下程序在16×16点阵LED上依次显示“梅川酷子”四个字,分别用正向显示和反向显示,间隔两秒钟变换一次,电路图和效果图下图所示。

AT89 c52晶振频率为24MHz,用T0定时,改变变量flag值,从而让程序确定显示哪个汉字和显示方式(正向or反向)。

#include <atmel\regx52.h>或者#include <reg51.h>#define int8 unsigned char#define int16 unsigned int#define int32 unsigned longint8 flag;/*flag变量MSB 7 6 5 4 3 2 1 0 LSB× ××Bit5=1,Bit4=0 时,负向显示Bit5=0,Bit4=1 时,负向显示Bit[2..0]74HC138的片选信号*/int8 n;int8 code table[][32]={{0x88,0x00,0x88,0x00,0x88,0x7F,0x48,0x00,0xDF,0x1F,0xA8,0x10,0x9C,0x1 2,0xAC,0x14,0xEA,0x7F,0x8A,0x12,0x89,0x14,0x88,0x10,0x88,0x7F,0x08,0x 10,0x08,0x14,0x08,0x08},/*"梅",0*/{0x08,0x20,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x2 1,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x04,0x 21,0x04,0x20,0x02,0x00},/*"川",1*/{0x00,0x08,0xFE,0x08,0x28,0x0A,0x28,0x7E,0xFE,0x0A,0xAA,0x09,0xAA,0xF F,0xEA,0x00,0x86,0x00,0x82,0x7E,0xFE,0x42,0x82,0x42,0x82,0x42,0xFE,0x 7E,0x82,0x42,0x00,0x00},/*"酷",2*/{0x00,0x00,0xF8,0x1F,0x00,0x08,0x00,0x04,0x00,0x02,0x00,0x01,0x00,0x0 1,0x00,0x41,0xFE,0xFF,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x 01,0x40,0x01,0x80,0x00}/*"子",3*/};void delay(void);void main(void){int8 i;int8 j;int8 index;flag=0x10;n=0;//定时器T0初始化TMOD=0x01;TH0=0xb1;TL0=0xe0;ET0=1;EA=1;TR0=1;while(1){index=flag&0x03;if((flag&0x30)==0x10){ //正向显示for(i=0;i<8;i++){ //显示上半屏P0=table[index][2*i];//左上P2=i|0x08;delay();P0=table[index][2*i+1];//右上P2=i|0x10;delay();}for(i=8;i<16;i++){ //显示下半屏P0=table[index][2*i];//左下P2=(i-8)|0x20;delay();P0=table[index][2*i+1];//右下P2=(i-8)|0x40;delay();}}if((flag&0x30)==0x20){ //反向显示for(i=0;i<8;i++){P0=~(table[index][2*i]);//左上P2=i|0x08;delay();P0=~(table[index][2*i+1]);//右上P2=i|0x10;delay();}for(i=8;i<16;i++){P0=~(table[index][2*i]);//左下P2=(i-8)|0x20;delay();P0=~(table[index][2*i+1]);//右下P2=(i-8)|0x40;delay();}}}}void delay(void){int16 i;for(i=0;i<50;i++);}void timer0() interrupt 1 using 3{TF0=0;TH0=0xb1;TL0=0xe0;//10ms中断一次if(n<200){n++;}else{ //2秒改变一次switch(flag){case 0x10:{flag=0x11;//下次显示正向“川”break;}case 0x11:{flag=0x12;//下次显示正向“酷”break;}case 0x12:{flag=0x13;//下次显示正向“子”break;}case 0x13:{flag=0x20;//下次显示负向“川”break;}case 0x20:{flag=0x21;//下次显示负向“梅”break;}case 0x21:{flag=0x22;//下次显示负向“酷”break;}case 0x22:{flag=0x23;//下次显示负向“子”break;}case 0x23:{flag=0x10;//下次显示正向“梅”break;}}n=0;}}。

16X16显示“汉字”

16X16显示“汉字”

这是我玩LED点阵屏的第一块电路板,也是学习单片机入门的第一个实验器材。

它由4片30mm×30mm的8×8红色高亮点阵模块与两片74HC595、两片74HC138、16只8550晶体管、一片74HC244集装在一块宽高65mm×210mm的双面PCB板上,它应该是一组级联安装的LED屏的一个单元模块,拿到它时,我正在学习《无线电》杂志2007/11期刊上杜洋的一组文章,刚刚做好了ISP下载线,只做了“一个发光二极管的控制实验”,面对这个既好玩又陌生的玩意,真是无从下手,通过上网学习,解析研究,前后弄了两个多月,最后在《无线电》杂志2005/12期的配文程序的帮助下,终于踏进了点阵控制的门槛,两年过去了,我又玩了许多单片机控制器件,但这块屏却一直摆在我的桌案上,每当遇到难题时,看看它那稳定清晰的显示,我都能找到许多灵感;最近、在摆弄一块并行驱动的16×64点阵屏时(前几篇文章介绍了)时,因为用的还是这段程序,就又想起了它,虽然程序已经详解过了,但是,为了留记一段经历、一段回忆,决定还是“貂续狗尾”写在这里,留着自己欣赏吧。

一.原理图:二.汉字左右移动驱动程序/**************************************************************************************16×16LED点阵屏原理图及C源汉字左右移动显示驱动程序————wannenggong单片机:AT89S52引脚说明:P0.0/P0.1/P0.2/P0.3控制由两片74HC138组成的行驱动控制4-16译码器的A/B/C/D端P1.0/P1.1控制列驱动控制74HC595的OE/ST端***************************************************************************************/#include <AT89x51.H>#define uchar unsigned char#define uint unsigned int#define K 5 //移动速度控制变量。

51单片机驱动16×16LED点阵显示动画汉字总汇编程序

51单片机驱动16×16LED点阵显示动画汉字总汇编程序

51单片机驱动16×16LED点阵显示动画汉字汇编程序这里提供一个完整的AT89S51单片机驱动驱动led点阵显示具有动画效果的汉字的汇编程序列子.ORG 0000HST: MOV A,#0FFH ;初始化MOV P1,AMOV P2,AMOV P3,AMOV P0,ACLR AMOV R0,#50H ;显示缓存清0MOV R1,#20H ;控制清0的次数ST0: MOV R0,AINC R0DJNZ R1,ST0;正文显示CHINESE: MOV DPTR,#TAB1 ;查表指针指向TAB1LCALL HZ;结束动画SCREE:MOV DPTR,#TAB2;查表指针指向TAB2ACALL DDMOV DPTR,#TAB3;查表指针指向TAB3ACALL DDMOV DPTR,#TAB4;查表指针指向TAB4ACALL DDLJMP CHINESE;显示8幅画面子程序,SCREE专用,用字模软件字要倒置(表必须深256字节)DD: MOV B,#00HMOV R0,#08H ;显示8幅画面AJMP CCCC0: MOV A,BADD A,#20H ;指向下一幅画面MOV B,ACC: MOV R7,#08H ;画面停留时间MOV R3,BMOV 37H,R0LCALL ENTERDIS00: LCALL DISPLAYDJNZ R7,DIS00MOV R0,37HDJNZ R0,CC0RET;汉字上移子程序,可显示8个汉字,(表必须深256字节)HZ: MOV R3,#00H ;查表偏移量MOV R5,#81H ;查表128次MOVBACK: MOV R4,#10H ;使显示完一个汉字MOVBACK0: MOV R7,#02H ;一桢画面显示时间MOV R0,#6DH ;低8位R0指向显示缓存倒数第3个字节,以备与最后1个字节交换MOV R1,#6CH ;高8位R1指向显示缓存倒数第4个字节,以备与倒数第2个字节交换MOV R2,#10H ;存后移的次数DJNZ R5,MOVBACK1RET ;显示完该表,返回MOVBACK1: MOV A,R0 ;低8位被后移的存单元数据暂存入AINC R0 ;后移两字节INC R0MOV R0,A ;放入要移的低8位数据MOV A,R0 ;R0指向下一个要后移的存单元SUBB A,#04HMOV A,R1 ;高8位被后移的存单元数据暂存入A INC R1 ;后移两字节INC R1MOV R1,A ;放入要移高8位的数据MOV A,R1 ;R1指向下一个要后移的存单元SUBB A,#04HMOV R1,A ;R1指向下一个要后移的存单元DJNZ R2,MOVBACK1 ;显示缓存数据依次后移MOV A,R3 ;从表TAB1读入要移进50H,51H的数据MOVC A,A+DPTR;先给50H读数据MOV 50H,AMOV A,R3 ;指向下一字节INC AMOV R3,AMOVC A,A+DPTR;再给51H读数据MOV 51H,AMOV A,R3 ;指向下一字节INC AMOV R3,AMOV 30H,R3 ;保护数据MOV 31H,R4MOV 32H,R5DISMOV: LCALL DISPLAY ;显示当前数据DJNZ R7,DISMOVMOV R3,30HMOV R4,31HMOV R5,32HDJNZ R4,MOVBACK0MOV 30H,R3 ;保护数据MOV R7,#24H ;显示当前数据延时DISMOV0: LCALL DISPLAYDJNZ R7,DISMOV0MOV R3,30HMOV R5,32HLJMP MOVBACK;放进一幅显示数据到显示缓存子程序,要先设好指针DPTR和R3,影响R1,R2,R3 ENTER: MOV R1,#50H ;从50H单元起把表存入MOV R2,#20H ;查表次数MOV A,R3CLLOOP_: MOVC A,A+DPTR ;查表MOV R1,A ;将表放进5X,6X单元INC R1 ;R1指向下一个地址空间MOV A,R3 ;查表指针后移INC AMOV R3,A ;将指针修改结果存入R3DJNZ R2,CLLOOP_;没查完转CLLOOP_RET;15MS,显示子程序,一桢32个字节,影响A,R0,R1,R3,R4,R5,R6;;.51hei./单片机网提供汉字取模工具,可显示任意汉字DISPLAY: MOV A,#0FFHMOV P0,AMOV P1,AMOV P2,AMOV P3,ASETB CMOV R6,#7FH ;赋扫描字初值,左移后初值为0FEHMOV R5,#00H ;列扫描低8位控制MOV R0,#50H ;行的高8(p1)位要显示的数据起始地址MOV R1,#10H ;扫描次数DISLOOP: MOV A,R0 ;从存读数据MOV P2,#0FFH ;装入数据时不显示任何东西MOV P3,#0FFHCPL A ;数据取反以适合显示MOV P1,A ;送入行的高8(p1)位要显示的数据INC R0 ;修改R0指向低8位要显示的数据MOV A,R0 ;读低8位要显示的数据CPL A ;数据取反以适合显示MOV P0,A ;送入行的低8(p0)位要显示的数据INC R0 ;R0指向下一个高8(p0)位要显示的数据LCALL NEXT ;调用列扫描程序LCALL DELAY1MS ;显示延时DJNZ R1,DISLOOP;一桢显示完返回MOV P3,#0FFH ;全灭RET;列扫描子程序DISLOOP专用NEXT: JNC NEXT1 ;C=0转扫描高8(p3)位行MOV A,R6 ;修改扫描字RL AMOV R6,AINC R5CJNE R5,#09H,NEXT0 ;R6=#0FEH时C=0 AJMP NEXT1BACK: RETNEXT0: MOV P2,R6 ;扫描低8(p2)位行AJMP BACKNEXT1: MOV P2,#0FFHMOV P3,R6 ;扫描高8(p3)位行MOV A,R6 ;修改扫描字RL AMOV R6,AAJMP BACK;延时1MS子程序DELAY1MS: MOV R3,#10D0: MOV R4,#50D1: DJNZ R4,D1DJNZ R3,D0RETTAB1:DB 01FH,0F8H,001H,000H,07FH,0FEH,041H,004H,01DH,070H,001H,000H,01DH,070H,000H,000H DB 01FH,0F0H,011H,010H,01FH,0F0H,011H,010H,01FH,0F2H,001H,002H,001H,002H,000H,0FEH;電DB 000H,000H,03FH,0F0H,000H,020H,000H,040H,000H,080H,001H,000H,001H,000H,001H,004HDB 0FFH,0FEH,001H,000H,001H,000H,001H,000H,001H,000H,001H,000H,005H,000H,002H,000H;子DB 008H,000H,008H,0FCH,07EH,084H,008H,084H,0FFH,094H,041H,088H,022H,080H,014H,0FEH DB 07EH,0A4H,008H,0A4H,008H,098H,0FFH,098H,008H,0A4H,008H,0A6H,008H,0C4H,008H,080H;報DB 000H,000H,000H,010H,03FH,0F8H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,004H,07FH,0FEH,000H,000H,000H,000H,000H,000H;二DB 01FH,0F8H,001H,000H,07FH,0FEH,041H,004H,01DH,070H,001H,000H,01DH,070H,002H,080H DB 004H,060H,01AH,01EH,0E1H,008H,01FH,0E0H,000H,040H,002H,080H,001H,000H,001H,000H;零DB 01FH,0F8H,001H,000H,07FH,0FEH,041H,004H,01DH,070H,001H,000H,01DH,070H,002H,080H DB 004H,060H,01AH,01EH,0E1H,008H,01FH,0E0H,000H,040H,002H,080H,001H,000H,001H,000H;零DB 004H,000H,003H,000H,001H,080H,001H,000H,0FFH,0FEH,000H,000H,000H,000H,004H,080HDB 006H,040H,004H,020H,008H,010H,008H,018H,010H,00CH,020H,00CH,040H,008H,000H,000H;六DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;(空) ;结束动画;-- 水纹-- ** 宋体, 12 **; 当前所选字体下一个汉字对应的点阵为: 宽度x高度=128x16, 调整后为: 128x16TAB2:DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,080HDB 001H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,001H,080H,003H,0C0HDB 003H,0C0H,001H,080H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,000H,000H,001H,080H,002H,040H,004H,020H,008H,010HDB 008H,010H,004H,020H,002H,040H,001H,080H,000H,000H,000H,000H,000H,000H,000H,000HDB 000H,000H,001H,0C0H,006H,030H,008H,008H,008H,008H,010H,004H,020H,002H,020H,002HDB 020H,002H,010H,004H,008H,008H,008H,008H,006H,030H,001H,0C0H,000H,000H,000H,000HDB 003H,0C0H,00CH,030H,010H,008H,010H,008H,060H,006H,040H,002H,080H,001H,080H,001HDB 080H,001H,080H,001H,040H,002H,060H,006H,010H,008H,010H,008H,00CH,030H,003H,0C0HDB 000H,000H,038H,01CH,046H,062H,081H,081H,080H,001H,040H,002H,040H,002H,020H,004HDB 020H,004H,040H,002H,040H,002H,080H,001H,081H,081H,046H,062H,038H,01CH,000H,000HDB 0C0H,003H,0A0H,005H,058H,01EH,024H,024H,024H,024H,01EH,078H,005H,0A0H,002H,040HDB 002H,040H,005H,0A0H,01AH,078H,024H,024H,024H,024H,058H,01AH,0A0H,005H,0C0H,003HDB 000H,000H,0C0H,003H,0B0H,00DH,088H,011H,044H,022H,025H,0A4H,012H,048H,00DH,0B0HDB 00DH,0B0H,012H,048H,025H,0A4H,044H,022H,088H,011H,0B0H,00DH,0C0H,003H,000H,000H;--福-- ** 宋体, 12 **; 当前所选字体下一个汉字对应的点阵为: 宽度x高度=16x16, 调整后为: 16x16TAB3:DB 0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0A AHDB 055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H DB 0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H,054H,02AH,0A8H,015H,050H,00AH DB 050H,00AH,0A8H,015H,054H,02AH,0AAH,055H,055H,0AAH,0AAH,055H,055H,0AAH,0AAH,055H DB 0AAH,055H,054H,02AH,0A8H,015H,050H,00AH,0A0H,005H,040H,002H,080H,001H,000H,000HDB 000H,000H,080H,001H,040H,002H,0A0H,005H,050H,00AH,0A8H,015H,054H,02AH,0AAH,055HDB 0A0H,005H,040H,002H,091H,0F9H,000H,000H,074H,0F0H,019H,008H,031H,008H,058H,0F0HDB 014H,000H,011H,0F8H,012H,044H,013H,0FCH,012H,044H,091H,0F9H,040H,002H,0A0H,005HDB 020H,000H,013H,0FEH,010H,000H,0FDH,0FCH,005H,004H,009H,004H,011H,0FCH,030H,000HDB 05BH,0FEH,096H,022H,012H,022H,013H,0FEH,012H,022H,012H,022H,013H,0FEH,012H,002HDB 000H,004H,07FH,0C8H,000H,008H,03FH,0BFH,020H,0A0H,020H,090H,03FH,088H,000H,00CHDB 07FH,0DAH,044H,069H,044H,048H,07FH,0C8H,044H,048H,044H,048H,07FH,0C8H,040H,048HDB 010H,040H,010H,080H,091H,000H,073H,0FFH,014H,080H,018H,040H,040H,0FFH,05EH,092HDB 052H,092H,052H,092H,052H,0FEH,052H,092H,052H,092H,05EH,092H,040H,0FFH,000H,000HDB 012H,002H,013H,0FEH,012H,022H,012H,022H,013H,0FEH,012H,022H,096H,022H,05BH,0FEHDB 030H,000H,011H,0FCH,009H,004H,005H,004H,0FDH,0FCH,010H,000H,013H,0FEH,020H,000HTAB4:DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0C0H,0FFH,0C0H DB 0FEH,000H,0FEH,000H,0F0H,000H,0F0H,007H,0B0H,002H,0C8H,002H,048H,006H,030H,002H;STEP1 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0C0H,0FFH,0C0HDB 0FEH,000H,0FEH,000H,0F6H,000H,0F9H,007H,089H,002H,086H,001H,000H,005H,000H,002H;STEP2 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0C0H,0FFH,0C0HDB 0FEH,0C0H,0FFH,020H,0F1H,020H,0F0H,0C7H,080H,001H,080H,007H,000H,001H,000H,007H;STEP3 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0FFH,0F8H,0FFH,0D8H,0FFH,0E4HDB 0FEH,024H,0FEH,018H,0F0H,000H,0F0H,001H,080H,001H,080H,007H,000H,005H,000H,005H;STEP4 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FBH,0FFH,0FCH,0FFH,0C4H,0FFH,0C3HDB 0FEH,000H,0FEH,000H,0F0H,000H,0F0H,007H,080H,001H,080H,007H,000H,004H,000H,007H;STEP5 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,000H,000H,000H,000H,000H,000HDB 000H,000H,000H,000H,000H,000H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFHDB 000H,000H,0F4H,058H,084H,0D4H,085H,052H,0F5H,052H,085H,052H,086H,054H,0F4H,058HDB 000H,000H,022H,05EH,022H,050H,022H,050H,023H,0DEH,022H,050H,022H,050H,0FAH,05EHEND咕哝了很多天终于成功了,发出来供大家交流,没准儿还能对别人有些帮助,总之百利无一害……点阵大小是16*32的。

16X16点阵显示实验

16X16点阵显示实验

实验报告实验名称: [16X16点阵显示实验]姓名:学号:指导教师:实验时间: [2013年6月15日]信息与通信工程学院16X16点阵显示实验1、实验要求:理解并掌握点阵显示符号的原理,理解原有程序,会使用动态扫描的方式使点阵显示汉字,明白点阵滚动显示的原理。

根据原有程序,掌握LPM_ROM的应用,会应用LPM_ROM存储需要显示的内容。

参照液晶显示程序,编写16*16点阵显示程序。

任务一:实现点阵列扫描。

点亮点阵的一列,并让其不断的向右移动。

任务二:在点阵上循环滚动显示“嵌入式系统设计”。

2、实验原理:2.1点阵基本原理本实验对点阵的扫描使用列扫描的方式。

就是将要显示的数据分成16列,在某一时刻只选中一列,并向点阵传送该列需要显示的数据,那么如果从左往右依次循环选中所有列,并且循环的速度足够快,因为视觉停留效应,我们就能看到完整的显示了。

如果要显示大于16列的信息,比如要显示多个汉字,由于只能同时显示16列,那么就需要在一个比较慢的时钟的指挥下,不断更新要显示的连续的16列数据,使用这样的方法就能实现滚动显示。

2.2任务原理8*8LED点阵共由64个发光二极管组成,每个发光二极管放置在行线和列线的交叉点上,当对应的某一行高电平(置1),且某一列低电平(置0),则相应的发光二极管就亮;因此要用8*8LED点阵来显示一个字符或汉字,只需要根据字符或汉字图形中的线条或笔画,通过点亮多个发光二极管来勾勒出字符或汉字的线条或笔画就行了。

当要比较完美的显示一般的汉字,单个8*8LED点阵模块很难做到,因为LED的点数(也称为像素点)不够多,因此要显示汉字的话,需要多个8*8LED点阵拼合成一个显示屏。

假如用4个8*8LED点阵模块拼成16*16的点阵,即能满足一般汉字的显示。

16×16扫描LED点阵的工作原理同8位扫描数码管类似。

它有16个共阴极输出端口,每个共阴极对应有16个LED显示灯,所以其扫描译码地址需4位信号线(SEL0-SEL3),其汉字扫描码由16位段地址(0-15)输入。

16×16点阵滚动显示汉字c51程序

16×16点阵滚动显示汉字c51程序

16×16点阵滚动显示汉字c51程序给大家共享一个51单片机驱动的16×16点阵滚动显示汉字的程序,是公车上用的。

下载源代码#include#define int8 unsigned char#define int16 unsigned int#define int32 unsigned longint8 flag;int8 n;int8 code table[][32]={欢迎您乘坐广州三汽公司公共汽车大学城2线开往大学城请您坐好扶稳具体的字码省略,请点此处下载本列16×16点阵汉字滚动显示源代码};void delay(void);int16 offset;void main(void){int8 i;int8 *p;flag=0x10;n=0;TMOD=0x01;TH0=0xb1;TL0=0xe0;ET0=1;EA=1;TR0=1;p=&table[0][0];while (1){for (i=0;i<8;i++) //显示左半边屏幕{P0=*(p+offset+2*i);P2=i|0x08; //P2.4=0,P2.3=1 选中U2, 输出扫描码给U6 delay();P0=*(p+offset+2*i+1);P2=i|0x10; //P2.4=1,P2.3=0 选中U3, 输出扫描码给U7 delay();}for (i=8;i<16;i++) //显示右半边屏幕{P0=*(p+offset+2*i);P2=(i-8)|0x20; //P2.5=1 P2.4=0, P2.3=0 选中U4,输出扫描码U8 delay();P0=*(p+offset+2*i+1);P2=(i-8)|0x40; //P2.6=1 P2.5=0, P2.4=0 选中U5,输出扫描码U9 delay();}}}void delay(void){int16 i;for (i=0;i<50;i++);}void timer0() interrupt 1 using 3{TF0=0;TH0=0xb1;TL0=0xe0;if (n1100)offset=0; n=0;}}。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

#include <reg52.h>
#define uchar unsigned char
uchar i,k=15;
sbit xsi=P2^0;
sbit xrck=P2^1;
sbit xsck=P2^2;
sbit ysi=P2^3;
sbit yrck=P2^4;
sbit ysck=P2^5;
uchar code zbm[][32]={
{0x20,0x00,0x20,0x80,0x20,0x80,0xAE,0x5F,0xAA,0x40,0xAA,0x20,0xAA,0x10,0xBF,0x0E
,0xAA,0x10,0xAA,0x20,0xAA,0x40,0xAE,0xDF,0x20,0x40,0x20,0x00,0x20,0x00,0x00,0x00},/*"贵",0*/
{0x00,0x00,0xFE,0xFF,0x02,0x04,0x22,0x08,0x5A,0x04,0x86,0x03,0x00,0x00,0xFE,0x3F
,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0x42,0x10,0xFE,0x3F,0x00,0x00,0x00,0x00},/*"阳",1*/
{0x40,0x00,0x30,0x02,0x10,0x02,0x12,0x02,0x5C,0x02,0x54,0x02,0x50,0x42,0x51,0x82
,0x5E,0x7F,0xD4,0x02,0x50,0x02,0x18,0x02,0x57,0x02,0x32,0x02,0x10,0x02,0x00,0x00},/*"学",2*/
{0xFE,0xFF,0x02,0x00,0x32,0x02,0x4A,0x04,0x86,0x83,0x0C,0x41,0x24,0x31,0x24,0x0F
,0x25,0x01,0x26,0x01,0x24,0x7F,0x24,0x81,0x24,0x81,0x0C,0x81,0x04,0xF1,0x00,0x00},/*"院
",3*/
{0x00,0x00,0x00,0x00,0xF8,0x0F,0x48,0x04,0x48,0x04,0x48,0x04,0x48,0x04,0xFF,0x3F
,0x48,0x44,0x48,0x44,0x48,0x44,0x48,0x44,0xF8,0x4F,0x00,0x40,0x00,0x70,0x00,0x00},/*"电",0*/
{0x00,0x01,0x00,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x41,0x02,0x81,0xE2,0x7F
,0x12,0x01,0x0A,0x01,0x06,0x01,0x02,0x01,0x00,0x01,0x80,0x01,0x00,0x01,0x00,0x00},/*"子",1*/
{0x80,0x00,0x40,0x00,0x30,0x00,0xFC,0x7F,0x07,0x00,0x0A,0x00,0xA8,0x7E,0xA8,0x22
,0xA9,0x22,0xAE,0x22,0xAA,0x22,0xA8,0x22,0xA8,0x7E,0x08,0x00,0x08,0x00,0x00,0x00},/*"信",2*/
{0x00,0x00,0x00,0x20,0x00,0x38,0xFC,0x01,0x54,0x3D,0x54,0x41,0x56,0x41,0x55,0x45
,0x54,0x59,0x54,0x41,0x54,0x41,0xFC,0x71,0x00,0x00,0x00,0x08,0x00,0x30,0x00,0x00},/*"息",3*/
{0x10,0x00,0x10,0x00,0xFF,0x7F,0x10,0x00,0x10,0x00,0x10,0x43,0xC8,0x20,0x08,0x18
,0x08,0x07,0xFF,0x00,0x08,0x20,0x08,0x40,0xF8,0x3F,0x80,0x00,0x00,0x03,0x00,0x00},/*"协",4*/
{0x80,0x00,0x40,0x00,0x40,0x42,0x20,0xE2,0x50,0x52,0x48,0x4A,0x44,0x46,0x43,0x62
,0x44,0x22,0x48,0x22,0x50,0x2A,0x20,0xF2,0x60,0x62,0xC0,0x00,0x40,0x00,0x00,0x00},/*"会",5*/
{0x14,0x20,0x24,0x10,0x44,0x4C,0x84,0x43,0x64,0x43,0x1C,0x2C,0x20,0x20,0x18,0x10
,0x0F,0x0C,0xE8,0x03,0x08,0x06,0x08,0x18,0x28,0x30,0x18,0x60,0x08,0x20,0x00,0x00},/*"欢",6*/
{0x40,0x40,0x41,0x20,0xCE,0x1F,0x04,0x20,0x00,0x40,0xFC,0x47,0x04,0x42,0x02,0x41
,0x02,0x40,0xFC,0x5F,0x04,0x40,0x04,0x42,0x04,0x44,0xFC,0x43,0x00,0x40,0x00,0x00},/*"迎",7*/
{0x80,0x00,0x40,0x00,0xF0,0x7F,0x2C,0x00,0x43,0x10,0x20,0x0C,0x98,0x03,0x0F,0x21
,0x0A,0x40,0xE8,0x3F,0x08,0x00,0x88,0x00,0x28,0x03,0x1C,0x1C,0x08,0x08,0x00,0x00},/*"你",8*/
{0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x5F,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*/
};
void ys (uchar a)//延时
{
uchar b;
for (;a>0;a--)
for (b=100;b>0;b--);
}
void yfs()//Y轴发数
{
ysck=0;
yrck=0;
k++;
if (k==16)
{
k=0;
ysi=0;
}
else
ysi=1;
ysck=1;
xrck=1;
yrck=1;
}
void fs(uchar a) //X轴发数
{
uchar b;
xsck=0;
xrck=0;
for (b=0;b<8;b++)
{
a=a<<1;
//xsi=CY;
xsi=a&0x80;
xsck=1;
xsck=0;
}
}
void gdhs(uchar *zz,uchar N,uchar Time) //流动显示N个汉字滚动函数{ //参数三个:字符串字模首地址、字数、显示流动速度
uchar FontNum,i,j,row; //循环变量,字数计数、16次流动、16列扫描
for(FontNum=0;FontNum<N;FontNum++)
{
for(i=0;i<16;i++) //字到字流动16次左移才能完成
{
for(j=0;j<Time;j++) //显示延迟,决定流动速度
{
k=15;
for(row=0;row<16;row++) //显示16*16屏幕一次
{
yfs(); //选通显示列//行选线,P3 低四位
fs (*(zz+FontNum*32+(i+row)*2+1)); //以移动偏移为基础获取新数据
fs(*(zz+FontNum*32+(i+row)*2)); //获取显示数据循环显示关键算法
ys (12); //适当延时
}
}
}
}
}
void main ()
{
while (1)
{
gdhs(*zbm,10,3);
}
}。

相关文档
最新文档