• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

一起玩转单片机系列(一)51单片机篇(深入浅出)

记得之前我写的液晶显示没,楼主现在教大家怎么写出显示程序,很好玩的东东哦

全部回复(98)
正序查看
倒序查看
2014-04-08 11:06
POETUES是一个很强大的仿真软件,对于程序调试来说,是必备工具,能在无硬件条件下,仿真出实际功能。本人习惯用汇编,其实C语言和汇编各有各的好处。C语言在兼容性好于汇编,汇编在定时功能上更精准。上此功能汇编程序EE.rar大家先看看,有什么看不懂的留言问,加上一些程序,我们还能让液晶屏显示的东西滚动哦,程序在这里~~~~~~EE,RAR大家看见没,点击就能下载了
0
回复
2014-04-08 11:10
@wangchuangwccc
POETUES是一个很强大的仿真软件,对于程序调试来说,是必备工具,能在无硬件条件下,仿真出实际功能。本人习惯用汇编,其实C语言和汇编各有各的好处。C语言在兼容性好于汇编,汇编在定时功能上更精准。上此功能汇编程序EE.rar大家先看看,有什么看不懂的留言问,加上一些程序,我们还能让液晶屏显示的东西滚动哦,程序在这里~~~~~~EE,RAR大家看见没,点击就能下载了
其实软件也没什么难的,指令就那么多,知道定时器,中断怎么用基本所有的功能都能写出来,程序写的多了,心理面就会有一个逻辑,熟练了,看程序就能知道这个功能能不能实现,程序逻辑对不对
0
回复
2014-04-08 11:13
@wangchuangwccc
其实软件也没什么难的,指令就那么多,知道定时器,中断怎么用基本所有的功能都能写出来,程序写的多了,心理面就会有一个逻辑,熟练了,看程序就能知道这个功能能不能实现,程序逻辑对不对
此程序用个字模工具,那就更简单了,只要更换字模生成的代码,就能显示出想要显示的东西,大家多多支持,稍后楼主共享字模工具,很好用的字模工具
0
回复
2014-04-08 11:17

支持原创,顶!

0
回复
yb3215551
LV.1
6
2014-04-08 11:19
支持原创,加油加油~
0
回复
2014-04-08 11:20
 前来学习~~顶~~
0
回复
2014-04-08 11:25
支持原创,顶起!
0
回复
WadeLin
LV.5
9
2014-04-08 11:28
来学习学习王工的作品,求指点。。。
0
回复
jiruliunian
LV.1
10
2014-04-08 11:35

王工,来啦。来啦。

0
回复
yu199a
LV.1
11
2014-04-08 11:37
顶你,王工
0
回复
taoluo1983
LV.2
12
2014-04-08 11:38
虽然不懂单片机,但支持原创,顶顶顶顶顶
0
回复
colamanlee
LV.1
13
2014-04-08 11:39
来一个C语言的就好了  哈哈  arm无爱。。。
0
回复
tangchaobao
LV.4
14
2014-04-08 11:44
@wangchuangwccc
其实软件也没什么难的,指令就那么多,知道定时器,中断怎么用基本所有的功能都能写出来,程序写的多了,心理面就会有一个逻辑,熟练了,看程序就能知道这个功能能不能实现,程序逻辑对不对
俺不懂,进来看看,神马个情况
0
回复
tangchaobao
LV.4
15
2014-04-08 11:45
@davit_zhang
支持原创,顶!

你也在啊?没看出来

0
回复
tangchaobao
LV.4
16
2014-04-08 11:46
@taoluo1983
虽然不懂单片机,但支持原创,顶顶顶顶顶
知道我不?
0
回复
豌豆芽
LV.2
17
2014-04-08 11:46
@colamanlee
来一个C语言的就好了 哈哈 arm无爱。。。
汇编也不错。。。。光哥  威武!!!
0
回复
2014-04-08 11:48

顶贴学习 哈哈哈

0
回复
tangchaobao
LV.4
19
2014-04-08 11:48
@davit_zhang
支持原创,顶!
顶起
0
回复
2014-04-08 13:43
上传字模工具zimo221.zip,我还是直接上程序,顺便解说下程序,让大家更加理解程序原则
0
回复
2014-04-08 14:03
@wangchuangwccc
上传字模工具zimo221.zip,我还是直接上程序,顺便解说下程序,让大家更加理解程序原则

LCM_WR  EQU P2.2

LCM_RD  EQU P2.1

LCM_CE  EQU P2.3

LCM_CD  EQU P2.0

LCM_INT1 EQU P3.3

LCM_RST  EQU P2.4

LCM_CMD  EQU 30H

LCM_DATA EQU 31H

LCM_DATAL EQU 32H

LCM_DATAH EQU 33H

LCM_DATA1 EQU 34H

LCM_DATA2 EQU 35H

LCM_XL  EQU 36H

LCM_YL  EQU 37H

LCM_ADDRL EQU 38H

LCM_ADDRH EQU 39H

LCM_COUNT1 EQU 3AH

LCM_COUNT2 EQU 3BH

LCM_X  EQU 3CH

LCM_Y  EQU 3DH

LCM_ADL EQU 40H

LCM_ADH EQU 41H

;************************************************ 

 ORG 0000H

  AJMP MAIN 

 MAIN:

 NOP 

 CLR LCM_RST             ;显示屏复位

 NOP  

SETB LCM_RST               

 NOP  

LCALL LCM_INIT

;************************************************

LOOP1:                              ;第一部分显示6个字符

 ;LCALL RAM_CLR  

MOV DPTR,#TAB1  

MOV LCM_XL,#6  

MOV LCM_YL,#16

  MOV LCM_ADDRL,#00H             ;字符地址

 MOV LCM_ADDRH,#00H 

 LCALL GPH_DISP

LOOP2: MOV DPTR,#TAB2        ;第二部分显示30个字符

  MOV LCM_XL,#30 

 MOV LCM_YL,#16  

MOV LCM_ADDRL,#224              ;字符地址

MOV LCM_ADDRH,#01H

  LCALL GPH_DISP

LOOP3:  MOV DPTR,#TAB3   ;第三部分显示24个字符

 MOV LCM_XL,#24 

 MOV LCM_YL,#16 

 MOV LCM_ADDRL,#192                ;字符地址

 MOV LCM_ADDRH,#03H  

LCALL GPH_DISP

LOOP4:  MOV DPTR,#TAB4    ;第四部分显示13个字符

MOV LCM_XL,#13  

MOV LCM_YL,#16  

MOV LCM_ADDRL,#167                       ;字符地址

MOV LCM_ADDRH,#05H 

 LCALL GPH_DISP 

 LJMP LOOP1

;****************初始化*********************

LCM_INIT:    

     CLR LCM_CE  

   SETB LCM_WR 

 SETB LCM_RD 

   MOV LCM_DATAL,#00H

  MOV LCM_DATAH,#00H 

     MOV LCM_CMD,#40H  

LCALL WR_TD                            ;设置液晶屏文本首地址

  MOV LCM_DATAL,#00H

  MOV LCM_DATAH,#00H

  MOV LCM_CMD,#42H  

LCALL WR_TD                     ;设置液晶屏图像首地址

   MOV LCM_DATAL,#1EH 

 MOV LCM_DATAH,#00H

  MOV LCM_CMD,#41H 

 LCALL WR_TD                   ;设置文本宽度30个字节

  MOV LCM_DATAL,#1EH  

MOV LCM_DATAH,#00H  

MOV LCM_CMD,#43H 

 LCALL WR_TD                   ;设置图像宽度 30个字节

    MOV LCM_CMD,#88H

  LCALL SEND_I                  ;文本和图像逻辑“或”

 MOV LCM_DATAL,#03H 

 MOV LCM_DATAH,#00H 

 MOV LCM_CMD,#22H  

LCALL WR_TD                   ;CGRAM偏置地址设置

  MOV LCM_CMD,#9CH

  LCALL SEND_I                 ;启用图形显示,启用文本显示

    RET

GPH_DISP:                          ;在LCM_ADDR处画一幅LCM_XL*LCM_YL的图形

 MOV LCM_COUNT1,LCM_YL 

GPH_DISP1: 

MOV LCM_COUNT2,LCM_XL

  MOV LCM_DATAL,LCM_ADDRL 

 MOV LCM_DATAH,LCM_ADDRH 

 MOV LCM_CMD,#24H  

LCALL WR_TD 

 GPH_DISP2:

 CLR  A  

MOVC A,@A+DPTR 

 MOV LCM_DATA,A 

 MOV LCM_CMD,#0C0H 

 LCALL WR_OD                           ;数据写,地址加1

     INC DPTR  

DJNZ LCM_COUNT2,GPH_DISP2

  MOV A,LCM_ADDRL  ADD A,#1EH  

     MOV LCM_ADDRL,A  MOV A,LCM_ADDRH 

 ADDC A,#00H  

MOV LCM_ADDRH,A 

 DJNZ LCM_COUNT1,GPH_DISP1 

 LCALL   DELAY1

  RET

;************************************************

AUTOWR_ON:                   ;启用自动写方式

 MOV LCM_CMD,#0B0H  

 LCALL SEND_I  

RETAUTOWR_OFF:          ;关闭自动写方式

 MOV LCM_CMD,#0B2H  

 LCALL SEND_I  

RET

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WR_TD:                                   ;用LCM_DATAL,LCM_DATAH写数据,LCM_CMD写命令

 MOV LCM_DATA,LCM_DATAL 

 LCALL SEND_D  

MOV LCM_DATA,LCM_DATAH 

 LCALL SEND_D

  LCALL SEND_I 

 RET 

 WR_OD:                                    ;用LCM_DATA写数据,LCM_CMD写命令

LCALL SEND_D  

   LCALL SEND_I 

 RET

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

AUTO_WR:                              ;用LCM_DATA自动写数据

LCALL RD_STA   

  JNB ACC.3,AUTO_WR 

 CLR LCM_CD 

 SETB LCM_RD

  MOV A,LCM_DATA

  MOV P1,A 

 CLR LCM_WR 

 NOP 

 SETB LCM_WR 

 RET

  SEND_I:                          ;用LCM_CMD写命令  

LCALL RD_STA  

   JNB ACC.0,SEND_I  

JNB ACC.1,SEND_I 

 SETB LCM_CD 

 SETB LCM_RD 

 MOV A,LCM_CMD

  MOV P1,A 

 CLR LCM_WR 

 NOP

  SETB LCM_WR

  RET

  SEND_D:                   ;用LCM_DATA写数据

LCALL RD_STA  

  JNB ACC.0,SEND_D 

 JNB ACC.1,SEND_D 

 CLR LCM_CD 

 SETB LCM_RD  

MOV A,LCM_DATA

  MOV P1,A 

 CLR LCM_WR  

NOP 

 SETB LCM_WR 

 RET

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

RAM_CLR:                           ;清屏子程序

MOV LCM_DATAL,#00H 

 MOV LCM_DATAH,#00H 

 MOV LCM_CMD,#24H 

 LCALL WR_TD 

 LCALL AUTOWR_ON 

 MOV LCM_DATA,#00H 

 MOV LCM_COUNT1,#90H

RAM_CLR1:

MOV LCM_COUNT2,#14H

RAM_CLR2:

LCALL AUTO_WR 

 DJNZ LCM_COUNT2,RAM_CLR2 

 DJNZ LCM_COUNT1,RAM_CLR1 

 LCALL AUTOWR_OFF

  RET

;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

;!!!!!!!!!!!!!!!!!!!!!读状态!!!!!!!!!!!!!!!!!!!!!

RD_STA:

 MOV P1,#0FFH 

 SETB LCM_CD 

 SETB LCM_WR 

 CLR LCM_RD 

   NOP

  MOV A,P1  

SETB LCM_RD 

    RET

;*********************DELAY**********************

DELAY1:  MOV R7,#0AH

DEL11:  MOV R6,#0FFH

DEL12:  MOV R5,#0FFH

DEL13:  DJNZ R5,DEL13  

DJNZ R6,DEL12

  DJNZ R7,DEL11 

 RET

;************************************************

TAB1:

;--  文字:  某  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  008H,020H,008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,07FH,0FEH,07FH,0FEH

DB  000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000H,008H,020H

;--  文字:  某  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000H

DB  001H,000H,001H,000H,000H,000H,0FFH,0FEH,0FFH,0FEH,030H,000H,003H,080H,003H,080H

;--  文字:  :  --

;--  Impact12

;  此字体下对应的点阵为:宽x高=16x16   --

DB  030H,000H,005H,040H,005H,040H,000H,000H,019H,030H,019H,030H,030H,000H,061H,00EH

DB  061H,00EH,030H,000H,001H,004H,001H,004H,000H,000H,001H,000H,001H,000H,000H,000H

TAB2:

;--  文字:  第  --

;--  Impact12

;  此字体下对应的点阵为:宽x高=16x16   --

DB  010H,040H,000H,000H,001H,000H,01FH,0F0H,000H,004H,009H,000H,000H,000H,009H,000H

DB  040H,040H,006H,040H,010H,000H,002H,010H,000H,000H,008H,040H,001H,000H,01FH,07EH

;--  文字:  一  --

;--  Impact12

;  此字体下对应的点阵为:宽x高=16x16   --

DB  000H,000H,041H,000H,010H,010H,07FH,084H,009H,080H,000H,000H,009H,080H,020H,040H

DB  038H,050H,010H,000H,041H,020H,07FH,0FCH,00CH,040H,001H,080H,028H,0A0H,000H,000H

;--  文字:  次  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  025H,000H,010H,010H,008H,004H,011H,004H,000H,000H,011H,004H,030H,040H,008H,048H

DB  010H,000H,02FH,0FCH,000H,018H,008H,040H,001H,000H,045H,010H,000H,000H,025H,0FEH

;--  文字:  见  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  011H,010H,012H,024H,013H,0FEH,000H,000H,013H,0FEH,020H,040H,008H,048H,03FH,07CH

DB  020H,080H,000H,060H,018H,040H,003H,000H,09FH,0F8H,000H,000H,02AH,044H,011H,010H

;--  文字:  到  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  021H,024H,022H,004H,000H,000H,022H,004H,000H,040H,008H,040H,024H,044H,001H,000H

DB  001H,080H,010H,040H,002H,040H,000H,088H,000H,000H,00AH,048H,011H,010H,07FH,0A4H

;--  文字:  你  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  034H,048H,000H,000H,034H,048H,000H,07CH,0FFH,0FEH,044H,044H,003H,0F0H,001H,000H

DB  030H,040H,004H,060H,01FH,0F8H,000H,004H,014H,040H,011H,010H,025H,024H,068H,040H

;--  文字:  ,  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  000H,000H,068H,040H,0E0H,040H,008H,040H,084H,044H,0E2H,010H,001H,000H,057H,0FEH

DB  008H,040H,010H,080H,07FH,0FEH,010H,040H,011H,010H,004H,024H,0A2H,050H,000H,000H

;--  文字:  你  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  0A2H,050H,020H,040H,008H,048H,07FH,044H,023H,0F0H,001H,000H,090H,040H,010H,080H

DB  010H,080H,000H,000H,020H,0C0H,012H,090H,004H,024H,023H,048H,000H,000H,023H,048H

;--  文字:  让  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  020H,040H,00EH,028H,008H,044H,022H,010H,001H,000H,010H,040H,020H,080H,01FH,0FCH

DB  000H,000H,0E0H,0A0H,002H,080H,07FH,0A4H,022H,048H,000H,000H,022H,048H,020H,040H

;--  文字:  我  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  038H,030H,00CH,044H,023H,0F0H,001H,000H,010H,040H,001H,000H,001H,084H,000H,000H

DB  041H,020H,004H,080H,004H,024H,024H,044H,000H,000H,024H,044H,020H,040H,0C8H,020H

;--  文字:  知  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  00AH,044H,022H,010H,001H,000H,010H,040H,002H,010H,002H,084H,000H,000H,042H,010H

DB  004H,084H,004H,024H,024H,046H,030H,000H,024H,046H,020H,040H,008H,050H,011H,044H

;--  文字:  道  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  023H,0F0H,001H,000H,010H,040H,004H,008H,00CH,094H,000H,000H,044H,008H,008H,084H

DB  005H,084H,028H,044H,030H,000H,028H,044H,028H,040H,009H,092H,011H,07CH,022H,010H

;--  文字:  了  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  001H,000H,010H,040H,008H,07CH,070H,088H,000H,000H,018H,00EH,030H,086H,00EH,004H

DB  021H,040H,010H,000H,021H,040H,030H,040H,008H,00AH,020H,044H,050H,000H,001H,000H

;--  文字:  什  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  010H,040H,01FH,0C6H,000H,080H,000H,000H,060H,004H,0C0H,07CH,070H,014H,020H,080H

DB  020H,000H,020H,080H,027H,0FEH,028H,006H,040H,040H,08FH,0FEH,005H,000H,010H,040H

;--  文字:  么  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  000H,004H,000H,080H,000H,000H,000H,000H,000H,000H,020H,008H,000H,000H,000H,000H

DB  000H,000H,000H,000H,010H,002H,080H,000H,000H,000H,002H,000H,000H,000H,000H,000H

TAB3:

;--  文字:  是  --

;--  Impact12

;  此字体下对应的点阵为:宽x高=16x16   --

DB  000H,000H,000H,000H,01FH,0F0H,010H,020H,020H,040H,000H,000H,006H,040H,010H,000H

DB  000H,010H,009H,000H,042H,008H,000H,000H,00FH,0F0H,000H,000H,010H,010H,010H,020H

;--  文字:  一  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  020H,040H,000H,000H,038H,050H,010H,0FCH,000H,010H,009H,080H,021H,088H,000H,000H

DB  008H,010H,000H,000H,010H,010H,020H,020H,027H,0FCH,000H,000H,008H,048H,010H,084H

;--  文字:  见  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  07CH,010H,011H,004H,031H,010H,000H,000H,00FH,0F0H,000H,000H,011H,010H,03DH,0FCH

DB  030H,040H,000H,000H,008H,048H,0FEH,0FCH,004H,010H,013H,0FEH,023H,0F8H,000H,000H

;--  文字:  钟  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  008H,010H,000H,000H,011H,010H,041H,024H,0ABH,0F8H,000H,000H,008H,040H,038H,084H

DB  005H,0FEH,022H,004H,002H,008H,000H,000H,00FH,0F0H,000H,000H,011H,010H,07DH,024H

;--  文字:  情  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  0A0H,040H,000H,000H,0FFH,0FEH,034H,0FCH,044H,010H,034H,048H,0E2H,008H,000H,000H

DB  000H,000H,000H,004H,011H,010H,091H,024H,0AFH,0FEH,000H,000H,008H,040H,054H,084H

;--  文字:  。  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  024H,010H,068H,040H,022H,008H,000H,000H,0FFH,0FEH,07FH,0FEH,011H,010H,011H,024H

DB  020H,000H,000H,000H,008H,048H,050H,084H,019H,010H,0A2H,050H,023H,0F8H,000H,000H

;--  文字:  我  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  001H,000H,000H,000H,012H,090H,0FDH,0FCH,023H,0F8H,000H,000H,00EH,028H,090H,0FCH

DB  008H,090H,023H,048H,022H,0A8H,000H,000H,009H,000H,000H,000H,002H,080H,010H,020H

;--  文字:  想  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  022H,008H,000H,000H,038H,030H,000H,000H,014H,0D0H,022H,048H,020H,0A0H,030H,000H

DB  009H,0F8H,000H,000H,004H,080H,010H,020H,023H,0F8H,030H,000H,0C8H,020H,001H,000H

;--  文字:  对  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  024H,090H,024H,044H,020H,0A0H,030H,000H,009H,000H,000H,000H,004H,084H,010H,020H

DB  022H,008H,048H,000H,008H,050H,008H,084H,022H,010H,024H,046H,029H,020H,000H,000H

;--  文字:  你  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  015H,000H,000H,000H,008H,084H,010H,020H,023H,0F8H,048H,000H,009H,092H,028H,082H

DB  042H,010H,028H,044H,031H,022H,030H,000H,023H,000H,000H,000H,030H,086H,014H,020H

;--  文字:  说  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  022H,008H,030H,000H,008H,00AH,028H,012H,080H,010H,021H,040H,022H,022H,030H,000H

DB  040H,0FEH,000H,000H,0C0H,07CH,018H,020H,022H,028H,000H,000H,028H,006H,067H,0F0H

;--  文字:  :  --;--  Impact12;  此字体下对应的点阵为:宽x高=16x16   --

DB  000H,050H,020H,080H,004H,01EH,000H,000H,000H,000H,000H,000H,000H,000H,010H,020H

DB  022H,010H,000H,000H,010H,002H,000H,000H,000H,020H,000H,000H,008H,000H,000H,000H

TAB4:

;--  文字:  I  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

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

;--  文字:     --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

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

;--  文字:  L  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  000H,000H,000H,000H,000H,000H,000H,07CH,000H,0E0H,000H,0C6H,000H,0E7H,0FCH,000H

;--  文字:     --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  0EEH,038H,0E7H,010H,010H,000H,040H,001H,0EFH,000H,042H,042H,000H,044H,044H,042H

;--  文字:  O  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  010H,010H,000H,040H,003H,0FFH,080H,042H,048H,000H,044H,082H,042H,010H,010H,000H

;--  文字:     --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  040H,007H,0FFH,0C0H,044H,048H,000H,028H,082H,042H,010H,010H,000H,040H,007H,0FFH

;--  文字:  V  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  0C0H,024H,078H,000H,028H,082H,042H,010H,010H,000H,040H,003H,0FFH,080H,024H,048H

;--  文字:  E  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  000H,010H,082H,042H,010H,010H,000H,040H,001H,0FFH,000H,028H,048H,000H,010H,082H

;--  文字:     --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  042H,010H,010H,000H,040H,000H,0FEH,000H,028H,040H,000H,010H,082H,042H,000H,010H

;--  文字:  Y  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  000H,040H,000H,07CH,000H,018H,042H,000H,010H,082H,042H,000H,010H,000H,042H,000H

;--  文字:  O  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  038H,000H,010H,042H,000H,010H,044H,042H,018H,07CH,000H,0FEH,000H,010H,000H,010H

;--  文字:  U  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

DB  0FCH,000H,038H,038H,03CH,018H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H

;--  文字:  !  --;--  Impact12;  此字体下对应的点阵为:宽x高=8x16   --

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

END

0
回复
2014-04-08 14:32
@wangchuangwccc
LCM_WR  EQU P2.2LCM_RD  EQU P2.1LCM_CE  EQU P2.3LCM_CD  EQU P2.0LCM_INT1 EQU P3.3LCM_RST  EQU P2.4LCM_CMD  EQU 30HLCM_DATA EQU 31HLCM_DATAL EQU 32HLCM_DATAH EQU 33HLCM_DATA1 EQU 34HLCM_DATA2 EQU 35HLCM_XL  EQU 36HLCM_YL  EQU 37HLCM_ADDRL EQU 38HLCM_ADDRH EQU 39HLCM_COUNT1 EQU 3AHLCM_COUNT2 EQU 3BHLCM_X  EQU 3CHLCM_Y  EQU 3DHLCM_ADL EQU 40HLCM_ADH EQU 41H;************************************************  ORG 0000H  AJMP MAIN  MAIN: NOP  CLR LCM_RST            ;显示屏复位 NOP  SETB LCM_RST                NOP  LCALL LCM_INIT;************************************************LOOP1:                             ;第一部分显示6个字符 ;LCALL RAM_CLR  MOV DPTR,#TAB1  MOV LCM_XL,#6  MOV LCM_YL,#16  MOV LCM_ADDRL,#00H            ;字符地址 MOV LCM_ADDRH,#00H  LCALL GPH_DISPLOOP2: MOV DPTR,#TAB2       ;第二部分显示30个字符  MOV LCM_XL,#30  MOV LCM_YL,#16  MOV LCM_ADDRL,#224             ;字符地址MOV LCM_ADDRH,#01H  LCALL GPH_DISPLOOP3: MOV DPTR,#TAB3  ;第三部分显示24个字符 MOV LCM_XL,#24  MOV LCM_YL,#16  MOV LCM_ADDRL,#192               ;字符地址 MOV LCM_ADDRH,#03H  LCALL GPH_DISPLOOP4: MOV DPTR,#TAB4   ;第四部分显示13个字符MOV LCM_XL,#13  MOV LCM_YL,#16  MOV LCM_ADDRL,#167                      ;字符地址MOV LCM_ADDRH,#05H  LCALL GPH_DISP  LJMP LOOP1;****************初始化*********************LCM_INIT:         CLR LCM_CE    SETB LCM_WR  SETB LCM_RD    MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H      MOV LCM_CMD,#40H  LCALL WR_TD                           ;设置液晶屏文本首地址  MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#42H  LCALL WR_TD                    ;设置液晶屏图像首地址   MOV LCM_DATAL,#1EH  MOV LCM_DATAH,#00H  MOV LCM_CMD,#41H  LCALL WR_TD                  ;设置文本宽度30个字节  MOV LCM_DATAL,#1EH  MOV LCM_DATAH,#00H  MOV LCM_CMD,#43H  LCALL WR_TD                  ;设置图像宽度 30个字节    MOV LCM_CMD,#88H  LCALL SEND_I                 ;文本和图像逻辑“或” MOV LCM_DATAL,#03H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#22H  LCALL WR_TD                  ;CGRAM偏置地址设置  MOV LCM_CMD,#9CH  LCALL SEND_I                ;启用图形显示,启用文本显示    RETGPH_DISP:                         ;在LCM_ADDR处画一幅LCM_XL*LCM_YL的图形 MOV LCM_COUNT1,LCM_YL GPH_DISP1: MOV LCM_COUNT2,LCM_XL  MOV LCM_DATAL,LCM_ADDRL  MOV LCM_DATAH,LCM_ADDRH  MOV LCM_CMD,#24H  LCALL WR_TD  GPH_DISP2: CLR A  MOVC A,@A+DPTR  MOV LCM_DATA,A  MOV LCM_CMD,#0C0H  LCALL WR_OD                           ;数据写,地址加1    INC DPTR  DJNZ LCM_COUNT2,GPH_DISP2  MOV A,LCM_ADDRL  ADD A,#1EH       MOV LCM_ADDRL,A  MOV A,LCM_ADDRH  ADDC A,#00H  MOV LCM_ADDRH,A  DJNZ LCM_COUNT1,GPH_DISP1  LCALL  DELAY1  RET;************************************************AUTOWR_ON:                  ;启用自动写方式 MOV LCM_CMD,#0B0H   LCALL SEND_I  RETAUTOWR_OFF:         ;关闭自动写方式 MOV LCM_CMD,#0B2H   LCALL SEND_I  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WR_TD:                                  ;用LCM_DATAL,LCM_DATAH写数据,LCM_CMD写命令 MOV LCM_DATA,LCM_DATAL  LCALL SEND_D  MOV LCM_DATA,LCM_DATAH  LCALL SEND_D  LCALL SEND_I  RET  WR_OD:                                   ;用LCM_DATA写数据,LCM_CMD写命令LCALL SEND_D     LCALL SEND_I  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!AUTO_WR:                             ;用LCM_DATA自动写数据LCALL RD_STA     JNB ACC.3,AUTO_WR  CLR LCM_CD  SETB LCM_RD  MOV A,LCM_DATA  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET  SEND_I:                          ;用LCM_CMD写命令  LCALL RD_STA     JNB ACC.0,SEND_I  JNB ACC.1,SEND_I  SETB LCM_CD  SETB LCM_RD  MOV A,LCM_CMD  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET  SEND_D:                  ;用LCM_DATA写数据LCALL RD_STA    JNB ACC.0,SEND_D  JNB ACC.1,SEND_D  CLR LCM_CD  SETB LCM_RD  MOV A,LCM_DATA  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RAM_CLR:                          ;清屏子程序MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#24H  LCALL WR_TD  LCALL AUTOWR_ON  MOV LCM_DATA,#00H  MOV LCM_COUNT1,#90HRAM_CLR1:MOV LCM_COUNT2,#14HRAM_CLR2:LCALL AUTO_WR  DJNZ LCM_COUNT2,RAM_CLR2  DJNZ LCM_COUNT1,RAM_CLR1  LCALL AUTOWR_OFF  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;!!!!!!!!!!!!!!!!!!!!!读状态!!!!!!!!!!!!!!!!!!!!!RD_STA: MOV P1,#0FFH  SETB LCM_CD  SETB LCM_WR  CLR LCM_RD    NOP  MOV A,P1  SETB LCM_RD     RET;*********************DELAY**********************DELAY1:  MOV R7,#0AHDEL11:  MOV R6,#0FFHDEL12:  MOV R5,#0FFHDEL13:  DJNZ R5,DEL13  DJNZ R6,DEL12  DJNZ R7,DEL11  RET;************************************************TAB1:;-- 文字: 某 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,020H,008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,07FH,0FEH,07FH,0FEHDB 000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000H,008H,020H;-- 文字: 某 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000HDB 001H,000H,001H,000H,000H,000H,0FFH,0FEH,0FFH,0FEH,030H,000H,003H,080H,003H,080H;-- 文字: : --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 030H,000H,005H,040H,005H,040H,000H,000H,019H,030H,019H,030H,030H,000H,061H,00EHDB 061H,00EH,030H,000H,001H,004H,001H,004H,000H,000H,001H,000H,001H,000H,000H,000HTAB2:;-- 文字: 第 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 010H,040H,000H,000H,001H,000H,01FH,0F0H,000H,004H,009H,000H,000H,000H,009H,000HDB 040H,040H,006H,040H,010H,000H,002H,010H,000H,000H,008H,040H,001H,000H,01FH,07EH;-- 文字: 一 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,041H,000H,010H,010H,07FH,084H,009H,080H,000H,000H,009H,080H,020H,040HDB 038H,050H,010H,000H,041H,020H,07FH,0FCH,00CH,040H,001H,080H,028H,0A0H,000H,000H;-- 文字: 次 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 025H,000H,010H,010H,008H,004H,011H,004H,000H,000H,011H,004H,030H,040H,008H,048HDB 010H,000H,02FH,0FCH,000H,018H,008H,040H,001H,000H,045H,010H,000H,000H,025H,0FEH;-- 文字: 见 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 011H,010H,012H,024H,013H,0FEH,000H,000H,013H,0FEH,020H,040H,008H,048H,03FH,07CHDB 020H,080H,000H,060H,018H,040H,003H,000H,09FH,0F8H,000H,000H,02AH,044H,011H,010H;-- 文字: 到 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 021H,024H,022H,004H,000H,000H,022H,004H,000H,040H,008H,040H,024H,044H,001H,000HDB 001H,080H,010H,040H,002H,040H,000H,088H,000H,000H,00AH,048H,011H,010H,07FH,0A4H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 034H,048H,000H,000H,034H,048H,000H,07CH,0FFH,0FEH,044H,044H,003H,0F0H,001H,000HDB 030H,040H,004H,060H,01FH,0F8H,000H,004H,014H,040H,011H,010H,025H,024H,068H,040H;-- 文字: , --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,068H,040H,0E0H,040H,008H,040H,084H,044H,0E2H,010H,001H,000H,057H,0FEHDB 008H,040H,010H,080H,07FH,0FEH,010H,040H,011H,010H,004H,024H,0A2H,050H,000H,000H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 0A2H,050H,020H,040H,008H,048H,07FH,044H,023H,0F0H,001H,000H,090H,040H,010H,080HDB 010H,080H,000H,000H,020H,0C0H,012H,090H,004H,024H,023H,048H,000H,000H,023H,048H;-- 文字: 让 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 020H,040H,00EH,028H,008H,044H,022H,010H,001H,000H,010H,040H,020H,080H,01FH,0FCHDB 000H,000H,0E0H,0A0H,002H,080H,07FH,0A4H,022H,048H,000H,000H,022H,048H,020H,040H;-- 文字: 我 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 038H,030H,00CH,044H,023H,0F0H,001H,000H,010H,040H,001H,000H,001H,084H,000H,000HDB 041H,020H,004H,080H,004H,024H,024H,044H,000H,000H,024H,044H,020H,040H,0C8H,020H;-- 文字: 知 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 00AH,044H,022H,010H,001H,000H,010H,040H,002H,010H,002H,084H,000H,000H,042H,010HDB 004H,084H,004H,024H,024H,046H,030H,000H,024H,046H,020H,040H,008H,050H,011H,044H;-- 文字: 道 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 023H,0F0H,001H,000H,010H,040H,004H,008H,00CH,094H,000H,000H,044H,008H,008H,084HDB 005H,084H,028H,044H,030H,000H,028H,044H,028H,040H,009H,092H,011H,07CH,022H,010H;-- 文字: 了 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 001H,000H,010H,040H,008H,07CH,070H,088H,000H,000H,018H,00EH,030H,086H,00EH,004HDB 021H,040H,010H,000H,021H,040H,030H,040H,008H,00AH,020H,044H,050H,000H,001H,000H;-- 文字: 什 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 010H,040H,01FH,0C6H,000H,080H,000H,000H,060H,004H,0C0H,07CH,070H,014H,020H,080HDB 020H,000H,020H,080H,027H,0FEH,028H,006H,040H,040H,08FH,0FEH,005H,000H,010H,040H;-- 文字: 么 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,004H,000H,080H,000H,000H,000H,000H,000H,000H,020H,008H,000H,000H,000H,000HDB 000H,000H,000H,000H,010H,002H,080H,000H,000H,000H,002H,000H,000H,000H,000H,000HTAB3:;-- 文字: 是 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,000H,000H,01FH,0F0H,010H,020H,020H,040H,000H,000H,006H,040H,010H,000HDB 000H,010H,009H,000H,042H,008H,000H,000H,00FH,0F0H,000H,000H,010H,010H,010H,020H;-- 文字: 一 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 020H,040H,000H,000H,038H,050H,010H,0FCH,000H,010H,009H,080H,021H,088H,000H,000HDB 008H,010H,000H,000H,010H,010H,020H,020H,027H,0FCH,000H,000H,008H,048H,010H,084H;-- 文字: 见 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 07CH,010H,011H,004H,031H,010H,000H,000H,00FH,0F0H,000H,000H,011H,010H,03DH,0FCHDB 030H,040H,000H,000H,008H,048H,0FEH,0FCH,004H,010H,013H,0FEH,023H,0F8H,000H,000H;-- 文字: 钟 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,010H,000H,000H,011H,010H,041H,024H,0ABH,0F8H,000H,000H,008H,040H,038H,084HDB 005H,0FEH,022H,004H,002H,008H,000H,000H,00FH,0F0H,000H,000H,011H,010H,07DH,024H;-- 文字: 情 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 0A0H,040H,000H,000H,0FFH,0FEH,034H,0FCH,044H,010H,034H,048H,0E2H,008H,000H,000HDB 000H,000H,000H,004H,011H,010H,091H,024H,0AFH,0FEH,000H,000H,008H,040H,054H,084H;-- 文字: 。 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 024H,010H,068H,040H,022H,008H,000H,000H,0FFH,0FEH,07FH,0FEH,011H,010H,011H,024HDB 020H,000H,000H,000H,008H,048H,050H,084H,019H,010H,0A2H,050H,023H,0F8H,000H,000H;-- 文字: 我 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 001H,000H,000H,000H,012H,090H,0FDH,0FCH,023H,0F8H,000H,000H,00EH,028H,090H,0FCHDB 008H,090H,023H,048H,022H,0A8H,000H,000H,009H,000H,000H,000H,002H,080H,010H,020H;-- 文字: 想 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 022H,008H,000H,000H,038H,030H,000H,000H,014H,0D0H,022H,048H,020H,0A0H,030H,000HDB 009H,0F8H,000H,000H,004H,080H,010H,020H,023H,0F8H,030H,000H,0C8H,020H,001H,000H;-- 文字: 对 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 024H,090H,024H,044H,020H,0A0H,030H,000H,009H,000H,000H,000H,004H,084H,010H,020HDB 022H,008H,048H,000H,008H,050H,008H,084H,022H,010H,024H,046H,029H,020H,000H,000H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 015H,000H,000H,000H,008H,084H,010H,020H,023H,0F8H,048H,000H,009H,092H,028H,082HDB 042H,010H,028H,044H,031H,022H,030H,000H,023H,000H,000H,000H,030H,086H,014H,020H;-- 文字: 说 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 022H,008H,030H,000H,008H,00AH,028H,012H,080H,010H,021H,040H,022H,022H,030H,000HDB 040H,0FEH,000H,000H,0C0H,07CH,018H,020H,022H,028H,000H,000H,028H,006H,067H,0F0H;-- 文字: : --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,050H,020H,080H,004H,01EH,000H,000H,000H,000H,000H,000H,000H,000H,010H,020HDB 022H,010H,000H,000H,010H,002H,000H,000H,000H,020H,000H,000H,008H,000H,000H,000HTAB4:;-- 文字: I --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字: L --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,07CH,000H,0E0H,000H,0C6H,000H,0E7H,0FCH,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0EEH,038H,0E7H,010H,010H,000H,040H,001H,0EFH,000H,042H,042H,000H,044H,044H,042H;-- 文字: O --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 010H,010H,000H,040H,003H,0FFH,080H,042H,048H,000H,044H,082H,042H,010H,010H,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 040H,007H,0FFH,0C0H,044H,048H,000H,028H,082H,042H,010H,010H,000H,040H,007H,0FFH;-- 文字: V --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0C0H,024H,078H,000H,028H,082H,042H,010H,010H,000H,040H,003H,0FFH,080H,024H,048H;-- 文字: E --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,010H,082H,042H,010H,010H,000H,040H,001H,0FFH,000H,028H,048H,000H,010H,082H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 042H,010H,010H,000H,040H,000H,0FEH,000H,028H,040H,000H,010H,082H,042H,000H,010H;-- 文字: Y --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,040H,000H,07CH,000H,018H,042H,000H,010H,082H,042H,000H,010H,000H,042H,000H;-- 文字: O --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 038H,000H,010H,042H,000H,010H,044H,042H,018H,07CH,000H,0FEH,000H,010H,000H,010H;-- 文字: U --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0FCH,000H,038H,038H,03CH,018H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字: ! --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HEND
字模工具的使用。

新建一个16*16的图像,然后再文字输入区输入要显示文字

然后点CTRL+回车,点取模方式,可以生成C语言代码或者汇编语言代码

生成的代码,更改模板程序,就可以显示了

0
回复
2014-04-08 14:35
@wangchuangwccc
字模工具的使用。[图片]新建一个16*16的图像,然后再文字输入区输入要显示文字[图片]然后点CTRL+回车,点取模方式,可以生成C语言代码或者汇编语言代码[图片]生成的代码,更改模板程序,就可以显示了

0
回复
2014-04-08 14:46
@wangchuangwccc
[图片]
嗯嗯嗯嗯嗯嗯嗯呢   不错  汇编看不懂
0
回复
太阳wu
LV.2
25
2014-04-08 14:50
@wangchuangwccc
[图片]
0
回复
2014-04-08 14:59
王工全能啊,每次发的帖子都有很多人过来围观,牛
0
回复
dapeng
LV.5
27
2014-04-08 15:16
@wangchuangwccc
LCM_WR  EQU P2.2LCM_RD  EQU P2.1LCM_CE  EQU P2.3LCM_CD  EQU P2.0LCM_INT1 EQU P3.3LCM_RST  EQU P2.4LCM_CMD  EQU 30HLCM_DATA EQU 31HLCM_DATAL EQU 32HLCM_DATAH EQU 33HLCM_DATA1 EQU 34HLCM_DATA2 EQU 35HLCM_XL  EQU 36HLCM_YL  EQU 37HLCM_ADDRL EQU 38HLCM_ADDRH EQU 39HLCM_COUNT1 EQU 3AHLCM_COUNT2 EQU 3BHLCM_X  EQU 3CHLCM_Y  EQU 3DHLCM_ADL EQU 40HLCM_ADH EQU 41H;************************************************  ORG 0000H  AJMP MAIN  MAIN: NOP  CLR LCM_RST            ;显示屏复位 NOP  SETB LCM_RST                NOP  LCALL LCM_INIT;************************************************LOOP1:                             ;第一部分显示6个字符 ;LCALL RAM_CLR  MOV DPTR,#TAB1  MOV LCM_XL,#6  MOV LCM_YL,#16  MOV LCM_ADDRL,#00H            ;字符地址 MOV LCM_ADDRH,#00H  LCALL GPH_DISPLOOP2: MOV DPTR,#TAB2       ;第二部分显示30个字符  MOV LCM_XL,#30  MOV LCM_YL,#16  MOV LCM_ADDRL,#224             ;字符地址MOV LCM_ADDRH,#01H  LCALL GPH_DISPLOOP3: MOV DPTR,#TAB3  ;第三部分显示24个字符 MOV LCM_XL,#24  MOV LCM_YL,#16  MOV LCM_ADDRL,#192               ;字符地址 MOV LCM_ADDRH,#03H  LCALL GPH_DISPLOOP4: MOV DPTR,#TAB4   ;第四部分显示13个字符MOV LCM_XL,#13  MOV LCM_YL,#16  MOV LCM_ADDRL,#167                      ;字符地址MOV LCM_ADDRH,#05H  LCALL GPH_DISP  LJMP LOOP1;****************初始化*********************LCM_INIT:         CLR LCM_CE    SETB LCM_WR  SETB LCM_RD    MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H      MOV LCM_CMD,#40H  LCALL WR_TD                           ;设置液晶屏文本首地址  MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#42H  LCALL WR_TD                    ;设置液晶屏图像首地址   MOV LCM_DATAL,#1EH  MOV LCM_DATAH,#00H  MOV LCM_CMD,#41H  LCALL WR_TD                  ;设置文本宽度30个字节  MOV LCM_DATAL,#1EH  MOV LCM_DATAH,#00H  MOV LCM_CMD,#43H  LCALL WR_TD                  ;设置图像宽度 30个字节    MOV LCM_CMD,#88H  LCALL SEND_I                 ;文本和图像逻辑“或” MOV LCM_DATAL,#03H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#22H  LCALL WR_TD                  ;CGRAM偏置地址设置  MOV LCM_CMD,#9CH  LCALL SEND_I                ;启用图形显示,启用文本显示    RETGPH_DISP:                         ;在LCM_ADDR处画一幅LCM_XL*LCM_YL的图形 MOV LCM_COUNT1,LCM_YL GPH_DISP1: MOV LCM_COUNT2,LCM_XL  MOV LCM_DATAL,LCM_ADDRL  MOV LCM_DATAH,LCM_ADDRH  MOV LCM_CMD,#24H  LCALL WR_TD  GPH_DISP2: CLR A  MOVC A,@A+DPTR  MOV LCM_DATA,A  MOV LCM_CMD,#0C0H  LCALL WR_OD                           ;数据写,地址加1    INC DPTR  DJNZ LCM_COUNT2,GPH_DISP2  MOV A,LCM_ADDRL  ADD A,#1EH       MOV LCM_ADDRL,A  MOV A,LCM_ADDRH  ADDC A,#00H  MOV LCM_ADDRH,A  DJNZ LCM_COUNT1,GPH_DISP1  LCALL  DELAY1  RET;************************************************AUTOWR_ON:                  ;启用自动写方式 MOV LCM_CMD,#0B0H   LCALL SEND_I  RETAUTOWR_OFF:         ;关闭自动写方式 MOV LCM_CMD,#0B2H   LCALL SEND_I  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WR_TD:                                  ;用LCM_DATAL,LCM_DATAH写数据,LCM_CMD写命令 MOV LCM_DATA,LCM_DATAL  LCALL SEND_D  MOV LCM_DATA,LCM_DATAH  LCALL SEND_D  LCALL SEND_I  RET  WR_OD:                                   ;用LCM_DATA写数据,LCM_CMD写命令LCALL SEND_D     LCALL SEND_I  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!AUTO_WR:                             ;用LCM_DATA自动写数据LCALL RD_STA     JNB ACC.3,AUTO_WR  CLR LCM_CD  SETB LCM_RD  MOV A,LCM_DATA  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET  SEND_I:                          ;用LCM_CMD写命令  LCALL RD_STA     JNB ACC.0,SEND_I  JNB ACC.1,SEND_I  SETB LCM_CD  SETB LCM_RD  MOV A,LCM_CMD  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET  SEND_D:                  ;用LCM_DATA写数据LCALL RD_STA    JNB ACC.0,SEND_D  JNB ACC.1,SEND_D  CLR LCM_CD  SETB LCM_RD  MOV A,LCM_DATA  MOV P1,A  CLR LCM_WR  NOP  SETB LCM_WR  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RAM_CLR:                          ;清屏子程序MOV LCM_DATAL,#00H  MOV LCM_DATAH,#00H  MOV LCM_CMD,#24H  LCALL WR_TD  LCALL AUTOWR_ON  MOV LCM_DATA,#00H  MOV LCM_COUNT1,#90HRAM_CLR1:MOV LCM_COUNT2,#14HRAM_CLR2:LCALL AUTO_WR  DJNZ LCM_COUNT2,RAM_CLR2  DJNZ LCM_COUNT1,RAM_CLR1  LCALL AUTOWR_OFF  RET;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;!!!!!!!!!!!!!!!!!!!!!读状态!!!!!!!!!!!!!!!!!!!!!RD_STA: MOV P1,#0FFH  SETB LCM_CD  SETB LCM_WR  CLR LCM_RD    NOP  MOV A,P1  SETB LCM_RD     RET;*********************DELAY**********************DELAY1:  MOV R7,#0AHDEL11:  MOV R6,#0FFHDEL12:  MOV R5,#0FFHDEL13:  DJNZ R5,DEL13  DJNZ R6,DEL12  DJNZ R7,DEL11  RET;************************************************TAB1:;-- 文字: 某 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,020H,008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,07FH,0FEH,07FH,0FEHDB 000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000H,008H,020H;-- 文字: 某 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,020H,000H,000H,008H,020H,008H,020H,000H,000H,00FH,0E0H,00FH,0E0H,000H,000HDB 001H,000H,001H,000H,000H,000H,0FFH,0FEH,0FFH,0FEH,030H,000H,003H,080H,003H,080H;-- 文字: : --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 030H,000H,005H,040H,005H,040H,000H,000H,019H,030H,019H,030H,030H,000H,061H,00EHDB 061H,00EH,030H,000H,001H,004H,001H,004H,000H,000H,001H,000H,001H,000H,000H,000HTAB2:;-- 文字: 第 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 010H,040H,000H,000H,001H,000H,01FH,0F0H,000H,004H,009H,000H,000H,000H,009H,000HDB 040H,040H,006H,040H,010H,000H,002H,010H,000H,000H,008H,040H,001H,000H,01FH,07EH;-- 文字: 一 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,041H,000H,010H,010H,07FH,084H,009H,080H,000H,000H,009H,080H,020H,040HDB 038H,050H,010H,000H,041H,020H,07FH,0FCH,00CH,040H,001H,080H,028H,0A0H,000H,000H;-- 文字: 次 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 025H,000H,010H,010H,008H,004H,011H,004H,000H,000H,011H,004H,030H,040H,008H,048HDB 010H,000H,02FH,0FCH,000H,018H,008H,040H,001H,000H,045H,010H,000H,000H,025H,0FEH;-- 文字: 见 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 011H,010H,012H,024H,013H,0FEH,000H,000H,013H,0FEH,020H,040H,008H,048H,03FH,07CHDB 020H,080H,000H,060H,018H,040H,003H,000H,09FH,0F8H,000H,000H,02AH,044H,011H,010H;-- 文字: 到 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 021H,024H,022H,004H,000H,000H,022H,004H,000H,040H,008H,040H,024H,044H,001H,000HDB 001H,080H,010H,040H,002H,040H,000H,088H,000H,000H,00AH,048H,011H,010H,07FH,0A4H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 034H,048H,000H,000H,034H,048H,000H,07CH,0FFH,0FEH,044H,044H,003H,0F0H,001H,000HDB 030H,040H,004H,060H,01FH,0F8H,000H,004H,014H,040H,011H,010H,025H,024H,068H,040H;-- 文字: , --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,068H,040H,0E0H,040H,008H,040H,084H,044H,0E2H,010H,001H,000H,057H,0FEHDB 008H,040H,010H,080H,07FH,0FEH,010H,040H,011H,010H,004H,024H,0A2H,050H,000H,000H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 0A2H,050H,020H,040H,008H,048H,07FH,044H,023H,0F0H,001H,000H,090H,040H,010H,080HDB 010H,080H,000H,000H,020H,0C0H,012H,090H,004H,024H,023H,048H,000H,000H,023H,048H;-- 文字: 让 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 020H,040H,00EH,028H,008H,044H,022H,010H,001H,000H,010H,040H,020H,080H,01FH,0FCHDB 000H,000H,0E0H,0A0H,002H,080H,07FH,0A4H,022H,048H,000H,000H,022H,048H,020H,040H;-- 文字: 我 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 038H,030H,00CH,044H,023H,0F0H,001H,000H,010H,040H,001H,000H,001H,084H,000H,000HDB 041H,020H,004H,080H,004H,024H,024H,044H,000H,000H,024H,044H,020H,040H,0C8H,020H;-- 文字: 知 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 00AH,044H,022H,010H,001H,000H,010H,040H,002H,010H,002H,084H,000H,000H,042H,010HDB 004H,084H,004H,024H,024H,046H,030H,000H,024H,046H,020H,040H,008H,050H,011H,044H;-- 文字: 道 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 023H,0F0H,001H,000H,010H,040H,004H,008H,00CH,094H,000H,000H,044H,008H,008H,084HDB 005H,084H,028H,044H,030H,000H,028H,044H,028H,040H,009H,092H,011H,07CH,022H,010H;-- 文字: 了 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 001H,000H,010H,040H,008H,07CH,070H,088H,000H,000H,018H,00EH,030H,086H,00EH,004HDB 021H,040H,010H,000H,021H,040H,030H,040H,008H,00AH,020H,044H,050H,000H,001H,000H;-- 文字: 什 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 010H,040H,01FH,0C6H,000H,080H,000H,000H,060H,004H,0C0H,07CH,070H,014H,020H,080HDB 020H,000H,020H,080H,027H,0FEH,028H,006H,040H,040H,08FH,0FEH,005H,000H,010H,040H;-- 文字: 么 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,004H,000H,080H,000H,000H,000H,000H,000H,000H,020H,008H,000H,000H,000H,000HDB 000H,000H,000H,000H,010H,002H,080H,000H,000H,000H,002H,000H,000H,000H,000H,000HTAB3:;-- 文字: 是 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,000H,000H,000H,01FH,0F0H,010H,020H,020H,040H,000H,000H,006H,040H,010H,000HDB 000H,010H,009H,000H,042H,008H,000H,000H,00FH,0F0H,000H,000H,010H,010H,010H,020H;-- 文字: 一 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 020H,040H,000H,000H,038H,050H,010H,0FCH,000H,010H,009H,080H,021H,088H,000H,000HDB 008H,010H,000H,000H,010H,010H,020H,020H,027H,0FCH,000H,000H,008H,048H,010H,084H;-- 文字: 见 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 07CH,010H,011H,004H,031H,010H,000H,000H,00FH,0F0H,000H,000H,011H,010H,03DH,0FCHDB 030H,040H,000H,000H,008H,048H,0FEH,0FCH,004H,010H,013H,0FEH,023H,0F8H,000H,000H;-- 文字: 钟 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 008H,010H,000H,000H,011H,010H,041H,024H,0ABH,0F8H,000H,000H,008H,040H,038H,084HDB 005H,0FEH,022H,004H,002H,008H,000H,000H,00FH,0F0H,000H,000H,011H,010H,07DH,024H;-- 文字: 情 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 0A0H,040H,000H,000H,0FFH,0FEH,034H,0FCH,044H,010H,034H,048H,0E2H,008H,000H,000HDB 000H,000H,000H,004H,011H,010H,091H,024H,0AFH,0FEH,000H,000H,008H,040H,054H,084H;-- 文字: 。 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 024H,010H,068H,040H,022H,008H,000H,000H,0FFH,0FEH,07FH,0FEH,011H,010H,011H,024HDB 020H,000H,000H,000H,008H,048H,050H,084H,019H,010H,0A2H,050H,023H,0F8H,000H,000H;-- 文字: 我 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 001H,000H,000H,000H,012H,090H,0FDH,0FCH,023H,0F8H,000H,000H,00EH,028H,090H,0FCHDB 008H,090H,023H,048H,022H,0A8H,000H,000H,009H,000H,000H,000H,002H,080H,010H,020H;-- 文字: 想 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 022H,008H,000H,000H,038H,030H,000H,000H,014H,0D0H,022H,048H,020H,0A0H,030H,000HDB 009H,0F8H,000H,000H,004H,080H,010H,020H,023H,0F8H,030H,000H,0C8H,020H,001H,000H;-- 文字: 对 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 024H,090H,024H,044H,020H,0A0H,030H,000H,009H,000H,000H,000H,004H,084H,010H,020HDB 022H,008H,048H,000H,008H,050H,008H,084H,022H,010H,024H,046H,029H,020H,000H,000H;-- 文字: 你 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 015H,000H,000H,000H,008H,084H,010H,020H,023H,0F8H,048H,000H,009H,092H,028H,082HDB 042H,010H,028H,044H,031H,022H,030H,000H,023H,000H,000H,000H,030H,086H,014H,020H;-- 文字: 说 --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 022H,008H,030H,000H,008H,00AH,028H,012H,080H,010H,021H,040H,022H,022H,030H,000HDB 040H,0FEH,000H,000H,0C0H,07CH,018H,020H,022H,028H,000H,000H,028H,006H,067H,0F0H;-- 文字: : --;-- Impact12; 此字体下对应的点阵为:宽x高=16x16  --DB 000H,050H,020H,080H,004H,01EH,000H,000H,000H,000H,000H,000H,000H,000H,010H,020HDB 022H,010H,000H,000H,010H,002H,000H,000H,000H,020H,000H,000H,008H,000H,000H,000HTAB4:;-- 文字: I --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字: L --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,07CH,000H,0E0H,000H,0C6H,000H,0E7H,0FCH,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0EEH,038H,0E7H,010H,010H,000H,040H,001H,0EFH,000H,042H,042H,000H,044H,044H,042H;-- 文字: O --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 010H,010H,000H,040H,003H,0FFH,080H,042H,048H,000H,044H,082H,042H,010H,010H,000H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 040H,007H,0FFH,0C0H,044H,048H,000H,028H,082H,042H,010H,010H,000H,040H,007H,0FFH;-- 文字: V --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0C0H,024H,078H,000H,028H,082H,042H,010H,010H,000H,040H,003H,0FFH,080H,024H,048H;-- 文字: E --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,010H,082H,042H,010H,010H,000H,040H,001H,0FFH,000H,028H,048H,000H,010H,082H;-- 文字:    --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 042H,010H,010H,000H,040H,000H,0FEH,000H,028H,040H,000H,010H,082H,042H,000H,010H;-- 文字: Y --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,040H,000H,07CH,000H,018H,042H,000H,010H,082H,042H,000H,010H,000H,042H,000H;-- 文字: O --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 038H,000H,010H,042H,000H,010H,044H,042H,018H,07CH,000H,0FEH,000H,010H,000H,010H;-- 文字: U --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 0FCH,000H,038H,038H,03CH,018H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H;-- 文字: ! --;-- Impact12; 此字体下对应的点阵为:宽x高=8x16  --DB 000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000H,000HEND
太好了,不能不顶
0
回复
2014-04-08 16:52
感谢王工发表的原创好贴,期待更多干货更新!
0
回复
2014-04-08 21:35
学习
0
回复
2014-04-09 11:53
@蚂蚁电源
学习

每次刷新

MOV LCM_ADDRL,#00H             ;字符地址

 MOV LCM_ADDRH,#00H 

以LCM_ADDRL每次加30,加满256,LCM_ADDRH就加1,字幕就可以滚动起来哦,亲们赶快仿真试试。

程序如下:

MOV  A,LCM_ADDRL

ADDC   A,#30

MOV  LCM_ADDRL,A

JNC   L5

MOV  A,LCM_A_ADDRH

ADDC  A,#1

MOV  LCM_A_ADDRH,A

L5:

0
回复
2014-04-09 21:20
@wangchuangwccc
每次刷新MOV LCM_ADDRL,#00H            ;字符地址 MOV LCM_ADDRH,#00H 以LCM_ADDRL每次加30,加满256,LCM_ADDRH就加1,字幕就可以滚动起来哦,亲们赶快仿真试试。程序如下:MOV A,LCM_ADDRLADDC  A,#30MOV LCM_ADDRL,AJNC  L5MOV A,LCM_A_ADDRHADDC A,#1MOV LCM_A_ADDRH,AL5:
呵呵,帖子讲的不是很详细,可能初学者看着有点吃力。写程序只要思路对了,什么都是简单的,毕竟在复杂的程序,也是由几个模块程序组合而成。想当年我在大学的时候,还补考了两门学科,PROTLE99电路设计和英语,全国计算机二级(C语言)也是考了三次才过,现在想起都悲催,谁能想到现在我做着硬件兼软件,经常用PROTLE布板子写程序,汇编也是我们大学老师长得漂亮才认真学的,教C语言的老师很凶,考个及格就算了,没上心学,呵呵。
0
回复