This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MOV PORT, A not working appropriately.

I'm running this code:

;; Test 8 operations
MOV R0,#08
LOOP: MOV A,P2
JB P1.1, L
RR A
JMP CONT
L: RL A
CONT: MOV P2,A
MOV P2,A
DJNZ R0,LOOP
END

And when I execute (MOV P2,A) it just moves to the latch, not to the pins. So that when I read it again I'll a wrong result.

Parents
  • Hi there,

    I have no pull-up resistor because I'm just debugging it on the keil environment. I don't have the actual components to run it. I'd like to make sure that it is not a programming error before think that it is a bug on the keil debugger.

    My project is not a big deal, it is just homework. So, It is not about the loop, and it is not the specific value in the Accumulator. I'm just wondering why In one loop it set the pin values successfully. And in the next one it doesn't happen.

Reply
  • Hi there,

    I have no pull-up resistor because I'm just debugging it on the keil environment. I don't have the actual components to run it. I'd like to make sure that it is not a programming error before think that it is a bug on the keil debugger.

    My project is not a big deal, it is just homework. So, It is not about the loop, and it is not the specific value in the Accumulator. I'm just wondering why In one loop it set the pin values successfully. And in the next one it doesn't happen.

Children
No data