• 回复
  • 收藏
  • 点赞
  • 分享
  • 发新帖

义隆单片机的高手请进!!!

PORT6==6
RF==0XF
IOC60==0X6
ADDATA==0XA
ADCON==0X9
ADCMPCON==0XA
GCON==0X9
ADRUN==0X4
ADPD==0X3
ADIF==0X3
STATUS==0X03
C==0
ORG 0
MOV A,@0X11
IOW 0XE
MOV A,@0B000000000
IOW 0X6
MOV A,@88
MOV 0X10,A
LOOP:
MOV A,@0B00001000
MOV 6,A
CALL DELAY2
MOV A,@0B00000000
MOV 6,A
CALL DELAY2
DJZ 0X10
JMP LOOP
MOV A,@0B10001000
MOV 6,A
CALL DELAY2
START:
MOV A,@0B00000001
IOW 0X6
MOV A,@0B00000010
IOW ADCMPCON
MOV A,@0B00000000
IOW ADCON
MOV A,@0B01000000
IOW GCON
CLR ADDATA
MAIN:
NOP
NOP
NOP
CLR 6           (我这个程序编写得有错吗?为什么程序执行
BC RF,ADIF        CLR 6这一步就停止了!
BS ADCON,ADPD
BS ADCON,ADRUN
CALL DELAY2
CALL DELAY2
LOOP1:
JBS RF,ADIF
JMP LOOP1
LOOP2:
JBC ADCON, ADRUN
JMP LOOP2
MOV A,@0B01001100
MOV 0X11,A
MOV A,@0B00110011
MOV 0X12,A
MOV A,@0B00011111
MOV 0X13,A
MOV A,0X11
SUB A,ADDATA
JBC STATUS,C
JMP LOOP3
MOV A,0X12
SUB A,ADDATA
JBC STATUS,C
JMP LOOP4
MOV A,0X13
SUB A,ADDATA
JBC STATUS,C
JMP LOOP5
JMP LOOP6
LOOP3:
MOV A,@0B00001000
MOV 6,A
CALL DELAY2
JMP MAIN
LOOP4:
MOV A,@0B10001100
MOV 6,A
CALL DELAY2
CALL DELAY2
CALL DELAY2
MOV A,@0B00001100
MOV 6,A
CALL DELAY2
CALL DELAY2
CALL DELAY2
JMP MAIN
LOOP5:
MOV A,@0B10001100
MOV 6,A
CALL DELAY2
CALL DELAY2
MOV A,@0B00001100
MOV 6,A
CALL DELAY2
CALL DELAY2
JMP MAIN
LOOP6:
MOV A,@0B10001100
MOV 6,A
CALL DELAY2
MOV A,@0B00001100
MOV 6,A
CALL DELAY2
JMP MAIN
DELAY2:
MOV A,@64
MOV 0X14,A
LOOP7:
MOV A,@48
MOV 0X15,A
LOOP8:
MOV A,@100
MOV 0X16,A
LOOP9:
DJZ 0X16
JMP LOOP9
DJZ 0X15
JMP LOOP8
DJZ 0X14
JMP LOOP7
RET
全部回复(5)
正序查看
倒序查看
yangychun
LV.2
2
2007-04-17 13:00
PORT6 == 6定义有错
应改为
PORT6 == R6
就可以了
0
回复
zbdxdxkj
LV.4
3
2007-04-17 19:32
@yangychun
PORT6==6定义有错应改为PORT6==R6就可以了
高手你好:C语言写的会吗?帮我看看可以吗?程序不工作不知出在哪,先谢了.邮箱:zbdxdxkj@126.com
0
回复
yangychun
LV.2
4
2007-04-20 09:25
@zbdxdxkj
高手你好:C语言写的会吗?帮我看看可以吗?程序不工作不知出在哪,先谢了.邮箱:zbdxdxkj@126.com
编译有通过吗?QQ:271123509,yangychun@163.com
0
回复
zbdxdxkj
LV.4
5
2007-05-25 14:11
@yangychun
编译有通过吗?QQ:271123509,yangychun@163.com
给你发了信息没回,请教一个问题义隆的c编译软件不用仿真器能工做吗?我没仿真器软件出错自动关闭.谢谢!
0
回复
pomya
LV.1
6
2007-06-22 14:51
你的程序写的不合格啊
0
回复