Write and assemble a program to toggle all the bits

Assignment Help Other Engineering
Reference no: EM131683876

OBJECTIVES:

- To examine the I/O port operation using a simulator.
- To trace through a CALL subroutine using a simulator.

REFERENCE:

- Mazidi and McKinlay, "The 8051 Microcontroller and Embedded Systems," Chapters 3 and 4.

MATERIALS:
- 8051 assembler and simulator.

ACTIVITY 1

Write and assemble a program to toggle all the bits of P0, P1, and P2 continuously by sending 55H and AAH to these ports. Put a time delay between the "on" and "off" states. Then using the simulator, single-step through the program and examine the ports. Do not single-step through the time delay call.

ACTIVITY 2

Using a simulator, single-step the program in Activity 1. Single-step through the delay subroutine. Examine the registers of the delay subroutine and make the delay shorter or longer by changing the register values.

Value with R5, #10H

Change Delay : Mov R5,#8H

ACTIVITY 3

Using a simulator, write a program to get a byte of data from P1 and send it to P0 and P2. Also, give a copy of it to registers R0, R1, and R2. Single-step the program and examine the ports and registers.

Name: William Ariza Date: 10/9/2017 Class:Microcontroller

1. Upon reset, all the ports of the 8051 are configured as ___output___ (input, output).

2. To make all the bits of a port an input port we must write ___FF_ hex to it.

3. Which ports of the 8051 are bits addressable? All the ports of 8051 is bit addressable

4. What does it mean for port to be "read-modify-write"? this feature means to saves many lines of code by combining in a single instruction all three actions of (1) reading the port, (2) modifying it value, and (3) writing to the port.

5. Write a program to monitor P2.4 continuously. When it becomes low, it sends 55H to P1.

ORG

SETB P2.4                  ; MAKE P2.4 an input

MOV   A, #55H          ;A=55H

JNC P2.4, AGAIN     ; get out when P2.7=1

MOV P1,A                 ; issue A to P1

SETB

Reference no: EM131683876

Questions Cloud

What is the shape of the sampling distribution : What is the shape of the sampling distribution of p1^ - p2^ for two large samples? What are the mean and standard deviation of this sampling distribution?
Write an essay that describes the organizational structure : Write an essay that describes the mission, organizational structure, and the major programs of the U.S. EPA
Nervous and endocrine systems : What do the nervous and endocrine systems have in common according to their functions? Are there some differences in their mechanisms of action?
Describe two instruments used in individual interventions : Describe two instruments used in individual interventions. Describe one organizational structure that is interesting to you.
Write and assemble a program to toggle all the bits : Examine the registers of the delay subroutine and make the delay shorter or longer by changing the register values - Write a program to monitor
Discuss what would its predicted equilibrium concentration : what would its predicted equilibrium concentration (in ppm) in the fat of fish that swim in water containing 0.000040 ppm of that chemical
Calculate the maximum weight for the dominant arm : Make a 99% confidence interval for the mean of the paired differences for the two populations, where a paired difference is equal to the maximum weight.
Does being cold make you sick : Perform a web search for the following ASAP Science Videos:
Commercialize and sell eggs and sperm for reproduction : 1.) Is it ethical to commercialize and sell eggs and sperm for reproduction?

Reviews

Write a Review

Other Engineering Questions & Answers

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd