Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Jan Waclawek
01/07/12 08:25
Read: 476 times
Bratislava
Slovakia


 
#185372 - works OK here
Responding to: Amit Sengupta's previous message
I tried the following snippet:
$Mod52

AUXR EQU 08Eh

;testing P0 state after MOVX
;if MOVX goes to internal ERAM then it should not modify P0


Main:
;"prologue" - one slow blink with the non-P0 LED only
    mov  P1, #0FFh
    call Delay
    call Delay
    call Delay
    call Delay
    call Delay
    mov  P1, #0
    call Delay
    call Delay
    call Delay
    call Delay
    call Delay


    mov  auxr, #0       ;use ERAM
    mov  dptr, #0022h   ;
    mov  r3, #5
LoopX1:
    mov  P0, #0FFh
    mov  P1, #0FFh
    movx @dptr, a
    call Delay
    mov  P1, #0
    mov  P0, #0
    movx @dptr, a
    call Delay
    djnz r3, LoopX1

    mov  auxr, #2       ;don't use ERAM
    mov  dptr, #0022h
    mov  r3, #5
LoopX2:
    mov  P0, #0FFh
    mov  P1, #0FFh
    movx @dptr, a
    call Delay
    mov  P1, #0
    mov  P0, #0
    movx @dptr, a
    call Delay
    djnz r3, LoopX2

    mov  auxr, #2       ;switch on ERAM but access high address (i.e. XRAM)
    mov  dptr, #2222h
    mov  r3, #5
LoopX3:
    mov  P0, #0FFh
    mov  P1, #0FFh
    movx @dptr, a
    call Delay
    mov  P1, #0
    mov  P0, #0
    movx @dptr, a
    call Delay
    djnz r3, LoopX3


    jmp  Main


;cca 300ms delay
Delay:
    mov r5, #3
DelayX1:
    djnz r7, DelayX1
    djnz r6, DelayX1
    djnz r5, delayx1
    ret



    end

 

in a P89V51RD2BN with a red LED on P0.0 and a yellow on P1.0 - and it works as expected: after a longer light-up of the yellow LED, 5x both LEDs blink, then 10x only the yellow blinks.

Can you please try the same snippet at your place, or post the code you were using for confirming the problem?

JW


List of 7 messages in thread
TopicAuthorDate
Strange Problem in P89v51rd2bn      Amit Sengupta      01/06/12 04:52      
   what is in DPTR?      Jan Waclawek      01/06/12 14:32      
      DPTR = 0x0022      Amit Sengupta      01/06/12 15:19      
         works OK here      Jan Waclawek      01/07/12 08:25      
            BUG in Proteus Simulator      Amit Sengupta      01/07/12 13:07      
      what is OSPI ?      Stefan KAnev      01/06/12 16:08      
         incompetent document conversion?      Jan Waclawek      01/07/12 01:05      

Back to Subject List