8051 Microcontroller

8051 REGISTER BANKS AND STACK

SECTION 2.7: 8051 REGISTER BANKS AND STACK The 8051 microcontroller has a total of 128 bytes of RAM. In this section we discuss the allocation of these 128 bytes of RAM and examine their usage as registers and stack. RAM memory space allocation in the 8051 There are 128 bytes of RAM in the 8051 […]

JUMP, LOOP, AND CALL INSTRUCTIONS

Upon completion of this chapter, you will be able to: » Code 8051 Assembly language instructions using loops » Code 8051 Assembly language conditional jump instructions » Explain conditions that determine each conditional jump instruction » Code long jump instructions for unconditional jumps » Code short jump instructions for unconditional short jumps » Calculate target […]

LOOP AND JUMP INSTRUCTIONS in 8051

In the sequence of instructions to be executed, it is often necessary to transfer program control to a different location. There are many instructions in the 8051 to achieve this. This chapter covers the control transfer instructions available in 8051 Assembly language. In the first section we discuss instructions used for looping, as well as […]

8051 CALL INSTRUCTIONS

SECTION 3.2: CALL INSTRUCTIONS Another control transfer instruction is the CALL instruction, which is used to call a subroutine. Subroutines are often used to perform tasks that need to be performed frequently. This makes a program more structured in addition to saving memory space. In the 8051 there are two instructions for call: LCALL (long […]

TIME DELAY FOR VARIOUS 8051 CHIPS

SECTION 3.3: TIME DELAY FOR VARIOUS 8051 CHIPS In the last section we used the DELAY subroutine. In this section we discuss how to generate various time delays and calculate exact delays for the 8051 and DS89C4xO. Machine cycle for the 8051 The CPU takes a certain number of clock cycles to execute an instruction. […]

I/O PORT PROGRAMMING

Upon completion of this chapter, you will be able to: » List the 4 ports of the 8051 » Describe the dual role of port 0 in providing both data and addresses » Code Assembly language to use the ports for input or output » Explain the dual role of port 0 and port 2 […]

8051 I/O PROGRAMMING

This chapter describes the I/O port programming of the 8051 with many examples. In Section 4.1, we describe I/O access using byte-size data, and in Section 4.2, bit manipulation of the I/O ports is discussed in detail. SECTION 4.1: 8051 I/O PROGRAMMING In the 8051 there are a total of four ports for I/O operations. […]

8051 I/O BIT MANIPULATION PROGRAMMING

SECTION 4.2: I/O BIT MANIPULATION PROGRAMMING In this section we further examine 8051 I/O instructions. We pay special attention to I/O bit manipulation since it is a powerful and widely used feature of the 8051 family. I/O ports and bit-addressability Sometimes we need to access only 1 or 2 bits of the port instead of […]

8051 ADDRESSING MODES

Upon completion of this chapter, you will be able to: » List the five addressing modes of the 8051 microcontroller » Contrast and compare the addressing modes » Code 8051 Assembly language instructions using each addressing mode » Access RAM using various addressing modes » List the SFR (special function registers) addresses » Discuss how […]

IMMEDIATE AND REGISTER ADDRESSING MODES

The CPU can access data in various ways. The data could be in a register, or in memory, or be provided as an immediate value. These various ways of accessing data are called addressing modes. In this chapter we discuss 8051/52 addressing modes in the context of some examples. The various addressing modes of a […]