Question 4.7: A switch is connected to pin P1.0 and an LED to pin P2.7. Wr...
A switch is connected to pin P1.0 and an LED to pin P2.7. Write a program to get the status of the switch and send it to the LED
The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.
Learn more on how we answer questions.
SETB P1.7 ;make P1.7 an input
AGAIN: MOV C,P1.0 ;read SW status into CF
MOV P2.7,C ;send SW status to LED
SJMP AGAIN ;keep repeating
The instruction ‘MOV P2.7,P1.0’ is wrong , since such an instruction does not exist
However ‘MOV P2,P1’ is a valid instruction
Related Answered Questions
Question: 4.6
Verified Answer:
SETB P1.7 ;make P1.7 an input
AGAIN: ...
Question: 4.5
Verified Answer:
SETB P1.7 ;make P1.7 an input
AGAIN: ...
Question: 4.4
Verified Answer:
HERE: JNB P2.3,HERE ;keep monitorin...
Question: 4.3
Verified Answer:
SETB P1.2 ;make P1.2 an input
MO...
Question: 4.2
Verified Answer:
The 50% duty cycle means that the “on” and “off” s...