Question

Lab Activity 2 Test the 8051s ports for input operation as follows: A) Connect each bit of Pl (P1.0-P1.7) of the 8051 to DIP
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MOV A, 0xFF ;A = 0xFF, Move data 0xFF to Accumulator
MOV P1, A : Move data from Accumulator into Port-1
HERE:
MOV A, P1 : Read Data from Port-1
MOV P2, A : Send data from Port- to Port-2

MOV R6,0xC8 ; Load R6 with 200 decimal Value for 200 msec delay
LOOP:
ACALL DELAY
DJNZ R6,LOOP

SJMP HERE ; Keep on doing, infinite loop

DELAY: ; Delay for 1 msec., TL0 and TH0 are computed using Crystal = 11.0592 MHz
MOV TMOD,0x1B ; Sets Timer 0 to MODE1 (16 bit timer). Timer 1 is not used
MOV TH0, 0xFCH ; Loads TH0 register with FCH
MOV TL0, 0x18H ; LOads TL0 register with 18H
SETB TR0 ; Starts the Timer 0
HERE: JNB TF0,HERE ; Loops here until TF0 is set
CLR TR0 ; Stops Timer 0
CLR TF0 ; Clears TF0 flag
RET

Add a comment
Know the answer?
Add Answer to:
Lab Activity 2 Test the 8051's ports for input operation as follows: A) Connect each bit...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT