共2条
1/1 1 跳转至页
p0,io 请问p0口做io口使用时,用什么语句可以实现
问
答 1:
加上拉后与P1~P3操作IO相同
答 2:
大哥,我就是不知道用汇编什么语句阿
答 3:
软件无能为力要硬件上拉!
软件无能为力 答 4: REMOV P0,#??
我用过,作显示时,就这么用,下面是我编的频率计源代码,可以看看,是成功的。
P0接CD4511译码显示。呵呵!
//==============================================
//==========中国地质大学========================
//==============地球物理与空间信息学院==========
//===================频率计源代码 设计者:金鱼==
//==============================================
ORG 0000H
AJMP BEGIN
ORG 000BH
AJMP TIME_0
ORG 001BH
AJMP COUNT_1
ORG 0050H
TIME_0: CLR ET1
INC 30H
MOV A,30H
CJNE A,#14H,FINISH
MOV 31H,30H
MOV 30H,#00H
MOV A,42H ;低位42H,高位43H
JZ LABB1
DEC 42H
AJMP FINISH
LABB1: MOV A,43H
JZ FINISH
DEC 43H
MOV 42H,#09H
FINISH: MOV TH0,#3CH ;设定记数时间为50ms
MOV TL0,#0AFH
SETB ET1
RETI
ORG 0090H
BEGIN: MOV 30H,#00H ;辅助定时
MOV 31H,#00H
CLR 01H
MOV 32H,#00H
MOV 70H,#00H
MOV 71H,#00H
MOV 72H,#00H
MOV 73H,#00H
MOV 74H,#02H
CYCLE1:
CLR C
MOV A,TL1
SUBB A,#0E0H
MOV TL1,A
MOV A,TH1
SUBB A,#0B1H
MOV TH1,A
JB 01H,PLAYDIS
ACALL PROCESS1
AJMP LAST
PLAYDIS: ACALL PROCESS2
LAST: CLR 01H
MOV TMOD,#51H
MOV TL0,#0AFH
MOV TH0,#3CH
MOV TH1,#0B1H
MOV TL1,#0E0H
MOV 42H,#01H
MOV 43H,#00H
MOV IE,#8AH
MOV TCON,#50H
CYCLE0: ACALL DISPLAY
MOV A,31H
CJNE A,#14H,CYCLE0
CLR TR0
CLR TR1
CLR ET0
CLR ET1
MOV 31H,#00H
AJMP CYCLE1
PROCESS1:LCALL DIS111
RET
PROCESS2:LCALL DIS111
CY11: MOV A,74H
ADD A,64H
MOV 64H,A
DJNZ 32H,CY11
RET
ORG 0140H
COUNT_1: SETB 01H
INC 32H
MOV TH1,#0B1H
MOV TL1,#0E0H
RETI
ORG 0160H
DISPLAY: SETB 51H
MOV A,64H
JZ NEXT0
CLR 51H
MOV P0,64H
MOV P2,#40H
ACALL DEL_1mS
NEXT0: JNB 51H,DIS0
MOV A,63H
JZ NEXT1
CLR 51H
DIS0: MOV P0,63H
MOV P2,#20H
ACALL DEL_1mS
NEXT1: JNB 51H,DIS1
MOV A,62H
JZ NEXT2
CLR 51H
DIS1: MOV P0,62H
MOV P2,#10H
ACALL DEL_1mS
NEXT2: JNB 51H,DIS2
MOV A,61H
JZ NEXT3
CLR 51H
DIS2: MOV P0,61H
MOV P2,#08H
ACALL DEL_1mS
NEXT3: MOV P0,60H
MOV P2,#04H
ACALL DEL_1mS
NEXT4: MOV P0,#00H
MOV P2,#02H
ACALL DEL_1mS
MOV P0,#00H
MOV P2,#01H
ACALL DEL_1mS
MOV P2,#00H
RET
DEL_1mS: MOV 4FH,#00H
DJNZ 4FH,$
DJNZ 4FH,$
RET
ORG 0200H
CHAG2_10:MOV R5,#00H
MOV R4,#0AH
MOV 3AH,#00H
MOV A,R5
JNZ ZERO
MOV A,R4
JZ OVER
ZERO: MOV A,R7
JNZ START
MOV A,R6
JNZ START
RET
START: CLR A
MOV R2,A
MOV R3,A
MOV 40H,#10H
LOOP: CLR C
MOV A,R6
RLC A
MOV R6,A
MOV A,R7
RLC A
MOV R7,A
MOV A,R2
RLC A
MOV R2,A
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
SUBB A,R4
JC NEXT
MOV 41H,A
MOV A,R3
SUBB A,R5
JC NEXT
INC R6
MOV R3,A
MOV A,41H
MOV R2,A
NEXT: DJNZ 40H,LOOP
OVER: RET
ORG 02A0H
DIS111: MOV R0,#64H
FDISPLAY:
MOV @R0,#00H
DEC R0
CJNE R0,#60H,FDISPLAY
MOV R7,TH1
MOV R6,TL1
DIV10: ACALL CHAG2_10
MOV A,R2
MOV @R0,A
INC R0
CJNE R7,#00H,DIV10
CJNE R6,#00H,DIV10
RET
END
答 5: 打电话0755-28770313-1100我告诉你打电话0755-28770313-1100我告诉你 答 6: 谢谢xjycug 答 7: P0口需上拉或外围电路能提供其灌电流也行!
软件无能为力 答 4: REMOV P0,#??
我用过,作显示时,就这么用,下面是我编的频率计源代码,可以看看,是成功的。
P0接CD4511译码显示。呵呵!
//==============================================
//==========中国地质大学========================
//==============地球物理与空间信息学院==========
//===================频率计源代码 设计者:金鱼==
//==============================================
ORG 0000H
AJMP BEGIN
ORG 000BH
AJMP TIME_0
ORG 001BH
AJMP COUNT_1
ORG 0050H
TIME_0: CLR ET1
INC 30H
MOV A,30H
CJNE A,#14H,FINISH
MOV 31H,30H
MOV 30H,#00H
MOV A,42H ;低位42H,高位43H
JZ LABB1
DEC 42H
AJMP FINISH
LABB1: MOV A,43H
JZ FINISH
DEC 43H
MOV 42H,#09H
FINISH: MOV TH0,#3CH ;设定记数时间为50ms
MOV TL0,#0AFH
SETB ET1
RETI
ORG 0090H
BEGIN: MOV 30H,#00H ;辅助定时
MOV 31H,#00H
CLR 01H
MOV 32H,#00H
MOV 70H,#00H
MOV 71H,#00H
MOV 72H,#00H
MOV 73H,#00H
MOV 74H,#02H
CYCLE1:
CLR C
MOV A,TL1
SUBB A,#0E0H
MOV TL1,A
MOV A,TH1
SUBB A,#0B1H
MOV TH1,A
JB 01H,PLAYDIS
ACALL PROCESS1
AJMP LAST
PLAYDIS: ACALL PROCESS2
LAST: CLR 01H
MOV TMOD,#51H
MOV TL0,#0AFH
MOV TH0,#3CH
MOV TH1,#0B1H
MOV TL1,#0E0H
MOV 42H,#01H
MOV 43H,#00H
MOV IE,#8AH
MOV TCON,#50H
CYCLE0: ACALL DISPLAY
MOV A,31H
CJNE A,#14H,CYCLE0
CLR TR0
CLR TR1
CLR ET0
CLR ET1
MOV 31H,#00H
AJMP CYCLE1
PROCESS1:LCALL DIS111
RET
PROCESS2:LCALL DIS111
CY11: MOV A,74H
ADD A,64H
MOV 64H,A
DJNZ 32H,CY11
RET
ORG 0140H
COUNT_1: SETB 01H
INC 32H
MOV TH1,#0B1H
MOV TL1,#0E0H
RETI
ORG 0160H
DISPLAY: SETB 51H
MOV A,64H
JZ NEXT0
CLR 51H
MOV P0,64H
MOV P2,#40H
ACALL DEL_1mS
NEXT0: JNB 51H,DIS0
MOV A,63H
JZ NEXT1
CLR 51H
DIS0: MOV P0,63H
MOV P2,#20H
ACALL DEL_1mS
NEXT1: JNB 51H,DIS1
MOV A,62H
JZ NEXT2
CLR 51H
DIS1: MOV P0,62H
MOV P2,#10H
ACALL DEL_1mS
NEXT2: JNB 51H,DIS2
MOV A,61H
JZ NEXT3
CLR 51H
DIS2: MOV P0,61H
MOV P2,#08H
ACALL DEL_1mS
NEXT3: MOV P0,60H
MOV P2,#04H
ACALL DEL_1mS
NEXT4: MOV P0,#00H
MOV P2,#02H
ACALL DEL_1mS
MOV P0,#00H
MOV P2,#01H
ACALL DEL_1mS
MOV P2,#00H
RET
DEL_1mS: MOV 4FH,#00H
DJNZ 4FH,$
DJNZ 4FH,$
RET
ORG 0200H
CHAG2_10:MOV R5,#00H
MOV R4,#0AH
MOV 3AH,#00H
MOV A,R5
JNZ ZERO
MOV A,R4
JZ OVER
ZERO: MOV A,R7
JNZ START
MOV A,R6
JNZ START
RET
START: CLR A
MOV R2,A
MOV R3,A
MOV 40H,#10H
LOOP: CLR C
MOV A,R6
RLC A
MOV R6,A
MOV A,R7
RLC A
MOV R7,A
MOV A,R2
RLC A
MOV R2,A
MOV A,R3
RLC A
MOV R3,A
MOV A,R2
SUBB A,R4
JC NEXT
MOV 41H,A
MOV A,R3
SUBB A,R5
JC NEXT
INC R6
MOV R3,A
MOV A,41H
MOV R2,A
NEXT: DJNZ 40H,LOOP
OVER: RET
ORG 02A0H
DIS111: MOV R0,#64H
FDISPLAY:
MOV @R0,#00H
DEC R0
CJNE R0,#60H,FDISPLAY
MOV R7,TH1
MOV R6,TL1
DIV10: ACALL CHAG2_10
MOV A,R2
MOV @R0,A
INC R0
CJNE R7,#00H,DIV10
CJNE R6,#00H,DIV10
RET
END
答 5: 打电话0755-28770313-1100我告诉你打电话0755-28770313-1100我告诉你 答 6: 谢谢xjycug 答 7: P0口需上拉或外围电路能提供其灌电流也行!
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
vscode+cmake搭建雅特力AT32L021开发环境被打赏30分 | |
【换取逻辑分析仪】自制底板并驱动ArduinoNanoRP2040ConnectLCD扩展板被打赏47分 | |
【分享评测,赢取加热台】RISC-V GCC 内嵌汇编使用被打赏38分 | |
【换取逻辑分析仪】-基于ADI单片机MAX78000的简易MP3音乐播放器被打赏48分 | |
我想要一部加热台+树莓派PICO驱动AHT10被打赏38分 | |
【换取逻辑分析仪】-硬件SPI驱动OLED屏幕被打赏36分 | |
换逻辑分析仪+上下拉与多路选择器被打赏29分 | |
Let'sdo第3期任务合集被打赏50分 | |
换逻辑分析仪+Verilog三态门被打赏27分 | |
换逻辑分析仪+Verilog多输出门被打赏24分 |