SlideShare uma empresa Scribd logo
1 de 29
8051 Microcontroller


         Presented By,
     Er. Swapnil Kaware,
      B.E. (Electronics),
   svkaware@yahoo.co.in
                            1
Salient Features
(1). 8 bit microcontroller originally developed by Intel in 1980.
(2). High-performance CMOS Technology.
(3). Contains Total 40 pins.
(4). Address bus is of 16 bit & data bus is of 8 bit.
(5). 4K bytes internal ROM (program).
(6). 128 bytes internal RAM (data).
(7). Four 8-bit I/O ports.
(8). Two 16-bit timers.
(9). Serial interface Communication.
(10). 64K external code & data memory space.
(11). 210 bit-addressable locations.
(12). Internal memory consists of on-chip ROM and on-chip data RAM.
(13). 8051 implements a separate memory space for programs (code) and data.
(14). Operating frequency is 24MHz-33MHz.
(15). +5V Regulated DC power supply is required to operate .
(16). It has four 8 bit ports, total 32 I/O lines.
(17). RAM, ROM, I/O ports, one serial port and timers are all on-chip.
(18). 6-interrupts (2 are external with 2 priority levels).
(19). Low-power Idle and Power-down Modes.
(20). Full duplex UART.
(21). 8051 has 21 special function registers (SFRs).                          2
8051 Block Diagram




                     3
Internal Architecture
 Oscillator Circuit:-

(1). The 8051 requires an external oscillator circuit.
(2). The oscillator circuit usually runs around 12MHz.
(3). The crystal generates 12M pulses in one second.
(4). The pulse is used to synchronize the system operation in a controlled
   pace.
(5). An 8051 machine cycle consists of 12 crystal pulses (clock cycle).
(6). Used for synchronizing internal operations.
(7). Pins XTAL1 & XTAL2 have been used.
(8). The length of machine cycle depends on the frequency of the crystal
   oscillator connected to 8051.

                                                                         4
Internal Memory
(1). 8051 implements a separate memory space for programs (code) and data.

(2). Both code and data may be internal, however, both expand using external components
    to a maximum of 64K code memory and 64K data memory.

(3). Internal memory consists of on-chip ROM and on-chip data RAM.

(4). On-chip RAM contains a rich arrangement of general purpose storage, bit addressable
    storage, register banks, and special function registers.

(5). In the 8051, the registers and input/output ports are memory mapped and accessible
    like any other memory location.

(6). In the 8051, the stack resides within the internal RAM, rather than in external RAM.



                                                                                            5
Registers RAM memory space allocation in the
            8051 Microcontroller




                                         6
Register banks in the 8051 Microcontroller




                                         7
Special Function Registers
(1). ACC
(2). B
(3). PSW
(4). SP
(5). DPTR
(5). IP
(6). PMODE
(7). PCON
(8). TMODE
(9). TCON etc.                        8
Special Function Registers
(1). 8051 has 21 special function registers (SFRs) at the top of internal RAM from
    address 80H to FFH.

(2). Most of the addresses from 80H to FFH are not defined, except for 21 of
    them.

(3). Some SFR’s are both bit-addressable and byte addressable, depending on the
    instruction accessing the register.

(4). This area consists of a series of memory-mapped ports and registers.

(5). All 8051 CPU registers, I/O ports, timers and other architecture components
    are accessible in 8051 C through SFRs

                                                                                9
B Register
(1). B register or accumulator B is used along with the accumulator
   for multiply and divide operations.

(2). MUL AB: multiplies 8 bit unsigned values in A and B. and leaves
   the 16 bit result in A (low byte) and B (high byte).

(3). DIV AB: divided A by B, leaving the integer result in A and
   remainder in B.

(4). B register is bit-addressable.



                                                                   10
PSW (Program Status word) / Flag Register




                                        11
Stack Pointer
(1). Stack pointer (SP) is an 8-bit register at address 81H.
(2). It contains the address of the data item currently on top of the
   stack.
(3). Stack operations include pushing data on the stack andpopping
   data off the stack.
(4). Pushing increments SP before writing the data
(5). Popping from the stack reads the data and decrements the SP
(6). 8051 stack is kept in the internal RAM
(7). Depending on the initial value of the SP, stack can have
   different sizes
(8). Example: MOV SP,#5FH
(9). On 8051 this would limit the stack to 32 bytes since the
   uppermost address of on chip RAM is 7FH.                         12
Data pointer (DPTR)
(1). Data pointer (DPTR): is used to access external data or code.

(2). DPTR is a 16 bit register at addresses 82H (low byte) and 83H
   (high byte).

(3). The data pointer is used in operations regarding external RAM
   and some instructions involving code memory.

(4). Example: the following instructions write 55H into external
   RAM location 1000H:
• MOV A,#55H
• MOV DPTR,#1000H
• MOVX @DPTR,A
                                                                     13
I/O Ports
(1). One of the major features of a microcontroller is the versatility built into the
    I/O circuits that connect the microcontroller to the outside world .
(2). To be commercially viable, the 8051 had to incorporate as many I/O functions
    as were technically and economically possible.
(3). One of the most useful features of the 8051 is four bidirectional I/O ports.
(4). Each port has an 8-bit latch in the SFR space as mentioned earlier.
(5). To reduce the overall package pin count, the 8051 employs multiple
    functions for each port.
(6). Each port also has an output drive and an input buffer.
(7). These ports can be used to general purpose I/O, as an address and data
    lines.
(8). The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8 pins


                                                                                14
I/O Ports




            15
PORT 0
(1). Port 0 is 8-bitbidirectional I/O port.

(2). Port 0 pins can be used as high-impedance inputs.

(3). Port 0 is also the multiplexed low-order address and data
   bus during accesses to external program and data memory.

(4). We r using pins no. from 32 to 39.

(5). When used as an output the pin latches are programmed
   to 0.

(5). When used as an input the pin latches are programmed to
   1.                                                    16
PORT 1
(1). Port 1 is an 8-bit bidirectional I/0 port.

(2). We r using pins no. from 1 to 9.

(3). Port 1 have no dual functions.

(4). When used as an output the pin latches are
  programmed to 0.

(5). When used as an input the pin latches are
  programmed to 1.
                                                  17
PORT 2
(1). Port 2 is an 8-bit bidirectional I/O port.

(2). Port 2 emits the high-order address byte during fetches from external
    program memory and during accesses to external data memory that use 16-bit
    addresses (MOVX @DPTR).

(3). When used as an output the pin latches are programmed to 0.

(4). When used as an input the pin latches are programmed to 1.

(5). We r using pins no. from 21 to 28.




                                                                          18
PORT 3
(1). Port 3 is an 8-bit bi-directional I/0 port.
(2). We r using pins no. from 10 to 17.

•   RXD (P3.0): Serial input port,
•   TXD (P3.1): Serial output port,
•   INT0 (P3.2): External interrupt,
•   INT1 (P3.3): External interrupt,
•   T0 T0 (P3.4): Timer 0 external input,
•   T1 (P3.5): Timer 1 external input,
•   WR (P3.6): External data memory write strobe,
•   RD (P3.7): External data memory read strobe,
                                                    19
Timers and Counters
(1). Many microcontroller applications require the counting of external events, such as
    frequency of a pulse train, or the generation of precise internal time delays between
    actions.

(2). Both of these tasks can be accomplished using software techniques.

(3). The 8051 has two 16-bit registers that can be used as either timers or counters.

(4). These two up counters are name T0 and T1 and are provided for general use of the
    programmer.

(5). Each counter may be programmed to count internal clock pulses, act as a timer, or
    programmed to count external events as a counter.

(6). The counters are divided into two 8-bit registers called the timer low (TL0, TL1) and
    timer high (TH0, TH1) bytes.
                                                                                         20
TCON (Timer/Counter Control Register)




                                   21
TMOD (Timer/Counter Control Register)




                                        22
SCON (Serial Port Control Register)




                                      23
PCON (Power Mode Control Register)




                                     24
Interrupts
•   An interrupt is a special feature which Allows the 8051 to provide the illusion of
    "multitasking,“ although in reality the 8051 is only doing one thing at a time. The word
    "interrupt" can often be substituted with the word "event.“

•   An interrupt is triggered whenever corresponding event occurs. When the event
    occurs, the 8051 temporarily puts "on hold" the normal execution of the program and
    executes a special section of code referred to as an interrupt handler.

•   Whenever any device needs its service, the device notifies the microcontroller by
    sending it an interrupt signal.

•   There are total 5 interrupt sources in 8051 Microprocessor as follows.
    (1). Timer Flag 0, (2). Timer Flag 1, (TF1 & TF2 are Timer Flag Interrupts).
    (3). INT 0, (4). INT 1, (INT 0 & INT 1 are external interrupts).
    (5). Serial Port Interrupt (RI or TI).
                                                                                        25
Interrupts Priorities
            Interrupt Destinations
                Interrupt   Address
                             (Hex)
            1     IE0        0003H

            2     TF0       000BH

            3     IE1       0013H

            4     TF1       001BH

            5    SERIAL     0023H
                                      26
Interrupt Priority (IP) SFR




                              27
Interrupt Enable (IE) SFR




                            28
END OF
 SESSION

           29

Mais conteúdo relacionado

Mais procurados

Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerSudhanshu Janwadkar
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085ShivamSood22
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor DebrajJana4
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...manishpatel_79
 
8086 in minimum mode
8086 in minimum mode8086 in minimum mode
8086 in minimum modeSridari Iyer
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller NotesDr.YNM
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 completeShubham Singh
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration AKHIL MADANKAR
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1deval patel
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE Dr.YNM
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller Gaurav Verma
 
8251 communication interface
8251 communication interface8251 communication interface
8251 communication interfaceLingalaSowjanya
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture pptParvesh Gautam
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing ModesSenthil Kumar
 

Mais procurados (20)

Keypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 MicrocontrollerKeypad Interfacing with 8051 Microcontroller
Keypad Interfacing with 8051 Microcontroller
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
Addressing modes 8085
Addressing modes 8085Addressing modes 8085
Addressing modes 8085
 
PPT on 8085 Microprocessor
PPT on 8085 Microprocessor  PPT on 8085 Microprocessor
PPT on 8085 Microprocessor
 
Question paper with solution the 8051 microcontroller based embedded systems...
Question paper with solution  the 8051 microcontroller based embedded systems...Question paper with solution  the 8051 microcontroller based embedded systems...
Question paper with solution the 8051 microcontroller based embedded systems...
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
8086 in minimum mode
8086 in minimum mode8086 in minimum mode
8086 in minimum mode
 
Unit 2 mpmc
Unit 2 mpmcUnit 2 mpmc
Unit 2 mpmc
 
8051 Microcontroller Notes
8051 Microcontroller Notes8051 Microcontroller Notes
8051 Microcontroller Notes
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration MICROCONTROLLER 8051- Architecture & Pin Configuration
MICROCONTROLLER 8051- Architecture & Pin Configuration
 
8051 Inturrpt
8051 Inturrpt8051 Inturrpt
8051 Inturrpt
 
Interrupts of 8086
Interrupts of 8086Interrupts of 8086
Interrupts of 8086
 
Stacks & subroutines 1
Stacks & subroutines 1Stacks & subroutines 1
Stacks & subroutines 1
 
ARM7-ARCHITECTURE
ARM7-ARCHITECTURE ARM7-ARCHITECTURE
ARM7-ARCHITECTURE
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
8251 communication interface
8251 communication interface8251 communication interface
8251 communication interface
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 
Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086Minimum mode and Maximum mode Configuration in 8086
Minimum mode and Maximum mode Configuration in 8086
 
8051 Addressing Modes
8051 Addressing Modes8051 Addressing Modes
8051 Addressing Modes
 

Semelhante a 8051 Microcontroller PPT's By Er. Swapnil Kaware

Semelhante a 8051 Microcontroller PPT's By Er. Swapnil Kaware (20)

Ch3 ppt
Ch3 pptCh3 ppt
Ch3 ppt
 
Study of 8051 microcontroller
Study of 8051 microcontrollerStudy of 8051 microcontroller
Study of 8051 microcontroller
 
Micro controller
Micro controllerMicro controller
Micro controller
 
MICROCONTROLLER 8051
MICROCONTROLLER 8051MICROCONTROLLER 8051
MICROCONTROLLER 8051
 
Micro 8051
Micro 8051Micro 8051
Micro 8051
 
8051 architecture
8051 architecture8051 architecture
8051 architecture
 
4th yr dmumicrocontroller1
4th yr dmumicrocontroller14th yr dmumicrocontroller1
4th yr dmumicrocontroller1
 
8051
80518051
8051
 
assignment 1-MC.pdf
assignment 1-MC.pdfassignment 1-MC.pdf
assignment 1-MC.pdf
 
8051.pptx
8051.pptx8051.pptx
8051.pptx
 
Advanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptxAdvanced Microprocessor 6.pptx
Advanced Microprocessor 6.pptx
 
89s52 2
89s52 289s52 2
89s52 2
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy
 
12906245.ppt
12906245.ppt12906245.ppt
12906245.ppt
 
8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx8051 Microcontroller_module_4.1.pptx
8051 Microcontroller_module_4.1.pptx
 
8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf8051 Architecture and PIN Configuration.pdf
8051 Architecture and PIN Configuration.pdf
 
Microcontroller 8051
Microcontroller 8051Microcontroller 8051
Microcontroller 8051
 
Embedded systems, 8051 microcontroller
Embedded systems, 8051 microcontrollerEmbedded systems, 8051 microcontroller
Embedded systems, 8051 microcontroller
 
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering studentsEMBEDDED SYSTEMS AND IOT lab manual for enginnering students
EMBEDDED SYSTEMS AND IOT lab manual for enginnering students
 

Mais de Prof. Swapnil V. Kaware

Corona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. KawareCorona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Basic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. KawrareBasic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. KawrareProf. Swapnil V. Kaware
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareAddressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Best Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. KawareBest Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. KawareLED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Electronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. KawareElectronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. KawareProf. Swapnil V. Kaware
 
Transistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil KawareTransistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil KawareProf. Swapnil V. Kaware
 
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil KawareBasic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil KawareProf. Swapnil V. Kaware
 
Digital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil KawareDigital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil KawareProf. Swapnil V. Kaware
 
Digital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil KawareDigital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil KawareProf. Swapnil V. Kaware
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareProf. Swapnil V. Kaware
 
Digital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil KawareDigital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil KawareProf. Swapnil V. Kaware
 

Mais de Prof. Swapnil V. Kaware (20)

Corona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. KawareCorona Virus Awareness by, Er. Swapnil V. Kaware
Corona Virus Awareness by, Er. Swapnil V. Kaware
 
Basic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. KawrareBasic Electronics By, Er. Swapnil V. Kawrare
Basic Electronics By, Er. Swapnil V. Kawrare
 
Addressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. KawareAddressing modes of 8085 by Er. Swapnil V. Kaware
Addressing modes of 8085 by Er. Swapnil V. Kaware
 
Best GD tips by, Er. Swapnil V. Kaware
Best GD tips by, Er. Swapnil V. KawareBest GD tips by, Er. Swapnil V. Kaware
Best GD tips by, Er. Swapnil V. Kaware
 
Best Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. KawareBest Interview Tips By, Er. Swapnil V. Kaware
Best Interview Tips By, Er. Swapnil V. Kaware
 
Chandrayaan 2 By, Er. Swapnil V. Kaware
Chandrayaan 2 By, Er. Swapnil V. KawareChandrayaan 2 By, Er. Swapnil V. Kaware
Chandrayaan 2 By, Er. Swapnil V. Kaware
 
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. KawareLED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
LED Lighting for Energy Efficiency By, Er. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-2) By Er. Swapnil V. Kaware
 
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. KawareMicroprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
Microprocessor & Interfacing (Part-1) By Er. Swapnil V. Kaware
 
Combinational Logic Circuits
Combinational Logic CircuitsCombinational Logic Circuits
Combinational Logic Circuits
 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. Kaware
 
LED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. KawareLED basics by Er. Swapnil V. Kaware
LED basics by Er. Swapnil V. Kaware
 
Electronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. KawareElectronics Lab Manual by Er. Swapnil V. Kaware
Electronics Lab Manual by Er. Swapnil V. Kaware
 
Transistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil KawareTransistors & Oscillators by Er. Swapnil Kaware
Transistors & Oscillators by Er. Swapnil Kaware
 
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil KawareBasic Electronics (Rectifiers) by Er. Swapnil Kaware
Basic Electronics (Rectifiers) by Er. Swapnil Kaware
 
Basic Electronics by Er. Swapnil Kaware
Basic Electronics by Er. Swapnil KawareBasic Electronics by Er. Swapnil Kaware
Basic Electronics by Er. Swapnil Kaware
 
Digital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil KawareDigital Electronics Basics by Er. Swapnil Kaware
Digital Electronics Basics by Er. Swapnil Kaware
 
Digital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil KawareDigital computer Basics by, Er. Swapnil Kaware
Digital computer Basics by, Er. Swapnil Kaware
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil Kaware
 
Digital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil KawareDigital signal processing By Er. Swapnil Kaware
Digital signal processing By Er. Swapnil Kaware
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

8051 Microcontroller PPT's By Er. Swapnil Kaware

  • 1. 8051 Microcontroller Presented By, Er. Swapnil Kaware, B.E. (Electronics), svkaware@yahoo.co.in 1
  • 2. Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit & data bus is of 8 bit. (5). 4K bytes internal ROM (program). (6). 128 bytes internal RAM (data). (7). Four 8-bit I/O ports. (8). Two 16-bit timers. (9). Serial interface Communication. (10). 64K external code & data memory space. (11). 210 bit-addressable locations. (12). Internal memory consists of on-chip ROM and on-chip data RAM. (13). 8051 implements a separate memory space for programs (code) and data. (14). Operating frequency is 24MHz-33MHz. (15). +5V Regulated DC power supply is required to operate . (16). It has four 8 bit ports, total 32 I/O lines. (17). RAM, ROM, I/O ports, one serial port and timers are all on-chip. (18). 6-interrupts (2 are external with 2 priority levels). (19). Low-power Idle and Power-down Modes. (20). Full duplex UART. (21). 8051 has 21 special function registers (SFRs). 2
  • 4. Internal Architecture Oscillator Circuit:- (1). The 8051 requires an external oscillator circuit. (2). The oscillator circuit usually runs around 12MHz. (3). The crystal generates 12M pulses in one second. (4). The pulse is used to synchronize the system operation in a controlled pace. (5). An 8051 machine cycle consists of 12 crystal pulses (clock cycle). (6). Used for synchronizing internal operations. (7). Pins XTAL1 & XTAL2 have been used. (8). The length of machine cycle depends on the frequency of the crystal oscillator connected to 8051. 4
  • 5. Internal Memory (1). 8051 implements a separate memory space for programs (code) and data. (2). Both code and data may be internal, however, both expand using external components to a maximum of 64K code memory and 64K data memory. (3). Internal memory consists of on-chip ROM and on-chip data RAM. (4). On-chip RAM contains a rich arrangement of general purpose storage, bit addressable storage, register banks, and special function registers. (5). In the 8051, the registers and input/output ports are memory mapped and accessible like any other memory location. (6). In the 8051, the stack resides within the internal RAM, rather than in external RAM. 5
  • 6. Registers RAM memory space allocation in the 8051 Microcontroller 6
  • 7. Register banks in the 8051 Microcontroller 7
  • 8. Special Function Registers (1). ACC (2). B (3). PSW (4). SP (5). DPTR (5). IP (6). PMODE (7). PCON (8). TMODE (9). TCON etc. 8
  • 9. Special Function Registers (1). 8051 has 21 special function registers (SFRs) at the top of internal RAM from address 80H to FFH. (2). Most of the addresses from 80H to FFH are not defined, except for 21 of them. (3). Some SFR’s are both bit-addressable and byte addressable, depending on the instruction accessing the register. (4). This area consists of a series of memory-mapped ports and registers. (5). All 8051 CPU registers, I/O ports, timers and other architecture components are accessible in 8051 C through SFRs 9
  • 10. B Register (1). B register or accumulator B is used along with the accumulator for multiply and divide operations. (2). MUL AB: multiplies 8 bit unsigned values in A and B. and leaves the 16 bit result in A (low byte) and B (high byte). (3). DIV AB: divided A by B, leaving the integer result in A and remainder in B. (4). B register is bit-addressable. 10
  • 11. PSW (Program Status word) / Flag Register 11
  • 12. Stack Pointer (1). Stack pointer (SP) is an 8-bit register at address 81H. (2). It contains the address of the data item currently on top of the stack. (3). Stack operations include pushing data on the stack andpopping data off the stack. (4). Pushing increments SP before writing the data (5). Popping from the stack reads the data and decrements the SP (6). 8051 stack is kept in the internal RAM (7). Depending on the initial value of the SP, stack can have different sizes (8). Example: MOV SP,#5FH (9). On 8051 this would limit the stack to 32 bytes since the uppermost address of on chip RAM is 7FH. 12
  • 13. Data pointer (DPTR) (1). Data pointer (DPTR): is used to access external data or code. (2). DPTR is a 16 bit register at addresses 82H (low byte) and 83H (high byte). (3). The data pointer is used in operations regarding external RAM and some instructions involving code memory. (4). Example: the following instructions write 55H into external RAM location 1000H: • MOV A,#55H • MOV DPTR,#1000H • MOVX @DPTR,A 13
  • 14. I/O Ports (1). One of the major features of a microcontroller is the versatility built into the I/O circuits that connect the microcontroller to the outside world . (2). To be commercially viable, the 8051 had to incorporate as many I/O functions as were technically and economically possible. (3). One of the most useful features of the 8051 is four bidirectional I/O ports. (4). Each port has an 8-bit latch in the SFR space as mentioned earlier. (5). To reduce the overall package pin count, the 8051 employs multiple functions for each port. (6). Each port also has an output drive and an input buffer. (7). These ports can be used to general purpose I/O, as an address and data lines. (8). The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8 pins 14
  • 15. I/O Ports 15
  • 16. PORT 0 (1). Port 0 is 8-bitbidirectional I/O port. (2). Port 0 pins can be used as high-impedance inputs. (3). Port 0 is also the multiplexed low-order address and data bus during accesses to external program and data memory. (4). We r using pins no. from 32 to 39. (5). When used as an output the pin latches are programmed to 0. (5). When used as an input the pin latches are programmed to 1. 16
  • 17. PORT 1 (1). Port 1 is an 8-bit bidirectional I/0 port. (2). We r using pins no. from 1 to 9. (3). Port 1 have no dual functions. (4). When used as an output the pin latches are programmed to 0. (5). When used as an input the pin latches are programmed to 1. 17
  • 18. PORT 2 (1). Port 2 is an 8-bit bidirectional I/O port. (2). Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVX @DPTR). (3). When used as an output the pin latches are programmed to 0. (4). When used as an input the pin latches are programmed to 1. (5). We r using pins no. from 21 to 28. 18
  • 19. PORT 3 (1). Port 3 is an 8-bit bi-directional I/0 port. (2). We r using pins no. from 10 to 17. • RXD (P3.0): Serial input port, • TXD (P3.1): Serial output port, • INT0 (P3.2): External interrupt, • INT1 (P3.3): External interrupt, • T0 T0 (P3.4): Timer 0 external input, • T1 (P3.5): Timer 1 external input, • WR (P3.6): External data memory write strobe, • RD (P3.7): External data memory read strobe, 19
  • 20. Timers and Counters (1). Many microcontroller applications require the counting of external events, such as frequency of a pulse train, or the generation of precise internal time delays between actions. (2). Both of these tasks can be accomplished using software techniques. (3). The 8051 has two 16-bit registers that can be used as either timers or counters. (4). These two up counters are name T0 and T1 and are provided for general use of the programmer. (5). Each counter may be programmed to count internal clock pulses, act as a timer, or programmed to count external events as a counter. (6). The counters are divided into two 8-bit registers called the timer low (TL0, TL1) and timer high (TH0, TH1) bytes. 20
  • 23. SCON (Serial Port Control Register) 23
  • 24. PCON (Power Mode Control Register) 24
  • 25. Interrupts • An interrupt is a special feature which Allows the 8051 to provide the illusion of "multitasking,“ although in reality the 8051 is only doing one thing at a time. The word "interrupt" can often be substituted with the word "event.“ • An interrupt is triggered whenever corresponding event occurs. When the event occurs, the 8051 temporarily puts "on hold" the normal execution of the program and executes a special section of code referred to as an interrupt handler. • Whenever any device needs its service, the device notifies the microcontroller by sending it an interrupt signal. • There are total 5 interrupt sources in 8051 Microprocessor as follows. (1). Timer Flag 0, (2). Timer Flag 1, (TF1 & TF2 are Timer Flag Interrupts). (3). INT 0, (4). INT 1, (INT 0 & INT 1 are external interrupts). (5). Serial Port Interrupt (RI or TI). 25
  • 26. Interrupts Priorities Interrupt Destinations Interrupt Address (Hex) 1 IE0 0003H 2 TF0 000BH 3 IE1 0013H 4 TF1 001BH 5 SERIAL 0023H 26