BM Dept., Govt. Engg. College, Gandhinagar Page 23
EXPERIMENT NO. 5
AIM: Write a program to ….
• Keep monitoring port pin P1.2 until it becomes high.
• When P1.2 becomes low, write data 45h to port P0.
• Send high to low pulse on pin P2.3.
Program 1: Keep monitoring port pin P1.2 until it becomes high.
ORG 30h
MOV P1,#0FFh ; Configure port P1 as input port
MOV P0,#00h ; Configure port P0 as output port
CLR P2.3 ; Make port pin P2.3 low
CHECK: JNB P1.2, CHECK
MOV P0,#45h
CLR P2.3
END
Circuit Diagram:
• Construct circuit diagram on general purpose microcontroller board /simulator software.
• Assemble and link the program to generate HEX file. Download HEX file into Flash
memory of microcontroller chip 89C51.
• Press the reset button and write your comment about which LEDs are ON and OFF.
Comments to this Manuals