Question 4.5: A switch is connected to pin P1.7. Write a program to check ...
A switch is connected to pin P1.7. Write a program to check the status of SW and perform the following:
(a) If SW=0, send letter ‘N’ to P2
(b) If SW=1, send letter ‘Y’′ to P2
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: JB P1.2,OVER ;jump if P1.7=1 MOV P2,#′N′ ;SW=0, issue ′N′ to P2 OVER: MOV P2,#′Y′ ;SW=1, issue ′Y′ to P2 SJMP AGAIN ;keep monitoring |
Related Answered Questions
Question: 4.6
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...
Question: 4.7
Verified Answer:
SETB P1.7 ;make P1.7 an input
AGAIN: ...