8051 I/O programming

Thread Starter

aghag

Joined Oct 5, 2012
3
1.In 8051,Write a program to take in data through P1.1 and send it out through P2.6?
2.In 8051,Write a program to monitor P1.6. when it is high,send 55H to P2?
3.In 8051,Write a program to monitor the P2.5 bit. when it is high, send 99H to P1. If it is low, send 66H to P1?
4.In 8051,Write a program to get status of P1.7 and put it on P1.2 continuously?
5.In 8051,write a program to generate a square wave of 25% duty cycle on pin P2.5?

NOTE: ALL PROGRAMMING IS DONE IN PINNACLE SOFTWARE USED FOR MICRO CONTROLLER 8051.PLEASE HELP ASAPTHANKS
 

Arm_n_Legs

Joined Mar 7, 2007
186
MOV C,P1.1
MOV P2.6,C

WAIT: JNB P1.6,WAIT
MOV P2,#55H

JNB P2.5,W1
MOV P1,#99H
SJMP W2
W1: MOV P1,#66H
W2: ; continue from there

W1: MOV C,P1.7
MOV P1.2,C
SJMP W1
 

Thread Starter

aghag

Joined Oct 5, 2012
3
MOV C,P1.1
MOV P2.6,C

WAIT: JNB P1.6,WAIT
MOV P2,#55H

JNB P2.5,W1
MOV P1,#99H
SJMP W2
W1: MOV P1,#66H
W2: ; continue from there

W1: MOV C,P1.7
MOV P1.2,C
SJMP W1
can you please also explain which answer is to which i got a little confuse?
 
Top