PIC16F87A的二位动态显示程序

[复制链接]
查看1741 | 回复0 | 2011-9-7 22:57:25 | 显示全部楼层 |阅读模式
<





pcl equ 02h
status equ 03h
porta equ 05h
portc equ 07h
trisa equ 85h
trisc equ 87h
adcon1 equ 09fh
count1 equ 20h
count2 equ 21h
count3 equ 22h
t1 equ 23h
t2 equ 24h
org 000h
main
bsf status,5
bcf status,6
movlw 06h
movwf adcon1
movlw 00h
movwf trisa
movwf trisc
bcf status,5
movlw 0ffh
movwf portc
ini_0
clrf count1
clrf count2
clrf count3
disp1
movlw 0ffh
movwf count1
disp
movlw 0ffh
movwf porta
movfw count2
call convert
movwf portc
movlw 0feh
movwf porta
call delay
movfw count3
call convert
movwf portc
movlw 0fdh
movwf porta
call delay
decfsz count1,1
call disp
ini_1
bsf status,0
incf count2,1
movlw 0ah
subwf count2,0
btfss status,0
goto disp1
movlw 0h
movwf count2
incf count3,1
movlw 0ah
subwf count3,0
btfss status,0
goto disp1
call ini_0
delay
movlw 6
movwf t1
l2 movlw .255
movwf t2
l3 decfsz t2,1
goto l3
decfsz t1,1
goto l2
retlw 0
convert
addwf pcl,1
table
retlw 0c0h
retlw 0f9h
retlw 0a4h
retlw 0b0h
retlw 99h
retlw 92h
retlw 82h
retlw 0f8h
retlw 80h
retlw 98h
retlw 7fh
end
热帖推荐
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则