Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Subrata Ghoshal
8051 Microcontrollers, 2nd Edition
Cover
Title Page
Contents
Dedication
Preface to the First Edition
Preface
Acknowledgements
1. Introduction
Chapter Objectives
1.1 Introduction
1.2 Microprocessor
1.2.1 Microprocessor-Based System
1.3 Microcontroller
1.3.1 General Architecture
1.3.2 Software Protection in Microcontrollers
1.3.3 Brief History of Intel Microcontrollers
1.4 MCS-51 Family
1.4.1 Princeton and Harvard Architectures
1.4.2 Comparison Between 8085 and MCS-51
1.5 Power Management
1.6 Microcontroller Packaging
1.6.1 Plastic Dual-Inline Package (PDIP)
1.6.2 Quad Flat Package (QFP)
1.6.3 Plastic-Leaded Chip Carrier (PLCC)
1.6.4 Plastic Quad Flat Pack (PQFP)
1.6.5 Thin Quad Flat Pack (TQFP)
1.7 Future Trend
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
2. General Architecture
Chapter Objectives
2.1 External Features
2.2 Pins and Signals
2.3 Internal Architecture
2.4 Program Memory Organization
2.4.1 Pipeline Architecture
2.4.2 Program Lock Bits
2.5 Data Memory Organization
2.5.1 Register Banks
2.5.2 Bit-Addressable Area
2.5.3 Scratch-Pad Area
2.6 System Clock
2.7 Reset
2.8 How to Program 8051
2.8.1 Overview of Programming
2.8.2 Editor
2.8.3 Assembler
2.8.4 Burning the Chip
2.8.5 IDE
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
3. I/O Ports and Special Function Registers
Chapter Objectives
3.1 Introduction
3.2 SFR Map
3.3 SFR Functions
3.4 Processor Status Word
3.4.1 Comparison with 8085 Flags
3.5 Accumulator (Register A)
3.6 Register B
3.7 Stack Pointer
3.8 Port Registers (P0, P1, P2 and P3)
3.8.1 Comparing 8255 PPI with MCS-51 Ports
3.8.2 Architecture of MCS-51 Ports
3.8.3 DC Characteristics of MCS-51 Ports
3.9 Power Management (PCON)
3.10 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
4. Addressing Modes and Data Move Operations
Chapter Objectives
4.1 Instructions and Instruction Groups of MCS-51
4.2 Addressing Modes
4.2.1 Immediate Addressing Mode
4.2.2 Direct Addressing Mode
4.2.3 Register Direct Addressing Mode
4.2.4 Register Indirect Addressing Mode
4.3 Data Transfer Mnemonics
4.4 Forms of MOV Instruction
4.4.1 16-Bit Data Load
4.4.2 8-Bit Data Load
4.4.3 Precautions in Hexadecimal Representations
4.4.4 Format of MOV Instruction
4.4.5 Comparison with 8085 Mnemonics
4.4.6 Operand Expressions
4.4.7 Restrictions in Addressing Modes
4.4.8 Reading from I/O Ports
4.5 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
5. Arithmetic Operations
Chapter Objectives
5.1 Introduction
5.2 ADD Instruction
5.3 ADDC Instruction
5.4 SUBB Instruction
5.5 INC Instruction
5.6 DEC Instruction
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
6. Program Branching
Chapter Objectives
6.1 Program Branching Instructions
6.2 Unconditional Jumps
6.2.1 LJMP Instruction
6.2.2 AJMP Instruction
6.2.3 SJMP Instruction
6.2.4 Application of AJMP and SJMP
6.3 Conditional Branching
6.3.1 JZ Instruction
6.3.2 JNZ Instruction
6.3.3 CJNE Instruction
6.3.4 DJNZ Instruction
6.3.5 Labels in Program Listing
6.4 NOP Instruction
6.5 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
7. Programming Examples-I
Chapter Objectives
7.1 Introduction
7.2 Copy Block
7.3 Shift Block
7.4 Count No. of Nulls
7.5 Find Checksum
7.6 Sum of Natural Numbers
7.7 Sum of a Series
7.8 Fibonacci Series
7.9 Generate a Series
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
8. Subroutines and Stack
Chapter Objectives
8.1 Need of Subroutines
8.2 LCALL Instruction
8.3 RET Instruction
8.4 ACALL Instruction
8.5 Mechanism of Subroutines
8.6 Nesting of Subroutines
8.7 Stack
8.8 PUSH Instruction
8.9 POP Instruction
8.10 Other Applications of Subroutine
8.11 Comparison with 8085
8.12 Solved Examples
8.13 Parameter Passing in Subroutines
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
9. Logical Operations
Chapter Objectives
9.1 Introduction
9.2 ANL Instruction
9.3 ORL Instruction
9.4 XRL Instruction
9.5 CLR Instruction
9.6 CPL Instruction
9.7 RL Instruction
9.8 RLC Instruction
9.9 RR Instruction
9.10 RRC Instruction
9.11 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
10. Boolean Variable Manipulation
Chapter Objectives
10.1 Introduction
10.1.1 Source and Destination of Boolean Operations
10.2 Boolean Data Loading and Movement
10.2.1 CLR Instruction
10.2.2 SETB Instruction
10.2.3 MOV Instruction
10.3 Bit-Oriented Program Branching
10.3.1 JC Instruction
10.3.2 JNC Instruction
10.3.3 JB Instruction
10.3.4 JNB Instruction
10.4 Bit-Oriented Logical Operations
10.4.1 ANL Instruction
10.4.2 ORL Instruction
10.4.3 CPL Instruction
10.5 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
11. Programming Examples-II
Chapter Objectives
11.1 Introduction
11.2 Count 1s in a Byte
11.3 Unpack a BCD Number
11.4 Pack BCD Digits
11.5 Pack Array of Unpacked BCD Digits
11.6 Find Largest and Smallest Integers of an Array
11.7 Bubble Sorting
11.8 Find the Sum of Factorials
11.9 Sort Out Numbers Divisible by 4
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
12. Advanced Instructions
Chapter Objectives
12.1 Introduction
12.2 MOVC Instruction
12.3 MOVX Instruction
12.4 XCH Instruction
12.5 XCHD Instruction
12.6 MUL Instruction
12.7 DIV Instruction
12.8 DA A Instruction
12.9 JMP Instruction
12.10 SWAP Instruction
12.11 JBC Instruction
12.12 RETI Instruction
12.13 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
13. Programming Examples-III
Chapter Objectives
13.1 Compare with External Array
13.2 Find Sum of a Series
13.3 Reverse an Array
13.4 HEX to BCD Conversion
13.5 Update Clock Display
13.6 Display Shift for Right Entry
13.7 Count Number of Words
13.8 Generate Prime Numbers
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
14. External Interrupts
Chapter Objectives
14.1 Introduction
14.1.1 What is an Interrupt?
14.1.2 Vectored Interrupt
14.2 External Interrupts of 8051
14.3 SFRs for External Interrupt
14.3.1 TCON (bits 0, 1, 2 and 3)
14.3.2 IE (bits 0, 2 and 7)
14.3.3 IP (bits 0 and 2)
14.4 Interrupt Service Routine (ISR)
14.4.1 Checklist for INT0
14.4.2 Checklist for INT1
14.5 Software Interrupts
14.6 Benefits of Interrupt
14.7 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
15. Timer/Counter Interrupts
Chapter Objectives
15.1 Introduction
15.1.1 What is a Timer?
15.1.2 Purpose of a Timer
15.1.3 Differences Between a Timer and a Counter
15.2 8051/52 Timers
15.3 Functioning of Timers 0 and 1
15.3.1 Timer/Counter Select Block
15.3.2 Run/Stop Control Block
15.4 SFRs for Timer 0 and 1 Interrupts
15.4.1 TMOD
15.4.2 TCON (bits 4, 5, 6 and 7)
15.4.3 IE (bits 1, 3 and 7)
15.4.4 IP (bits 1 and 3)
15.4.5 TL0, TH0, TL1, TH1
15.5 Interrupt Service Routines
15.5.1 Checklist for Timer 0
15.5.2 Checklist for Timer 1
15.6 Timer 2
15.6.1 Similarities with Timers 0 and 1
15.6.2 Differences with Timers 0 and 1
15.6.3 Modes of Timer 2
15.6.4 Functioning of Timer 2
15.6.5 Timer 2 SFRs
15.6.6 Checklist for Timer 2
15.7 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
16. Serial Communication and Serial Interrupts
Chapter Objectives
16.1 Introduction
16.1.1 Serial and Parallel Communications
16.1.2 Simplex, Full-Duplex and Half-Duplex Communications
16.1.3 Synchronous and Asynchronous Communications
16.2 Overview of Serial Communication
16.2.1 How Serial Communication Works
16.2.2 Serial Data Format
16.2.3 Baud Rate
16.3 Serial Communication SFRs
16.3.1 SBUF
16.3.2 SCON
16.3.3 PCON
16.4 Modes of Serial Communication
16.4.1 Mode 0 (Shift Register Mode)
16.4.2 Mode 1 (8-bit UART)
16.4.3 Mode 2 (9-bit UART with Fixed Baud Rate)
16.4.4 Mode 3 (9-bit UART with Variable Baud Rate)
16.5 Serial Communication Issues
16.5.1 Multiprocessor Communication
16.5.2 Role of Timer in Baud-Rate Generation
16.5.3 Why 11.0592 MHz?
16.5.4 Initiation of Data Transmission and Reception
16.5.5 Signal Boosting for Long Distance Transmission
16.6 Serial Communication Routines
16.6.1 Initialization Steps for Serial Communication
16.6.2 Serial Communication Interrupt Service Routine
16.7 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
17. Interfacing: External Memory
Chapter Objectives
17.1 Introduction
17.1.1 Need of External Memory
17.2 Interfacing Signals
17.3 Program Memory Interfacing
17.4 Data Memory Interfacing
17.5 Software Security Features
17.5.1 One Lock Bit
17.5.2 Two Lock Bits
17.5.3 Three Lock Bits
17.6 Solved Example
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
18. Interfacing: Keyboards
Chapter Objectives
18.1 Introduction
18.2 Contact Type Keys
18.3 Interfacing a Key
18.4 Solved Example’s
18.5 Bouncing of Keys
18.5.1 Hardware Debouncing
18.5.2 Software Debouncing
18.6 Key Matrix
18.7 Scanning Keyboard Matrix
18.8 Debouncing Keyboard Matrix
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
19. Interfacing: Display Devices
Chapter Objectives
19.1 Introduction
19.2 LED Interfacing
19.3 Solved Examples
19.4 Seven-Segment Display Interfacing
19.5 Multiplexed Display
19.6 Multiplexed Keyboard Display Interface
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
20. Interfacing: DAC/ADC
Chapter Objectives
20.1 Introduction
20.1.1 How a DAC Works
20.1.2 How an ADC Works
20.1.3 Sample and Hold
20.2 Interfacing DAC
20.3 Interfacing ADC
20.4 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
21. Interfacing: DC Motor
Chapter Objectives
21.1 Introduction
21.1.1 How DC Motor Works
21.2 Direction Control
21.2.1 H-Bridge
21.2.2 H-Bridge Using Transistors
21.2.3 L293D
21.3 Speed Control
21.3.1 Through DAC
21.3.2 Changing Duty Cycle of Square Wave
21.4 Relay and Optocoupler
21.5 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
22. Interfacing: Stepper Motor
Chapter Objectives
22.1 Introduction
22.2 How Stepper Motor Functions
22.2.1 Full-Step Rotation
22.2.2 How Step Angle is Controlled
22.2.3 Generation of 3.6° Step Angle
22.2.4 Generation of Half-Step
22.3 Stepper Motor Interfacing
22.3.1 Using Transistors
22.3.2 Using Dedicated ICs
22.4 Direction Control
22.5 Speed Control
22.6 Solved Examples
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
23. Interfacing: Servomotor
Chapter Objectives
23.1 Introduction
23.2 How a Servomotor Works
23.3 Inside a Servo
23.4 Controlling Direction of Rotation
23.4.1 For Pulses of 2 Milliseconds
23.4.2 For Pulses of 1 Millisecond
23.4.3 For Pulses of 1.5 Milliseconds
23.5 Interfacing a Servomotor
23.6 Home-Position Detection
23.7 Solved Example
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
24. Power Management
Chapter Objectives
24.1 Introduction
24.2 Power-Saving Modes
24.2.1 Idle Mode
24.2.2 Exit from Idle Mode
24.2.3 Power-Down Mode
24.2.4 Exit from Power-Down Mode
24.2.5 Difference Between Idle and Power-Down Modes
24.2.6 Distinguishing Cold Start and Warm Start
24.3 A Case Study on Power Management
24.3.1 Case 1: Normal Design Without Power Management
24.3.2 Case 2: Power Management Using Idle Mode
24.3.3 Case 3: Power Management Using Power-Down Mode
24.3.4 Comparison of Performance in Three Cases
24.3.5 Further Improvements
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
25. Case Study: A Home Protection System
Chapter Objectives
25.1 Initial Planning
25.1.1 What is Home Protection System?
25.1.2 Sensor Selection
25.1.3 Overall System
25.1.4 Software Modules
25.2 Hardware Realization
25.2.1 Display Drivers
25.2.2 Key Return Lines and External Pull-Ups
25.2.3 System Reset and Crystal
25.2.4 Audio Interfacing
25.2.5 Sensor Interfacing
25.2.6 Power Supply
25.3 Software Development
25.3.1 IR-Sensing Module
25.3.2 External Interrupts’ Routines
25.3.3 Timer 0 Interrupt Service Routine
25.3.4 Timer 1 Interrupt Service Routine
25.3.5 Key Scanning
25.3.6 Display Refreshing
25.3.7 Main Loop
25.3.8 Reset I nitialization
25.4 Software Listing
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
26. Advanced Microcontrollers
Chapter Objectives
26.1 Introduction
26.2 AVR Microcontrollers
26.2.1 Important Features
26.2.2 Pins and Signals
26.2.3 External Reset and Crystal Inputs (Optional)
26.2.4 Operating Voltages and Power Consumption
26.2.5 Internal Architecture
26.2.6 Program Memory (Flash)
26.2.7 Data Memory (SRAM)
26.2.8 Status Register
26.2.9 Stack and Stack Pointer
26.2.10 Power Management and Sleep Modes
26.2.11 System Reset
26.2.12 Watchdog Timer
26.2.13 ATmega8 Instruction Set
26.2.14 Comparison Between ATmega8 and ATmega16
26.2.15 JTAG Interface
26.3 MCS-96 Microcontrollers
26.3.1 Important Features
26.3.2 Pins and Signals
26.3.3 Internal Architecture
26.3.4 Memory Map
26.3.5 Addressing Modes
26.3.6 Instruction Set
26.4 ARM Microcontrollers
26.4.1 ARM Core Architecture
26.4.2 Versions of ARM
26.4.3 Important Features
26.4.4 Intelligent Energy Manager (IEM)
26.5 Renesas Microcontrollers
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
27. Interfacing Intel 8255 PPI with 8051
Chapter Objectives
27.1 Introduction
27.2 Overview of 8255
27.3 Control Words for 8255
27.4 Mode 0 of 8255 (Basic Input/Output Mode)
27.5 Mode 1 of 8255 (Strobed Input/Output Mode)
27.6 Mode 2 of 8255 (Bidirectional Bus Mode)
27.7 Bit Set/Reset Mode
27.8 Hardware Interfacing
27.9 Solved Examples
27.9.1 Example 1
27.9.1 Example 2
Summary
Points to Remember
Review Questions
Evaluate Yourself
Search for Answers
Think and Solve
Answers for Evaluate Yourself
Appendix A
MCS-51 Instruction Set
A.1 Instructions Arranged by Functional Order
A.1.1 Arithmetic Operations
A.1.2 Logical Operations
A.1.3 Data Movement Operation
A.1.4 Boolean Variable Operations
A.1.5 Call and Jump Operations
A.2 Instructions Arranged by their Opcodes
A.3 Instructions Arranged by Alphabetical Order
A.4 Instructions Arranged by Operand Types
A.4.1 Instructions with Bit Operands
A.4.2 Instruction with Direct Addressing
A.4.3 Instructions with Indirect Addressing Through R0
A.4.4 Instructions with Indirect Addressing Through R1
A.4.5 Instructions with Register Addressing Through R0
A.4.6 Instructions with Register Addressing Through R1
A.4.7 Instructions with Register Addressing Through R2
A.4.8 Instructions with Register Addressing Through R3
A.4.9 Instructions with Register Addressing Through R4
A.4.10 Instructions with Register Addressing Through R5
A.4.11 Instructions with Register Addressing Through R6
A.4.12 Instructions with Register Addressing Through R7
A.4.13 Instructions with Register Addressing Through the Accumulator
Appendix B
Intel · MCS®-51 Programmer’s Guide and Instruction Set (Instruction Definitions)
Bibliography
Copyright
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Title Page
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset