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.
Is this pull-up resistor "configuration" important if I'm only running the code on the Keil debugger?
"Do you now see an issue with having a loop that multiple times reads and writes the port and tries to shift the result?"
Not exactly. This is my code/issue:
ORG 0000h JMP 0100h ORG 0100h MOV R0,#7 LOOP1: CLR C MOV A,P1 RRC A MOV P1,A ;This one works perfectly DJNZ R0,LOOP1 MOV R0,#7 LOOP2: CLR C MOV A,P1 RLC A MOV P1,A ;But, for some reason, this one just send the ;value to the latch DJNZ R0,LOOP2 END