穿行单片机数码管显示示,有几行不是很懂,有人帮忙注释一下吗

The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.The page is temporarily unavailable
nginx error!
The page you are looking for is temporarily unavailable.
Please try again later.
Website Administrator
Something has triggered an error on your
This is the default error page for
nginx that is distributed with
It is located
/usr/share/nginx/html/50x.html
You should customize this error page for your own
site or edit the error_page directive in
the nginx configuration file
/etc/nginx/nginx.conf.求大神帮我注释一下 每行都是什么意思【单片机吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:147,657贴子:
求大神帮我注释一下 每行都是什么意思收藏
以下内存定义;温度BCD码存在34H(百位),33H(十位),32H(个位);读入字节放在值存在36h为首地址的内存,共9字节;温度值存在31h(高8位),30h(低8位) org 00h wendu:mov a,#00h;清内存mov r0,#30hmov r1,#16qingRAM:mov @r0,ainc r0djnz r1,qingRAM kaishi:mov 2ch,34h;将BCD码放入查表指针
mov 2bh,33h
mov 2ah,32h
call settimecewen:nop调用启动传感器子程序 mov r1,#100;扫描数码管约800ms,等待测温完成deng:nop调用数码管显示子程序djnz r1,dengnop调用温度读取程序nop调用BCD码转换程序nop以上是主程序 ;*********************************************;以下是启动传感器转换程序qidong:CALL复位
A, #0CCH;发 SKIP ROM命令
R6, #34H; 延时104us
DJNZ R6, $
MOV A, #44H;发启动测温命令
CALL WRITE
MOV R6, #34H;延时104us
DJNZ R6, $
RET;以上是启动传感器转换程序;******************************************;以下读取温度结果子程序jieguo:CALL复位
MOV A, #0CCH ;发 SKIP ROM命令
CALL WRITE
MOV R6, #34H ;延时104us
MOV A, #0BEH ;发读取转换结果命令
CALL WRITE
R6, #34H;延时104us
MOV R5, #02H;从传感器读取9字节数据(包含温度)
R0, #36H;温度结果存在36H为首地址的内存区
B,#00H jieguo1:
CALL READ;调用读取一个字节子程序
MOV @R0, A;保存温度结果
R0;修改保存内存指针
R5, jieguo1取完9字节的结果?
MOV A, 36h;保存温度信息低字节
MOV 30h, A
A, 37h;保存温度信息高字节
MOV 31h, AjieguoOUT: RET;以上读取温度结果子程序;*********************************************;以下是BCD码转换程序;先判断温度的正负,如正,进行BCD码转换,如负,显示000;若温度高字节最高位为1,则是负温度值;为正时,取高字节低4位、低字节高4位,即为温度值bcd: mov a,31h
jb acc.7,温度正、负? ;为正,则进行BCD码调整zheng:取高字节低4位,低字节高4位,合成一个字节放在acc
anl a,#0f0h
orl a,#0fh
anl a,#0fh
orl a,#0f0h
mov b,#100;BCD码转换
mov 34h,a;存百位BCD码
mov 33h,a;存十位BCD码
mov 32h,b;存个位BCD码
ret fu:mov 32h,#00h;为负,则置BCD码内存单元为0
mov 33h,#00h
mov 34h,#00h
ret;以上是BCD码转换程序;********************************************;以下复位DS18B20子程序;传感器接在P3.7reset:setb p3.7
NOPCLR p3.7MOV
R6, #0A0H; 延时480usDJNZ
R6, #0A0HDJNZ R6, $SETB
R6, #32H ; 延时70usDJNZ
R6,#3CHLOOP1820:MOV
C, p3.7JC resetoutDJNZ
R6,LOOP1820MOV
R6, #064H; 延时200usDJNZ
resetRET resetout:SETB
RET;以上复位DS18B20子程序;*********************************************************;以下写DS18B20的程序(写入一个字节);传感器接在P3.7write:MOV R7, #08H;一个字节8位
NOPwriteLOP: CLR p3.7
MOV R6, #07H; 延时 15us
DJNZ R6, $
MOV p3.7, C
MOV R6, #34H; 延时 104us
DJNZ R6, $
DJNZ R7, writeLOP
RET;以上写DS18B20的程序(写入一个字节);**********************************************************;以下读DS18B20的程序,(读出一个字节的数据);传感器接在P3.7read:
MOV R7, #08H;一个字节8位
NOPREADLOOP: CLR p3.7
R6, #07H; 延时15us
R6, #3CH;延时DELAY 120us
R7, READLOOP
R6, #3CH;DELAY 120us
RET;以上读DS18B20的程序,(读出一个字节的数据) ;***************************************************;以下是1ms延时子程序delay1ms:mov r2,#20
more:mov r3,#250
djnz r2,more
ret;以上是1ms延时;********************************************************;***********************************************;以下是查表子程序;查表指针:2ch,百位;2bh,十位;2ah,个位;查表后得到的显示数据:3ch,百位;3bh,十位;3ah,个位 chabiao:mov dptr,#shuju
mov a,2查表百位movc a,@a+dptr
mov a,2查表十位
movc a,@a+dptr
mov a,2查表个位
movc a,@a+dptr
ret shuju:db 0c0h,0f9h,0a4h,0b0h,99h,92h,83h,0f8h,80h,98h;
9;以上是查表子程序 ;***********************************************************;以下数码管显示子程序settime:call chabiao
setb p3.4;关显示器
mov a,3扫描百位
clr p3.4 call delay11ms延时 setb p3.4;关百位 mov a,3扫描十位 mov p0,aclr p3.5 call delay1ms
setb p3.5 mov a,3扫描个位mov p0,aclr p3.6 call delay1mssetb p3.6 ret
登录百度帐号

我要回帖

更多关于 数码管显示程序 的文章

 

随机推荐