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

PORT PROBLEM!!!!

Hi everyone.....
Hope u r fine.......
I have a problem in the following code

ORG 00H
BACK:MOV A,#55H
MOV P1,A
ACALL DELAY
MOV A,#0AAH
MOV P1,A
ACALL DELAY
SJMP BACK
DELAY:
MOV R3,#70
H2:MOV R4,#254
H1:DJNZ R4,H1
DJNZ R3,H2
RET
END


Now if i see the output in port P1
I see that
P1:0xAA then 0X55 then 0XAA then 0x55 (repeat continuously......)toggling
Pins:0xAA then 0X55 then 0XAA then 0x55 (repeat continuously......)toggling
Now if i modify my program by just replacing
port P1 by port P0 in all lines
and now if i see output in port P0
i see that..
P1:0xAA then 0X55 then 0XAA then 0X55 (repeat continuously......)toggling
pins:there is no change or toggling
Why is it so??????
Why is there no toggling in output window of port p0 under pins:
pins:No change
P0:toggling
plz help me out......

Parents
  • I am able to duplicate your problem. I modified your code to toggle all four ports and selected a generic 80C51 device.
    All Port pins toggle except P0 after the first output. P0 will set to the first value and then it will no longer display. On a simple eval board the pins do toggle.
    It would appear there is a bug in the simulator for P0.
    Suggest that you contact Keil tech support and reference this thread.

    ORG 00H
    BACK:MOV A,#55H
    MOV P0,A
    MOV P1,A
    MOV P2,A
    MOV P3,A
    ACALL DELAY
    MOV A,#0AAH
    MOV P0,A
    MOV P1,A
    MOV P2,A
    MOV P3,A
    ACALL DELAY
    SJMP BACK
    DELAY:
    MOV R3,#70
    H2:MOV R4,#254
    H1:DJNZ R4,H1
    DJNZ R3,H2
    RET
    


    END
    Erik;
    Do you have additional suggestions?
    Bradford

Reply
  • I am able to duplicate your problem. I modified your code to toggle all four ports and selected a generic 80C51 device.
    All Port pins toggle except P0 after the first output. P0 will set to the first value and then it will no longer display. On a simple eval board the pins do toggle.
    It would appear there is a bug in the simulator for P0.
    Suggest that you contact Keil tech support and reference this thread.

    ORG 00H
    BACK:MOV A,#55H
    MOV P0,A
    MOV P1,A
    MOV P2,A
    MOV P3,A
    ACALL DELAY
    MOV A,#0AAH
    MOV P0,A
    MOV P1,A
    MOV P2,A
    MOV P3,A
    ACALL DELAY
    SJMP BACK
    DELAY:
    MOV R3,#70
    H2:MOV R4,#254
    H1:DJNZ R4,H1
    DJNZ R3,H2
    RET
    


    END
    Erik;
    Do you have additional suggestions?
    Bradford

Children