标题:
用8051单片机与1601LCD设计的计算器 汇编语言
[打印本页]
作者:
DeepLiu
时间:
2016-12-16 16:54
标题:
用8051单片机与1601LCD设计的计算器 汇编语言
用8051与1601LCD设计的计算器
protues仿真原理图如下:
0.png
(32.06 KB, 下载次数: 71)
下载附件
2017-1-3 23:23 上传
0.png
(66.29 KB, 下载次数: 41)
下载附件
2017-1-3 23:23 上传
所有资料下载:
40 用8051与1601LCD设计的计算器.rar
(35.26 KB, 下载次数: 25)
2016-12-16 16:53 上传
点击文件名下载附件
下载积分: 黑币 -5
单片机汇编源码(部分内容预览):
/******************************************************************************
************ LABCENTER ELECTRONICS ************
************ Proteus VSM Sample Design Code ************
************ Integer Calculator ( 2K Code Limit) ************
********************************************************************************/
NAME LCD
;Set up Code Segment and exports:
LCD SEGMENT CODE
RSEG LCD
PUBLIC _output
PUBLIC initialise
PUBLIC clearscreen
;LCD Register Addresses.
LCD_CMD_WR equ 00h
LCD_DATA_WR equ 01h
LCD_BUSY_RD equ 02h
LCD_DATA_RD equ 03h
LCD_PAGE equ 80h
;LCD Commands
LCD_CLS equ 1
LCD_HOME equ 2
LCD_SETMODE equ 4
LCD_SETVISIBLE equ 8
LCD_SHIFT equ 16
LCD_SETFUNCTION equ 32
LCD_SETCGADDR equ 64
LCD_SETDDADDR equ 128
; Initialisation Routine for the LCD display.
initialise:
mov A,#030h ;1 line, 8 bits
call wrcmd
mov A,#LCD_SETVISIBLE + 4
call wrcmd
mov A,#LCD_SETDDADDR+15 ; Start at right hand side of the display
call wrcmd
mov A,#LCD_SETMODE + 3 ; Automatic Increment - Display shift left.
call wrcmd
ret
; We move the parameter (held in R7) into the Accumulator prior to writing it.
_output:mov A,R7
call wrdata
ret
;Clears the LCD display and sets the initialisation conditions.
clearscreen:
mov A,#LCD_CLS
call wrcmd
mov A,#LCD_SETDDADDR + 15
call wrcmd
ret
;*****************************
;******** SUBROUTINES ********
;*****************************
;Sub routine to write command:
wrcmd: mov P2,#LCD_PAGE
mov R0,#LCD_CMD_WR
movx @R0,A
jmp wtbusy
; Subroutine to Write a Character to the LCD Display.
wrdata: MOV P2,#LCD_PAGE
MOV R0,#LCD_DATA_WR
MOV A,R7
MOVX @R0,A
; Subroutine to wait for a busy clear.
wtbusy: MOV R1,#LCD_BUSY_RD
MOVX A,@R1
JB ACC.7,wtbusy
ret
END
复制代码
作者:
admin
时间:
2017-1-3 23:26
51黑有你更精彩!!!
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1