Hi,
Could someone take a look at my answer and tell me if it is right?
The question is to modify the following piece of code so the the first delay takes 101us and the second takes 340us?
LJMP BEGIN
ORG 0200H
BEGIN:
SETB P1.6
MOV R0,#26H
LOOP1:
DJNZ R0,LOOP1
CLR P1.6
MOV R0,#26H
LOOP2:
DJNZ R0,LOOP2
JMP BEGIN
END
My answer is:
ORG 0200H
BEGIN:
SETB P1.6
MOV R0,#49
LOOP1:
DJNZ R0,LOOP1
NOP
CLR P1.6
MOV R0,#168
LOOP2:
DJNZ R0,LOOP2
JMP BEGIN
END
I have a simulator but I am unsure exactly where I should put the break-points and if this is meant to be a 50% duty cycle square wave which leads me on to the next question in this assignment.
Thanks
Could someone take a look at my answer and tell me if it is right?
The question is to modify the following piece of code so the the first delay takes 101us and the second takes 340us?
LJMP BEGIN
ORG 0200H
BEGIN:
SETB P1.6
MOV R0,#26H
LOOP1:
DJNZ R0,LOOP1
CLR P1.6
MOV R0,#26H
LOOP2:
DJNZ R0,LOOP2
JMP BEGIN
END
My answer is:
ORG 0200H
BEGIN:
SETB P1.6
MOV R0,#49
LOOP1:
DJNZ R0,LOOP1
NOP
CLR P1.6
MOV R0,#168
LOOP2:
DJNZ R0,LOOP2
JMP BEGIN
END
I have a simulator but I am unsure exactly where I should put the break-points and if this is meant to be a 50% duty cycle square wave which leads me on to the next question in this assignment.
Thanks