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

StackOverflow https://stackoverflow.com/questions/20269874

  •  06-08-2022
  •  | 
  •  

سؤال

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      
هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top