Examine the registers of the delay subroutine and make the


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

Request for Solution File

Ask an Expert for Answer!!
Other Engineering: Examine the registers of the delay subroutine and make the
Reference No:- TGS02479404

Expected delivery within 24 Hours