8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) PDF Download

8051 Clock and Instruction Cycle

In 8051, one instruction cycle consists of twelve (12) clock cycles. Instruction cycle is sometimes called as Machine cycle by some authors.

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

Fig 4.5 : Instruction cycle of 8051 

In 8051, each instruction cycle has six states (S 1 - S 6 ). Each state has two pulses (P1 and P2) 

128 bytes of Internal RAM Structure (lower address space) 

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

Fig 4.6: Internal RAM Structure

The lower 32 bytes are divided into 4 separate banks. Each register bank has 8 registers of one byte each. A register bank is selected depending upon two bank select bits in the PSW register. Next 16bytes are bit addressable. In total, 128bits (16X8) are available in bitaddressable area. Each bit can be accessed and modified by suitable instructions. The bit addresses are from 00H (LSB of the first byte in 20H) to 7FH (MSB of the last byte in 2FH). Remaining 80bytes of RAM are available for general purpose.
Internal Data Memory and Special Function Register (SFR) Map 

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

Fig 4.6 : Internal Data Memory Map 

The special function registers (SFRs) are mapped in the upper 128 bytes of internal data memory address. Hence there is an address overlap between the upper 128 bytes of data RAM and SFRs. Please note that the upper 128 bytes of data RAM are present only in the 8052 family. The lower128 bytes of RAM (00H - 7FH) can be accessed both by direct or indirect addressing while the upper 128 bytes of RAM (80H - FFH) are accessed by indirect addressing.The SFRs (80H - FFH) are accessed by direct addressing only. This feature distinguishes the upper 128 bytes of memory from the SFRs, as shown in fig 4.6. 

SFR Map 

The set of Special Function Registers (SFRs) contains important registers such as Accumulator, Register B, I/O Port latch registers, Stack pointer, Data Pointer, Processor Status Word (PSW) and various control registers. Some of these registers are bit addressable (they are marked with a * in the diagram below). The detailed map of various registers is shown in the following figure.

Address

F8H        
F0HB*       
E8H        
E0HACC*       
D8H        
D0H PSW*       
C8H(T2CON)* (RCAP2L)(RCAP2H)(TL2)(TH2)  
C0H        
B8HIP*       
B0HP3*       
A8H IE*       
A0HP2*       
98H SCON*SBUF      
90HP1*       
88HTCON*TMODTL0TL1TH0TH1  
80HP0*SPDPLDPH   PCON

Fig 4.7: SFR Map

It should be noted hat all registers appearing in the first column are bit addressable. The bit address of a bit in the register is calculated as follows. Bit address of 'b' bit of register 'R' is

Address of register 'R' + b

where 0 ≤ b ≤ 7

Processor Status Word (PSW) Address=D0H

CYACF0RS1RS0OV-P

Fi g 4.8: Processor Status Word

PSW register stores the important status conditions of the microcontroller. It also stores the bank select bits (RS1 & RS0) for register bank selection

Interfacing External Memory 

If external program/data memory are to be interfaced, they are interfaced in the following way. 

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

Fig 4.9: Circuit Diagram for Interfacing of External Memory 

External program memory is fetched if either of the following two conditions are satisfied.

  1. 8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) (Enable Address) is low. The microcontroller by default starts searching for program from external program memory.
  2. PC is higher than FFFH for 8051 or 1FFFH for 8052. 

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) tells the outside world whether the external memory fetched is program memory or data memory. 8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) is user configurable.8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) is processor controlled.

8051 Addressing Modes 

8051 has four addressing modes.

1. Immediate Addressing :

Data is immediately available in the instruction. 

For example -

ADD A, #77; Adds 77 (decimal) to A and stores in A

ADD A, #4DH; Adds 4D (hexadecimal) to A and stores in A 

MOV DPTR, #1000H; Moves 1000 (hexadecimal) to data pointer

2. Bank Addressing or Register Addressing : This way of addressing accesses the bytes in the current register bank. Data is available in the register specified in the instruction. The register bank is decided by 2 bits of Processor Status Word (PSW).

For example-
ADD A, R0; Adds content of R0 to A and stores in A

3.. Direct Addressing :
The address of the data is available in the instruction.

For example -
MOV A, 088H; Moves content of SFR TCON (address 088H)to A

4. Register Indirect Addressing :
The address of data is available in the R0 or R1 registers as specified in the instruction.

For example -
MOV A, @R0 moves content of address pointed by R0 to A
External Data Addressing :
Pointer used for external data addressing can be either R0/R1 (256 byte access) or DPTR (64kbyte access).

For example -
MOVX A, @R0; Moves content of 8-bit address pointed by R0 to A

MOVX A, @DPTR; Moves content of 16-bit address pointed by DPTR to A
External Code Addressing :
Sometimes we may want to store non-volatile data into the ROM e.g. look-up tables. Such data may require reading the code memory. This may be done as follows -

MOVC A, @A+DPTR; Moves content of address pointed by A+DPTR to A

MOVC A, @A+PC; Moves content of address pointed by A+PC to A 

The document 8051 Clock and Instruction Cycle - Computer Science Engineering (CSE) is a part of Computer Science Engineering (CSE) category.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
Are you preparing for Computer Science Engineering (CSE) Exam? Then you should check out the best video lectures, notes, free mock test series, crash course and much more provided by EduRev. You also get your detailed analysis and report cards along with 24x7 doubt solving for you to excel in Computer Science Engineering (CSE) exam. So join EduRev now and revolutionise the way you learn!
Sign up for Free Download App for Free

FAQs on 8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

1. What is the role of the clock in the 8051 microcontroller?
Ans. The clock in the 8051 microcontroller is responsible for generating the timing signals required to execute instructions. It provides the basic timing reference for all the operations of the microcontroller.
2. How does the clock affect the instruction cycle in the 8051 microcontroller?
Ans. The clock determines the speed at which the instruction cycle is executed in the 8051 microcontroller. Each instruction takes a certain number of clock cycles to complete, and the clock frequency determines the overall execution time of the program.
3. Can the clock frequency be changed in the 8051 microcontroller?
Ans. Yes, the clock frequency can be changed in the 8051 microcontroller. It has an internal oscillator circuit that generates a default clock frequency, but this can be adjusted by connecting an external crystal or resonator to the appropriate pins of the microcontroller.
4. What is the maximum clock frequency supported by the 8051 microcontroller?
Ans. The maximum clock frequency supported by the 8051 microcontroller depends on the specific variant or model being used. However, most 8051 microcontrollers can typically operate at frequencies up to 33 MHz.
5. How does the clock frequency affect the overall performance of the 8051 microcontroller?
Ans. The clock frequency directly affects the overall performance of the 8051 microcontroller. A higher clock frequency allows for faster execution of instructions, resulting in improved processing speed. However, increasing the clock frequency may also lead to increased power consumption and electromagnetic interference, so it is important to balance performance requirements with these considerations.
Download as PDF
Related Searches

Sample Paper

,

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

,

past year papers

,

Semester Notes

,

practice quizzes

,

Summary

,

Important questions

,

ppt

,

Free

,

Previous Year Questions with Solutions

,

Extra Questions

,

pdf

,

video lectures

,

study material

,

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

,

mock tests for examination

,

Viva Questions

,

MCQs

,

Objective type Questions

,

8051 Clock and Instruction Cycle - Computer Science Engineering (CSE)

,

shortcuts and tricks

,

Exam

;