文件名称:DCMotor
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [ASM] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 47kb
- 下载次数:
- 0次
- 提 供 者:
- P**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
ADC EQU 35H
CLOCK BIT P2.4 定义ADC0808时钟位
ST BIT P2.5
EOC BIT P2.6
OE BIT P2.7
PWM BIT P3.7
ORG 00H
SJMP START
ORG 0BH
LJMP INT_T0
START: MOV TMOD,#02H
MOV TH0,#20
MOV TL0,#00H
MOV IE,#82H
SETB TR0
WAIT: CLR ST
SETB ST
CLR ST 启动AD转换
JNB EOC,$ 等待转换结束
SETB OE
MOV ADC,P1 读取AD转换结果
CLR OE
SETB PWM PWM输出
MOV A,ADC
LCALL DELAY
CLR PWM
MOV A,#255
SUBB A,ADC
LCALL DELAY
SJMP WAIT
INT_T0: CPL CLOCK 提供ADC0808时钟信号
RETI
DELAY: MOV R6,#1
D1: DJNZ R6,D1
DJNZ ACC,D1
RET
END-fgfdsg
CLOCK BIT P2.4 定义ADC0808时钟位
ST BIT P2.5
EOC BIT P2.6
OE BIT P2.7
PWM BIT P3.7
ORG 00H
SJMP START
ORG 0BH
LJMP INT_T0
START: MOV TMOD,#02H
MOV TH0,#20
MOV TL0,#00H
MOV IE,#82H
SETB TR0
WAIT: CLR ST
SETB ST
CLR ST 启动AD转换
JNB EOC,$ 等待转换结束
SETB OE
MOV ADC,P1 读取AD转换结果
CLR OE
SETB PWM PWM输出
MOV A,ADC
LCALL DELAY
CLR PWM
MOV A,#255
SUBB A,ADC
LCALL DELAY
SJMP WAIT
INT_T0: CPL CLOCK 提供ADC0808时钟信号
RETI
DELAY: MOV R6,#1
D1: DJNZ R6,D1
DJNZ ACC,D1
RET
END-fgfdsg
相关搜索: EoC
(系统自动生成,下载前可以参看下载内容)
下载文件列表
69 DC Motor\Backup Of DC Motor.DBK
...........\DC Motor
...........\DC Motor.asm
...........\DC Motor.DSN
...........\DC Motor.hex
...........\DC Motor.lnp
...........\DC Motor.LST
...........\DC Motor.M51
...........\DC Motor.OBJ
...........\DC Motor.Opt
...........\DC Motor.plg
...........\DC Motor.PWI
...........\DC Motor.Uv2
...........\DC Motor_Uv2.Bak
...........\Last Loaded DC Motor.DBK
69 DC Motor
...........\DC Motor
...........\DC Motor.asm
...........\DC Motor.DSN
...........\DC Motor.hex
...........\DC Motor.lnp
...........\DC Motor.LST
...........\DC Motor.M51
...........\DC Motor.OBJ
...........\DC Motor.Opt
...........\DC Motor.plg
...........\DC Motor.PWI
...........\DC Motor.Uv2
...........\DC Motor_Uv2.Bak
...........\Last Loaded DC Motor.DBK
69 DC Motor