Asad Irfan
Asad Irfan

Reputation: 131

8051[AT89C51]: Write a program to monitor bit P1.3. When it is high, send 55H to P2

I am trying to solve a question from my book; the program compiles on Keil without any errors, when I check it on Proteus using LED's (that work fine with other similar program) the bit do sets up but the data 55H is not send to port 2, I am including my code as well. Kindly spot any potential error. Thanks

ORG 0
MOV P2,#00H

SETB P1.3
TOGGLE: JB P1.3,SEND

SJMP TOGGLE

SEND:   MOV P2,#055H
SJMP TOGGLE

END      

Upvotes: 1

Views: 4028

Answers (1)

pagliuca
pagliuca

Reputation: 1209

I tried your code on Proteus 7 and it ran without any kind of errors.

The data 55H was sucessfully written to port P2.

Checkout the output of my simulation:

Output of simulation on Proteus 7

Upvotes: 1

Related Questions