0% found this document useful (0 votes)
6 views9 pages

8051 Architecture

The document provides an overview of the architecture and components of the 8051 microcontroller, including its registers such as the Accumulator, B Register, and Program Status Word (PSW). It also describes the function of various special function registers (SFRs), timers, and the serial data buffer. Additionally, it outlines the microcontroller's input/output ports and the role of the timing and control unit in synchronizing operations.

Uploaded by

mvasanthi0460
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

8051 Architecture

The document provides an overview of the architecture and components of the 8051 microcontroller, including its registers such as the Accumulator, B Register, and Program Status Word (PSW). It also describes the function of various special function registers (SFRs), timers, and the serial data buffer. Additionally, it outlines the microcontroller's input/output ports and the role of the timing and control unit in synchronizing operations.

Uploaded by

mvasanthi0460
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 9
7-2 KAM imen wn 16-bit) 2 0 pins | serial port 32 jnterrupt sources (Reset not included) aan CHITECTURE OF 8054 micro CONTROLLER i F The figure shows the basic architec ture of 805] micro controller. Itconsists of Accumulator (Acc) B - Register Temporary tegister Arithmatic logic unit (ALU) Program status word (PSW) Timing and control unit. Stack pointer (SP) Program counter (PC) Data pointer (DPTR) oe ND HF WH 10. Control register[Special function Register (SFR)] 1. Serial Data Buffer 12. Instruction register. 3. VO Ports M4, Counters and timers 15, Oscillator. Driver EPROM/ I TR AM Address Register RAM c tL Program Address J Register ROM tac) pointer I & | PCON|[SCON|TMOD|TCON| [SRegister ] [Temp 2 TEMP 1 THO | THI [TLO | TLI Timing and control SBUF| IE IP PC Incrementer Interrupt serial port & Timer control Program counter DPTR & 8 F a, 4g. 12.2 Architecture af SOE? controller qumulator: ct s Accumulator is an 8 ~ pip regist ster, It is also called a ‘ay Tegister, , Itis used to hold the data subtraction etc, p- Register: + B- Register is an 8 - pit Tegister + His used to hold data for multiplication and division operations. iS Temporary Register: « There are two temporary Registors, TEMP! and TEMP2. + It is an 8 - bit register + It is used to store data. | ¢ Arithmetic and Logic unit (ALU): Arithmetic and logic unit performs arithmetic and logical operations such | as addition, subtraction, multiplication, division. AND, OR, EX - OR etc., | + Program Status Word (PSW): . * — Itisa bit addressable register. This register is used to know the status of different flag settings in | 8051. PSW is also known as flag register. The following figure shows the bit pattern of program status word (@sw) Ny Carry flag Microprocessors and Microcontrats 5 B, BB, BB, Parity flag un used Over flow flag Zero flag |» Select register bank Auxiliary Carry flag Fig.12.3 Program status word (PSW) The following Table explains how these bits can be changed to selected the appropriate register bank. Selected Bank Table: Register Bank Selector ie, two bits in the program status word specify which register bank is in use currently. Over flow flag (OV): * — Inanarithmetic operation, if there is a carry out either the bit D, (or) the bit | D, of the accumulator, the over flow flag is set (1) otherwise it is reset (0). * _ This flag bit is used to detect errors in signed arithmetic operations. Parity fg (P): . In an arithmetic operation, If the result of Accumulator contains an odd number of 1’s, the Parity flag is set (1) otherwise it is reset (0). Carry flag (CY) + Inan arithmetic operation, when cai rry is generated, the carry flag is set (CY=1) Otherwise the carry flag is reset (cy = 0) + + . . . + ¢ Program Counter (PC) . . + + © Stack Pointer (SP) * — Stack pointer is a 16 - bit register. * — Itis used to hold the internal RAM address that is called the top of the | stack. ; ; * — Stack pointer is incremented just before data is stored by using PUSH (or) CALL Instructions. + zero flag (or) user flag [FO] ¢ Register bank Selector bits (RS, and RSo): ¢ Timing and Control unit: flag is used j 8 used in BCD ari mail ; -D arithmetic ‘This flag is Set whenever a carry from D, 4 oe 3 t0 Dy bit is obti This flag is considered on} ained y for BC! at ignored, CD addition, other wise this status is This flag can be set (or) reset as per the user's choice It is a user - programmable flag register 7 ie ; Zero flag available to the user for use as a general purpose indicator. These bits are used to select the desired register banks in memory Timing and contorl unit generates control signals for proper functioning of the system. This unit synchronizes all the operations with the clock pulse. Program counter is a 16 bit register. It is used to hold the address of a byte in memory. Program counter is automatically incremented after every instruction byte is fetched. This is the only register that does not have an internal address. To retrieve the data, the stack pointer is to be decremented [12.10 . | . + . + & Special Function Register (SFR) Microprocessors and Microcontrolten. @ Data pointer (DPTR). Data pointer is a 16 bit register. DPTR consists of a high byte (DPH) and low byte (DPL) Itis used to hold the 16 - bit address during the addressing of externa memory. Special function Register (SFR) is a group of specific informal register, The SFR used for specific functions and contorl of various blocks in the 8051. The speial function Registers available in 8051 are as follows. (i) Accumulator - A and B | Gi) Program status word (PSW) (ii) I/O port registers - Po, Pj, Py and P; (iv) Data pointer (DPTR) (v) Serial Data Buffer (SBUF) (vi) Stack pointer (SP) (vii) Timer Register - THy, TH, and TLo, TL (viii) Timer Control Register - TCON and TMOD . (ix) Power and port control - PCON and SCON «) Interrupt control register - IP and IE The 8051 Operations, that donot use the internal. 128 bytes of RAM (Random Access Memory) from 00 H to 7F H. The address range of SFR is 80H to FFH | J pPL pPH jcro cONIUHE EO Fo 82 83 A8 B8 80 90 AO BO 87 Do 99 98 81 88 89 8A 8C 8B 8D. Addressing E xternal Memory ble contol Interrupt Priority control V/O port Latch 0 Interrupt enai VO Port Latch 1 V/O Port Latch 2 VO Port Latch 3 Power control. Program status word. Serial Data buffer. Serial port control Stack pointer Timer / Counter Control Timer / Counter mode control Timer 0 Low byte Timer 0 high byte Timer 1 low byte Timer 1 high byte Table : Special Function Register i2.19] Microprocessors and Microcontrotiey @ Serial Data Buffer [SUBF]: . The serial data Buffer is actually two scparate register are transmit buffer register and receive buffer register. . A transmit buffer register is used to hold the data for serial transmission, + Areceive buffer register is used to hold the data for serial Teception, © Instruction Register: ° It is an 8 - bit register. It is part of the ALU * When an Instruction is fetched from memory, It is loaded in the instruction register. + It determines the operation to be followed in executing the entire Instruction. @& W/O ports: ° The 8051 has four parallel ports for Input / Output communication. * — Allports are bi - directional * The four Input / Output (I/O) ports are port 0, port 1, port 2, and port 3. ° Each line consists of latch, an output drive and an input. buffer. oe Counters and Timers: . The 8051 has two 16 bit timers, Timer 0 and Timer 1. It will generate accurate time delay (or) can be used as external counter. The counters are divided into 8 it registers THy, TLy, TH, TLy- All the counter actions are controlled by TMOD and TCON registers. 128 PIN DESCRIPTION OF 8051 XTAL, and XTAL to from an oscillator, It isused for providing the clock to 8051 micto cont rT . the speed (or) baud rate of micro Controller, TOlet which decides The figure shows the circuit of crystal Oscillator, C, it} 18xTAL2 Cryst: ae 8051 DIP —,1_| 19xTALI 2 Fig. 12.3 Crystal oscillator circuit The figure shows the’ pin diagram of 8051. It has 40 pin Dual - in - package for various functions The 8051 has 32 /O pins and it has 4 ports (port 0, port 1, port 2 and | port 3) All ports are bidirectional. Each port consists of a latch, an output driver and an input buffer.

You might also like