Question

Write an assembly program in which every 2-seconds later, the LED connected to P2.7 is turned...

Write an assembly program in which every 2-seconds later, the LED connected to P2.7 is turned On (for 50 ms in duration) and OFF (for 50 ms in duration) for four times, while at the same time the 8051 is getting data from P1 and sending it to P0 continuously.

We should use interrupt enable IE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ORG 0

LJMP MAIN

ORG 23H

LJMP SERIAL ;jump to serial int ISR

ORG 30H

MAIN: MOV P1,#0FFH ;make P1 an input port

MOV TMOD,#20H ;timer 1, auto reload

MOV TH1,#0FDH ;9600 baud rate

MOV SCON,#50H ;8-bit,1 stop, ren enabled

MOV IE,10010000B ;enable serial int.

SETB TR1 ;start timer 1

BACK: MOV A,P1 ;read data from port 1

MOV P2,A ;send it to P2

SJMP BACK ;stay in loop indefinitely

LJMP MAIN

ORG 000BH ;ISR for Timer 0

CPL P2.7

MOV TL0,#00

MOV TH0,#0DCH

RETI ORG 30H

;--------main program for initialization

MAIN:MOV TM0D,#00000001B ;Timer 0,

Mode 1

MOV TL0,#00

MOV TH0,#0DCH

MOV IE,#82H ;enable Timer 0 interrupt

SETB TR0

HERE:SJMP HERE

END

Add a comment
Know the answer?
Add Answer to:
Write an assembly program in which every 2-seconds later, the LED connected to P2.7 is turned...
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
  • Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e.,...

    Please see the articles below… 1.  What is your opinion on the subject? 2.  Which ethical views (i.e., utilitarian view, moral rights view, justice view, practical view) you feel are being used by both sides of the argument (i.e., for and against downloading) to justify their positions? High Court Enters File-Sharing Spat; Justices Must Determine Software Providers' Liability For Copyright Violations by Anne Marie Squeo. Wall Street Journal. (Eastern edition). New York, N.Y.: Mar 30, 2005. pg. A.2 WASHINGTON -- The Supreme...

  • Read the Article posted below, then answer the following questions: Mergers & acquisitions are a major...

    Read the Article posted below, then answer the following questions: Mergers & acquisitions are a major form of corporate diversification strategy, identify and discuss the top three reasons why most (50-60%) of acquisitions fail to create shareholder value. What are the five major components of “CEMEX Way” and why has this approach been so successful in post-acquisition integration? In your opinion, what can other companies learn from the “CEMEX Way” as a benchmark for acquisition management? Article: CEMEX: Globalization "The...

  • In your judgement, and given only the facts described in this case, should the management of...

    In your judgement, and given only the facts described in this case, should the management of Massey energy Company be held morally responsible for the deaths of the 29 miners? Explain in detail. Suppose that nothing more is learned about the explosion other than what is described in this case. Do you think Don Blankership should be held morally responsible for the deaths of the 29 miners? Explain in detail. Given only the facts described in this case, should the...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

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