STC单片机学习型遥控器程序
SETB ET1 MAIN2:CJNE R1,#00H,MAIN2 T1IN: MOV TL1,ZHIL NEXTT:CPL TXOUT DELAYXMS:MOV R7,#255 DELAYX2MS:MOV R7,#255
BYTE_READ: INC R0
MOV ISP_ADDRH,ADDRH
MOV ISP_ADDRL,R0
DEC R0
CLR EA
MOV ISP_CONTR,#WAIT_TIME
ORL ISP_CONTR,#10000000B
MOV ISP_CMD,#ISP_CMD_READ
MOV ISP_TRIG,#46H
MOV ISP_TRIG,#0B9H
NOP
MOV A,ISP_DATA
MOVX @R0,A
RET
TX_EXROM: MOV TMOD,#00010010B
MOV TH0,#0F4H
MOV TL0,#0F4H
MOV R1,GESHU
MOV R0,#00H
MOVX A,@R0
MOV TL1,A
INC R0
MOVX A,@R0
MOV TH1,A
INC R0
DEC R1
MOVX A,@R0
MOV ZHIL,A
INC R0
MOVX A,@R0
MOV ZHIH,A
INC R0
DEC R1
SETB ET0
SETB EA
SETB TR1
SETB TR0
CLR TXOUT
CLR TXOUT
mov p1,#55h
LJMP KEY_MAIN
T0IN:CPL TXZAI
RETI
MOV TH1,ZHIH
JB TR0,NEXTT1
SETB TR0
LJMP NEXTT
NEXTT1:CLR TR0
CLR TXZAI
MOVX A,@R0
MOV ZHIL,A
INC R0
MOVX A,@R0
MOV ZHIH,A
INC R0
DJNZ R1,OUTTI
CLR TR1
CLR TR0
CLR TXZAI
CLR TXOUT
OUTTI:RETI
DEL1:MOV R6,#4
DEL2:MOV R5,#5
DJNZ R5,$
DJNZ R6,DEL2
DJNZ R7,DEL1
RET
DEL12:MOV R6,#50
DEL22:MOV R5,#50
DJNZ R5,$
DJNZ R6,DEL22
DJNZ R7,DEL12
RET
END
- STC单片机内部EEPROM程序(12-02)
- STC单片机 EEPROM/IAP 功能测试程序演示(12-01)
- stc单片机IO配置与PWM(12-01)
- STC单片机I/O口控制程序(两个不同的跑马灯效果)(12-01)
- STC单片机实现水滴效果程序(12-01)
- STC单片机8个LED闪烁程序(12-01)