- Data Structure & Algorithm Classes (Live)
- System Design (Live)
- DevOps(Live)
- Explore More Live Courses
- Interview Preparation Course
- Data Science (Live)
- GATE CS & IT 2024
- Data Structure & Algorithm-Self Paced(C++/JAVA)
- Data Structures & Algorithms in Python
- Explore More Self-Paced Courses
- C++ Programming - Beginner to Advanced
- Java Programming - Beginner to Advanced
- C Programming - Beginner to Advanced
- Android App Development with Kotlin(Live)
- Full Stack Development with React & Node JS(Live)
- Java Backend Development(Live)
- React JS (Basic to Advanced)
- JavaScript Foundation
- Complete Data Science Program(Live)
- Mastering Data Analytics
- CBSE Class 12 Computer Science
- School Guide
- All Courses
- Linked List
- Binary Tree
- Binary Search Tree
- Advanced Data Structure
- All Data Structures
- Asymptotic Analysis
- Worst, Average and Best Cases
- Asymptotic Notations
- Little o and little omega notations
- Lower and Upper Bound Theory
- Analysis of Loops
- Solving Recurrences
- Amortized Analysis
- What does 'Space Complexity' mean ?
- Pseudo-polynomial Algorithms
- Polynomial Time Approximation Scheme
- A Time Complexity Question
- Searching Algorithms
- Sorting Algorithms
- Graph Algorithms
- Pattern Searching
- Geometric Algorithms
- Mathematical
- Bitwise Algorithms
- Randomized Algorithms
- Greedy Algorithms
- Dynamic Programming
- Divide and Conquer
- Backtracking
- Branch and Bound
- All Algorithms
- Company Preparation
- Practice Company Questions
- Interview Experiences
- Experienced Interviews
- Internship Interviews
- Competitive Programming
- Design Patterns
- System Design Tutorial
- Multiple Choice Quizzes
- Go Language
- Tailwind CSS
- Foundation CSS
- Materialize CSS
- Semantic UI
- Angular PrimeNG
- Angular ngx Bootstrap
- jQuery Mobile
- jQuery EasyUI
- React Bootstrap
- React Rebass
- React Desktop
- React Suite
- ReactJS Evergreen
- ReactJS Reactstrap
- BlueprintJS
- TensorFlow.js
- English Grammar
- School Programming
- Number System
- Trigonometry
- Probability
- Mensuration
- Class 8 Syllabus
- Class 9 Syllabus
- Class 10 Syllabus
- Class 8 Notes
- Class 9 Notes
- Class 10 Notes
- Class 11 Notes
- Class 12 Notes
- Class 8 Maths Solution
- Class 9 Maths Solution
- Class 10 Maths Solution
- Class 11 Maths Solution
- Class 12 Maths Solution
- Class 7 Notes
- History Class 7
- History Class 8
- History Class 9
- Geo. Class 7
- Geo. Class 8
- Geo. Class 9
- Civics Class 7
- Civics Class 8
- Business Studies (Class 11th)
- Microeconomics (Class 11th)
- Statistics for Economics (Class 11th)
- Business Studies (Class 12th)
- Accountancy (Class 12th)
- Macroeconomics (Class 12th)
- Machine Learning
- Data Science
- Mathematics
- Operating System
- Computer Networks
- Computer Organization and Architecture
- Theory of Computation
- Compiler Design
- Digital Logic
- Software Engineering
- GATE 2024 Live Course
- GATE Computer Science Notes
- Last Minute Notes
- GATE CS Solved Papers
- GATE CS Original Papers and Official Keys
- GATE CS 2023 Syllabus
- Important Topics for GATE CS
- GATE 2023 Important Dates
- Software Design Patterns
- HTML Cheat Sheet
- CSS Cheat Sheet
- Bootstrap Cheat Sheet
- JS Cheat Sheet
- jQuery Cheat Sheet
- Angular Cheat Sheet
- Facebook SDE Sheet
- Amazon SDE Sheet
- Apple SDE Sheet
- Netflix SDE Sheet
- Google SDE Sheet
- Wipro Coding Sheet
- Infosys Coding Sheet
- TCS Coding Sheet
- Cognizant Coding Sheet
- HCL Coding Sheet
- FAANG Coding Sheet
- Love Babbar Sheet
- Mass Recruiter Sheet
- Product-Based Coding Sheet
- Company-Wise Preparation Sheet
- Array Sheet
- String Sheet
- Graph Sheet
- ISRO CS Original Papers and Official Keys
- ISRO CS Solved Papers
- ISRO CS Syllabus for Scientist/Engineer Exam
- UGC NET CS Notes Paper II
- UGC NET CS Notes Paper III
- UGC NET CS Solved Papers
- Campus Ambassador Program
- School Ambassador Program
- Geek of the Month
- Campus Geek of the Month
- Placement Course
- Testimonials
- Student Chapter
- Geek on the Top
- Geography Notes
- History Notes
- Science & Tech. Notes
- Ethics Notes
- Polity Notes
- Economics Notes
- UPSC Previous Year Papers
- SSC CGL Syllabus
- General Studies
- Subjectwise Practice Papers
- Previous Year Papers
- SBI Clerk Syllabus
- General Awareness
- Quantitative Aptitude
- Reasoning Ability
- SBI Clerk Practice Papers
- SBI PO Syllabus
- SBI PO Practice Papers
- IBPS PO 2022 Syllabus
- English Notes
- Reasoning Notes
- Mock Question Papers
- IBPS Clerk Syllabus
- Apply for a Job
- Apply through Jobathon
- Hire through Jobathon
- All DSA Problems
- Problem of the Day
- GFG SDE Sheet
- Top 50 Array Problems
- Top 50 String Problems
- Top 50 Tree Problems
- Top 50 Graph Problems
- Top 50 DP Problems
- Solving For India-Hackthon
- GFG Weekly Coding Contest
- Job-A-Thon: Hiring Challenge
- BiWizard School Contest
- All Contests and Events
- Saved Videos
- What's New ?
- Data Structures
- Interview Preparation
- Topic-wise Practice
- Latest Blogs
- Write & Earn
- Web Development

Related Articles
- Write Articles
- Pick Topics to write
- Guidelines to Write
- Get Technical Writing Internship
- Write an Interview Experience
- Pin diagram of 8051 Microcontroller
Introduction to 8051 Microcontroller
- Comparison of 8051 with its other family members
- 8086 program to convert binary to Grey code
- 8085 program to convert binary numbers to gray
- 8085 program to convert gray to binary
- 8085 program to convert a BCD number to binary
- 8085 program to convert an 8 bit BCD number into hexadecimal number
- 8086 program to convert an 8 bit BCD number into hexadecimal number
- 8086 program to convert a 16 bit decimal number to Hexadecimal
- 8086 program to convert a 16 bit decimal number to binary
- IEEE Standard 754 Floating Point Numbers
- Program for conversion of 32 Bits Single Precision IEEE 754 Floating Point Representation
- Program for Decimal to Binary Conversion
- Program for Binary To Decimal Conversion
- Binary to decimal and vice-versa in python
- Python program to convert decimal to binary number
- Quickly convert Decimal to other bases in Python
- Convert from any base to decimal and vice versa
- Given a number N in decimal base, find number of its digits in any base (base b)
- Program to find the Discount Percentage
- Program to calculate Electricity Bill
- Pi(π) in C++ with Examples
- acos() function in C++ STL
- asinh() function in C++ STL
- Cache Memory in Computer Organization
- Addressing Modes
- Random Access Memory (RAM) and Read Only Memory (ROM)
- Difficulty Level : Hard
- Last Updated : 27 Feb, 2023
Introduction –
8051 is one of the first and most popular microcontrollers also known as MCS-51. Intel introduced it in the year 1981. Initially, it came out as an N-type metal-oxide-semiconductor (NMOS) based microcontroller, but later versions were based on complementary metal-oxide-semiconductor(CMOS) technology. These microcontrollers were named 80C51, where C in the name tells that it is based on CMOS technology. It is an 8-bit microcontroller which means the data bus is 8-bit. Therefore, it can process 8 bits at a time. It is used in a wide variety of embedded systems like robotics, remote controls, the automotive industry, telecom applications, power tools, etc.
It is referred to as a System on a Chip (SoC) microcontroller because it is a chip circuit/integrated circuit that holds many components of a computer together on a single chip. These components include a CPU, memory, input-output ports(I/O ports), timers, and secondary storage. Features – There are some key features of 8051 that work as a foundation for students to learn microcontrollers.
8051 μc family member –
8051 μc have some family members 8052 microcontroller & 8031 microcontroller. 8052μc has 8K bytes of on-chip program ROM instead of 4K bytes, and 128 bytes of RAM. and 8031μc has 0K bytes of on-chip program ROM, and 128 bytes of RAM.
The Key features of the 8051 Microcontroller –
- 4 KB on-chip ROM (Program memory).
- 128 bytes on-chip RAM (Data memory).
- The 8-bit data bus (bidirectional).
- 16-bit address bus (unidirectional).
- Two 16-bit timers.
- Instruction cycle of 1 microsecond with 12 MHz crystal.
- Four 8-bit input/output ports.
- 128 user-defined flags.
- Four register banks of 8 bit each.
- 16-byte bit-addressable RAM.
- The general purpose registers are 32 each is 8-bit.
- 8051 has two external and three internal interrupts.
- 8051 microcontroller specifies some special function features like UARTs, ADC, Op-amp, etc.
- It has a 16-bit program counter and data pointer.
Block Diagram of 8051 μc –
Block-Structure Diagram
Application of 8051 Microcontroller –
Automation: The 8051 microcontroller is widely used in automotive applications. They are widely used in hybrid vehicles to control engine options. In addition, functions such as cruise control and anti-brake mechanism have been further enhanced thanks to the integration of a microcontroller.
Medical Devices: Convenient medical devices such as blood glucose and blood pressure monitors contain microcontrollers that display measurements.
Energy management: Competent measurement systems support energy consumption calculations in home and industrial environments. These measuring systems are prepared by integrating a microcontroller.
Touch Screen: Many microcontroller vendors incorporate touch functionality into their designs. Portable devices such as media players, and gaming devices.
Please Login to comment...
- sourabhsahu33
- microprocessor
- Computer Organization & Architecture
Improve your Coding Skills with Practice
Start your coding journey now.

8051 Microcontroller Notes and Study Material PDF Free Download
8051 Microcontroller Notes: Microcontrollers, also known as embedded controllers or embedded systems, are essential in the field of electronics. 8051 Microcontrollers are an important part of the Microprocessors and Microcontrollers (MPMC) course and this topic has a lot of scope as an individual subject as well. Students can refer to the Big Data Lecture Notes For CSE as per the latest and updated syllabus from this article.
For electronics, it is important to have great study materials to be able to do well in exams. Understanding this, we have put together 8051 Microcontroller Notes, along with several other useful references. The more study materials we have for our use, the better we understand the topics at hand. To further add to this, the better our understanding of the topics at hand, the better we are able to fare in our exams.
Listed below are the various study materials we have provided for 8051 Microcontroller in the following article.
Introduction to 8051 Microcontroller Notes – Free PDF Download
- 8051 Microcontroller Notes
8051 Microcontroller Reference Books
8051 microcontroller curriculum, list of 8051 microcontroller important questions.
- Frequently Asked Questions about 8051 Microcontroller Notes
To learn about and to understand 8051 Microcontroller, we need to pay good attention in our electronics classes. It is also important to be taking adequate notes while sitting through classes. However, sometimes it may be that we are not able to do this. Maybe our mind is focused elsewhere or maybe we were just having a hard time understanding the topic at hand. In a situation like this, you need not worry, especially for 8051 Microcontrollers.
You don’t need to worry about 8051 Microcontroller classes and examinations because we have provided a brilliant set of 8051 Microcontroller Notes for you below. See the list of 8051 Microcontroller Notes below and then make use of them to the ebay of your abilities during your exam preparation.
- MC Notes – 8051 Microcontroller
- 8051 Microcontroller – 8051m Notes
- Lecture Notes for B.Tech 8051 Microcontroller
- Microcontroller Notes
- Microcontrollers 8051 Notes
B.Tech 8051 Microcontroller Notes for Free Downloads
Microcontrollers, which are also called embedded systems or embedded controllers, are imperative to devices. They follow the I/O (input/output) relation, where the input for the controller is put in by the user, and the output is produced by the controller. Each microcontroller has a specific function in a machine which it carries out through the I/O feature. Microcontrollers also consist of a processor and memory, to add to the I/O function.
The 8051 Microcontroller was designed in the year 1981 by the company Intel and is also called the Intel MCS-51. It has several pragmatic and good features, which are listed as follows:
- 8-bit microcontroller
- Built with 40 pins DIP
- ROM storage of 4KB
- RAM storage of 128 bytes
- 4 parallel 8-bit ports
- 2 timers of 16-bits
The 8051 Microcontroller is one microcontroller which is commonly used in various fields and devices created for those fields. This microcontroller holds immense importance in the field of electronics, and thus is necessary to learn about, rather than just learning the basics of other microcontrollers.
Every student has his or her strong points as well as his or her weaker points. What it comes down to is focusing on strengthening the weaker points while keeping the strong points steady as they are. Reference books will help a student understand better what he or she could not, because it is filled with information such as the applications, concepts and even case studies of all the topics of study at hand.
8051 Microcontroller is also such a subject where the student may face such problems. Some topics may be more difficult for some students, while the same topics will be simpler for other students to learn. Thus comes the need to focus on 8051 Microcontroller reference books.
Some 8051 Microcontroller reference books which would be of good use to students studying this microcontroller are contained in the list which follows.
- 8051 Microcontroller – Kenneth Ayala
- The 8051 Microcontroller: A Systems Approach – JG Mazidi, MA Mazidi, and RD McKinlay
- The 8051 Microcontroller – I. Scott Mackenzie
- 8051 Microcontrollers: an Applications Based Introduction – Calcutt, Cowan, Parchizadeh
- Programming and Interfacing the 8051 Microcontroller – Ashutosh Ahluwahlia
A curriculum is the skeleton or outline for any subject. It allows the student to scour through the list of topics that make up a subject, and scout the weak and strong points in them which we mentioned about earlier. It is severely important to have an idea of what is easier to study and what is not, relatively speaking. The curriculum for a subject will allow you to do this.
The 8051 Microcontroller curriculum also serves the same purpose, of helping students try to figure out what is tougher and what is relatively easier. Additionally, when the 8051 Microcontroller curriculum is right in front of an electronics student, it makes sure that he or she misses out on no topic at all.
Below is the unit wise and topic wise breakdown of the 8051 Microcontroller curriculum.
The questions in the 8051 Microcontroller examination question paper are given module-wise. There are 10 questions (2 from each module) and the student must answer one question from each module worth 16 marks total. These questions can be either 4+6+6 marks, 8+4+4 marks, or 8+8 marks. All in all, there are 4 markers, 6 markers and 8 markers in the question paper to be answered.
4 Mark Questions
- What is a microcontroller and what are its applications?
- Write a program to move a block of data stores in external memory location 9000h to a location starting from F000h (without overlapping).
- Explain the role of CALL and subroutines in 8051 microcontroller programming.
- Explain RS-232 standards.
- Explain interrupt priority register of the 8051 microcontroller.
6 Mark Questions
- What are timers and counters? Explain the operations of the same.
- Explain timer control register and also timer mode control register.
- Explain the jump and CALL programme range with reference to 8051 microcontrollers.
- Write a programme to find the factorial of a number.
- Using a block diagram, explain the features of the 8051 microcontroller.
8 Mark Questions
- Using a functional block diagram, explain the architecture of 8051.
- Write instructions to add two BCD numbers and store the result in BCD register R, with reference to 8051.
- Write a programme to create a delay of 1 second, assuming that the oscillator frequency is 1.2 MHz.
- Write an 8051 C programme to send letters M, D and E to the LCD using delays.
- Explain the 8051 S-CON register.
FAQ’s about 8051 Microcontroller Notes
Question 1. What are the applications of the 8051 Microcontroller?
Answer: The 8051 Microcontroller can be used to control various different kinds of devices, which include the following:
- Automobiles
- Medical sector
- Railways sector
- Aeronautics
- Spaceships and rockets (for space)
- Light sensing
- Temperature sensing
- Process control devices
- General consumer electronics
Question 2. What is a good textbook or reference boom I can use to study 8051 Microcontroller?
Answer: A great book for studying the 8051 Microcontroller is “The 8051 Microcontroller: A Systems Approach” which is written by Janice Gillispie Mazidi, Muhammad Ali Mazidi, and Rolin D McKinlay. This is a great book as it has also been recommended by several professors for this subject in different universities as well.
Question 3. What is the importance of the subject of the 8051 Microcontroller?
Answer: By the end of a course in the 8051 Microcontroller, students will have a fairly practical knowledge about this microcontroller. Students will have understood the architecture and programming of the 8051 Microcontroller along with several other aspects. This subject holds great importance because this microcontroller is used in several fields, and studying it would enable students to understand the working behind machinery and devices used throughout a vast array of industries and sectors.
Question 4. What is the basic curriculum for the 8051 Microcontroller course?
Answer: There are a total of 5 modules in the 8051 Microcontroller curriculum, which are:
- 8051 Microcontroller
- 8051 Instruction Set
- 8051 Stack, I/O Port Interfacing, Programming
- 8051 Timers and Serial Port
- 8051 Interrupts and Interfacing Applications
We have provided you some great 8051 Microcontroller Notes, reference books, curriculum and important questions. These should hopefully be adequate to help you study and attain the ebay marks possible in your 8051 Microcontroller paper. We wish all students good luck for the exams and hope that the study materials we have provided in the above article have taken away any anxiousness or nervousness felt by the student. It is our sincere hope that you as a student use these study materials and resources to the best of your abilities. Doing so will ensure that you get the greatest marks, in the process making you, your parents and your family happy. You will also be able to get a great job by doing well, so make sure to use the 8051 Microcontroller Notes wherever possible!
Leave a Comment Cancel reply
You must be logged in to post a comment.

8051 Microcontroller | 8051 Microcontroller pin diagram, working, Construction.
Hey guys, welcome back to Techatronic. In this article, we will learn about the 8051 microcontroller and memory organization in it. 8051 is an 8-bit microcontroller designed by intel in 1981. It has a bidirectional data bus of 8 bits and a 16-bit unidirectional address bus.
There are two 16 bits timers/counters and four 8 bits input and output ports. The internal data memory of 8051 is divided into two groups. There are a set of 8 registers and a scratchpad memory. some people called it or search it by 8051 microprocessor . it is a microcontroller, not a microprocessor.

These eight registers are R0 to R7. It has 4 Kb of ROM and 128 bytes of RAM. You can read our articles on IoT and basic electronics . So let us start
Table of Contents
8051 Pin Diagram

8051 Pin Description
It is the very famous 8051 microcontroller along with Arduino and ESP Family. But unlike both family It comes in DIP package and is a single or main component which requires to be programmed.
This 8051 can easily be programmed either using Arduino ICSP or using any other FTDI custom software. Tutorial for programming is also available, you can view it from Programming in 8051 .
It has 4 ports, 2 timers and 1 serial which can be used, But as it is very old controller no Modern communication like SPI, I2C or any other can be used.
Further we’ll discuss some pins and their functions, For more detailed information you can always refer to its datasheet .
PIN 1-8 : These are 8051 port pins, (PORT 1) with 8-bit Bi-Direction I/O, pull-up resistors and Schmitt trigger.
PIN 9 : It is the rest pin which is used to reset the microcontroller. To reset the chip, you have to make this pin HIGH for two machine cycles. Also connect an external capacitor with Vcc to this pin for power-on reset.
PIN 10-17 :These are also port pins (PORT 3) like 1-8 with 8-bit Bi-Direction I/O, pull-up resistors and Schmitt trigger. But unlike them these pins are for some special function which are discussed further:
PIN 10 ( RXD), : This is the serial Input Pin for receiving data during programming the chip.
PIN 11 (TXD), : This is the serial Input Pin for transmitting data during programming the chip.
PIN 12 (INT0), : External interrupt
PIN 13 (INT 1 ), : External interrupt
PIN 14 (T0), : Timer 0 external input
PIN 15 (T1), : Timer 1 external input
PIN 16 (WR), : External data memory write strobe
PIN 17 (RD), : External data memory read strobe
PIN 18-19 : these are the XTAL pins which are connected to external crystal oscillator.
PIN 20 : GND Pin connected to ground of the power supply.
PIN 21-28 : These are also port pins (PORT 2) like other two with 8-bit Bi-Direction I/O, pull-up resistors and Schmitt trigger.
PIN 29 (PSEN) : Program Store Enable , This pin is activated during reading memory strobe from external memory.
PIN 30 (ALE/PROG) : Address Latch Enable/Program Pulse , output pulse for latching the low byte of the address during access to external memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency, and can be used for external timing or clocking.
PIN 31 (EA/VPP) : External Access Enable/Programming Supply Voltage , This pin is pulled low to enable the device to fetch code from external program memory locations.
PIN 32-39 : These are PORT 0 pins which are open-drain, bidirectional I/O port with Schmitt trigger inputs.
PIN 40 : This is the Vcc pin connected to high potential of the power supply.
it is a microcontroller, not a microprocessor. to understand the difference between the microprocessor and microcontroller . you need to read our embedded system article.

Register Set of 8051 Microcontroller
- Accumulator: This acts as an operand register, the accumulator register is a general purpose register to hold the results of the arithmetic and logic operations.
- B register: Used to store one of the operands for multiply and divide instructions. It is also a general purpose register.
- Program status word (PSW): This set of flags contains the status information and is considered as one of the special purpose register.
- Stack pointer: Incremented before the data is stored onto the stack using push or call instructions. This register contains 8 bit stack top address.
- Data pointer (DPTR): It contains a higher byte DPH and a lower byte DPL of a 16 bit external data RAM address.
- Serial data buffer: It contains two independent registers, one is a transmit buffer which is necessarily a parallel in serial out register, the other is called a recieve buffer which is a serial in parallel out register in 8051.
- Timer registers: These two 16 bits registers in 8051 can be accessed as their lower and upper bytes.
- Control registers: These are special function registers IP, IE, TMOD, TCON, SCON contain control and status information for interrupts and special ports.
- Program counter: It is a 16 bits register which points to the address of the next instruction to be executed.

Memory Organization in 8051

The memory organization in 8051 microcontroller is separated into program memory (ROM) and data memory (RAM). The program memory is used for storing the program to be executed i.e instructions. The data memory is used for storing temporary variable data and intermediate results. The internal RAM of 8051 is organized in three areas.
- Working registers: These are organized as 4 banks of 8 registers each and each register can be addressed by name or its RAM address. Bits RS0 and RS1 in the PSW will determine which bank of the register is currently in use. There are four banks starting from address 00H to 1FH.
- Bit addressable registers: These are used only when the program need to remember any binary event. and each bit has its own address. Starting from 20H to 2FH.
- General purpose RAM: Area above bit area, from 30H to 7FH, addressable as bytes.

We hope that you understand the working of an 8051 microcontroller and its memory organization completely. If you have any doubts regarding this post then use the comments section which is given below. Also, do check out more articles on Arduino and Raspberry Pi .
Thanks for learning
1 thought on “8051 Microcontroller | 8051 Microcontroller pin diagram, working, Construction.”
- Pingback: TTP223 touch sensor | Capacitive Touch Sensor | TTP223 Working
Leave a Comment Cancel reply
Save my name, email, and website in this browser for the next time I comment.
We've updated our privacy policy. Click here to review the details. Tap here to review the details.
Activate your 30 day free trial to unlock unlimited reading.
Study of 8051 microcontroller

You are reading a preview.
Activate your 30 day free trial to continue reading.

Check these out next

Download to read offline
Recommended

More Related Content
Slideshows for you (20).

Similar to Study of 8051 microcontroller (20)

Recently uploaded (20)

- 1. Study of 8051 Microcontroller Abstract: 8051 is an 8-bit family of microcontroller developed by Intel in the year 1981. This is one of the most popular family of microcontroller being used all across the world. This microcontroller was also referred as “system on a chip” because it has 128 bytes of RAM, 4Kbytes of ROM, 2 Timers, 1 Serial port, and four ports on a single chip. The CPU can work for only 8bits of data at a time because 8051 is an 8-bit processor. In case the data is larger than 8 bits then it has to be broken into parts so that the CPU can process conveniently. Most manufacturers have put 4Kbytes of ROM even though the quantity of ROM can be exceeded up to 64 K bytes. The 8051 has been in use in a wide number of devices, mainly because it is easy to integrate into a project or build a device around. The following are the main areas of focus: i. Energy Management ii. Touch screens iii. Automobiles iv. Medical Devices
- 2. Introduction: The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP (dual in-line package) form, but the Extended 8051 models often have a different form factor, and are not "drop-in compatible". All these things are called 8051 because they can all be programmed using 8051 assembly language, and they all share certain features (although the different models all have their own special features). Some of the features that have made the 8051 popular are: 4 KB on chip program memory. 128 bytes on chip data memory(RAM) [ 32 bank reg + 16 bit addressable reg + 80 general purpose reg ] 4 reg banks. 128 user defined software flags. 8-bit data bus 16-bit address bus 16 bit timers (usually 2, but may have more, or less). 3 internal and 2 external interrupts. Bit as well as byte addressable RAM area of 16 bytes. Four 8-bit ports, (short models have two 8-bit ports). 16-bit program counter and data pointer. 1 Microsecond instruction cycle with 12 MHz Crystal. 8051 models may also have a number of special, model-specific features, such as UART, ADC, Op_Amps, etc... it is a very powerful micro controller.
- 3. Theory: What is microcontroller? A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Block diagram of 8051 microcontroller Central Processor Unit(CPU): As you may know that CPU is the brain of any processing device. It monitors and controls all operations that are performed in the Microcontroller. User have no control over the work of CPU. It reads program written in ROM memory and executes them and do the expected task.
- 4. Interrupts: As its name suggests, Interrupt is a subroutine call that interrupts Microcontroller's main operation or work and causes it to execute some another program which is more important at that time. The feature of Interrupt is very useful as it helps in cases of emergency. The Microcontroller 8051 can be configured in such a way that it temporarily terminates or pause the main program at the occurrence of interrupt. When subroutine is completed then the execution of main program starts as usual. There are five interrupt sources in 8051 Microcontroller. 2 of them are external interrupts, 2 timer interrupts and one serial port interrupt. Memory: The memory which is used to store the program of Microcontroller, is known as code memory or Program memory. It is known as code memory or Program memory . It is known as 'ROM'(Read Only Memory. The memory which is used to temporarily store data for operation is known as Data Memory and we uses 'RAM'(Random Access Memory) for this purpose. Microcontroller 8051 has 4K of Code Memory or Program memory that is it has 4KB Rom and it also have 128 bytes of data memory i.e. RAM. Bus: Basically Bus is a collection of wires which work as a communication channel or medium for transfer of Data. These buses consists of 8, 16 or more wires. Thus these can carry 8 bits, 16 bits simultaneously. Buses are of two types: Address Bus Data Bus Address Bus: Microcontroller 8051 has a 16 bit address bus. It used to address memory locations. It is used to transfer the address from CPU to Memory.
- 5. Data Bus: Microcontroller 8051 has 8 bits data bus. It is used to carry data. Oscillator: As we know Microcontroller is a digital circuit device, therefore it requires clock for its operation. For this purpose, Microcontroller 8051 has an on-chip oscillator which works as a clock source for Central Processing Unit. As the output pulses of oscillator are stable therefore it enables synchronized work of all parts of 8051 Microcontroller. Input/Output Port: As we know that Microcontroller is used in Embedded systems to control the operation of machines. Therefore to connect it to other machines, devices or peripherals we requires I/O interfacing ports in Microcontroller. For this purpose Microcontroller 8051 has 4 input output ports to connect it to other peripherals. Timers/Counters: Microcontroller 8051 has 2 16 bit timers and counters. The counters are divided into 8 bit registers. The timers are used for measurement of intervals , to determine pulse width etc.
- 6. Pin diagram of 8051 Microcontroller: Pinout Description: Pins 1-8: Port 1 Each of these pins can be configured as an input or an output. Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of most registers. In other words, the positive voltage on
- 7. this pin resets the microcontroller. By applying logic zero to this pin, the program starts execution from the beginning. Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input or output. Besides, all of them have alternative functions: Pin 10: RXD Serial asynchronous communication input or Serial synchronous communication output. Pin 11: TXD Serial asynchronous communication output or Serial synchronous communication clock output. Pin 12: INT0 Interrupt 0 input. Pin 13: INT1 Interrupt 1 input. Pin 14: T0 Counter 0 clock input. Pin 15: T1 Counter 1 clock input. Pin 16: WR Write to external (additional) RAM. Pin 17: RD Read from external RAM. Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which specifies operating frequency is usually connected to these pins. Instead of it, miniature ceramics resonators can also be used for frequency stability. Later versions of microcontrollers operate at a frequency of 0 Hz up to over 50 Hz. Pin 20: GND Ground. Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are configured as general inputs/outputs. In case external memory is used, the higher address byte, i.e. addresses A8-
- 8. A15 will appear on this port. Even though memory with capacity of 64Kb is not used, which means that not all eight port bits are used for its addressing, the rest of them are not available as inputs/outputs. Pin 29: PSEN If external ROM is used for storing program then a logic zero (0) appears on it every time the microcontroller reads a byte from memory. Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data multiplexing is performed by means of only one additional (and cheap) integrated circuit. In other words, this port is used for both data and address transmission. Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. It means that even there is a program written to the microcontroller, it will not be executed. Instead, the program written to external ROM will be executed. By applying logic one to the EA pin, the microcontroller will use both memories, first internal then external (if exists). Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0). Pin 40: VCC +5V power supply.
- 9. Conclusion: In this practical session we studied what is microcontroller?, architecture and pin structure of 8051 microcontroller. References: www.google.com
Share Clipboard
Public clipboards featuring this slide, select another clipboard.
Looks like you’ve clipped this slide to already.
You just clipped your first slide!
Create a clipboard
Get slideshare without ads, special offer to slideshare readers, just for you: free 60-day trial to the world’s largest digital library..
The SlideShare family just got bigger. Enjoy access to millions of ebooks, audiobooks, magazines, and more from Scribd.

You have now unlocked unlimited access to 20M+ documents!
Unlimited Reading
Learn faster and smarter from top experts
Unlimited Downloading
Download to take your learnings offline and on the go
Instant access to millions of ebooks, audiobooks, magazines, podcasts and more.
Read and listen offline with any device.
Free access to premium services like Tuneln, Mubi and more.
Help us keep SlideShare free
It appears that you have an ad-blocker running. By whitelisting SlideShare on your ad-blocker, you are supporting our community of content creators.
We've updated our privacy policy.
We’ve updated our privacy policy so that we are compliant with changing global privacy regulations and to provide you with insight into the limited ways in which we use your data.
You can read the details below. By accepting, you agree to the updated privacy policy.
- IR Sensor interfacing with Raspberry Pi using Proteus
- LED interfacing with Raspberry Pi, Proteus, and Python
- Important selection criteria of a Microcontroller
- Download Latest Proteus Software 8.11 and Installation Guide
- Important KCL Problems with solutions

LEARN AND GROW
The usefulness of Assembler Directives of 8051
There are four assembler directives mostly used in 8051 Microcontroller assembly programming. Let’s find the importance of directives with programming.
Table of Contents
DB (Define Byte)
The define byte (DB) is mostly used as a data directive in the 8051 assemblers. It is used to define data in decimal, binary, hexadecimal, and ASCII formats. In the case of the 8051 microcontroller, the size of the data is 8-bit.
Decimal Number
To define data in decimal use ‘D’ after the decimal number. For decimal symbol ‘D’ can be ignored also. For example
Hexadecimal Number
To define data in hexadecimal use ‘H’ after the hexadecimal number. For example
Binary Number
To define data in binary use ‘B’ after the binary number. For example:
ASCII Format
To define data in ASCII format use an inverted comma. For Example:
ORG (Origin)
ORG is another assembler directive of the 8051 Microcontroller. ORG directive is used to shows the beginning of the address for a particular code section. After the ORG directive 16-bit number comes which may be denoted in Hexadecimal or Decimal. For the hexadecimal, the letter ‘H’ is used. If the number is not followed by H then it will be assumed as a decimal and the assembler will convert it to Hex. For example, to start the assembly code with a 2000H location use following
EQU (Equate)
The EQU directive is used to define constant value without occupying the memory location. With the EQU directive, a constant value and label name are required. Whenever the label name appears in the program its constant value will be passed automatically. For example, we want to use constant value 10 regularly in the program so we can use the EQU directive to manage it efficiently.
In the above example, data10 will be loaded to the A register. Here # means that the data is in Immediate form. The programmer can change the value throughout the program with the use of the EQU directive. For example, if the programmer wants to change the constant value to 50 then it can be easily done in all occurrences of the program.
END (END Program)
The end directive indicates the end of the assembly code. The assembler will ignore content after the END directive and it is supposed to be used as the last line of the 8051 Microcontroller assembly code.
In this tutorial, we have discussed different assembler directives of the 8051 Microcontroller. To see the complete datasheet of 8051 follow this link.
People are also reading the difference between Microprocessor and Microcontroller tutorial.
- ← Learn stat command in Linux with examples
- Importance of rm command in Linux with examples →
You May Also Like
8051 assembly language programming with examples, 8051 assembly program to add two 8-bit numbers, one thought on “ the usefulness of assembler directives of 8051 ”.
Pingback: 8051 Microcontroller Assembly Language: 8-bit Addition Program - LORE RAYS
Comments are closed.
Set up Keil c51 for 8051 microcontroller simulations – A step by step guide
In our 8051 course , we will be using the Keil Microvision C51. It’s a free (conditions apply – See the box below) IDE for 8051 related embedded development and is a very popular simulation platform as well. You can simulate the code written in the IDE to see the transfer of data in memory locations and registers making it a great tool for simulation. I thas advanced debug capabilities too that makes it extremely powerful for testing.
Installing and setting up Keil C51 for 8051
Step 1: Head to the Keil C51 site to download the installation files for Keil C51 IDE. Once downloaded run the .exe file, and then launch the Keil C51 IDE.

Step 6 : Create a new file by clicking on the new file button in the top right corner.

Step 10 : Select the file you created and add it here. Now you have a Project file with its constituent code files. All the other files that will be generated will be present in this Project folder.

Simulating code using Keil Microvision

Once you click here after compiling your code you can see a step by step execution of your code. Let’s get insights into how the addition of numbers happens inside the microcontroller using the simulator.

Now you can learn assembly language programming/embedded C with 8051 without actually needing a kit. Just take up any sample programs, compile them, and run the simulation tool. This is a great exercise in learning the working of instructions from a close perspective.
If you have any issues with installing the IDE, let us know in the comments.
Related courses to Set up Keil c51 for 8051 microcontroller simulations – A step by step guide
Digital Electronics Course
8085 microprocessors course, arduino course.

- Embedded System
- Interview Q
Embedded Systems
8051 microcontroller, avr microcontroller, es projects.
- Send your Feedback to [email protected]
Help Others, Please Share

Learn Latest Tutorials

Transact-SQL

Reinforcement Learning

R Programming

React Native

Python Design Patterns

Python Pillow

Python Turtle

Preparation

Verbal Ability

Interview Questions

Company Questions
Trending Technologies

Artificial Intelligence

Cloud Computing

Data Science

Machine Learning

B.Tech / MCA

Data Structures

Operating System

Computer Network

Compiler Design

Computer Organization

Discrete Mathematics

Ethical Hacking

Computer Graphics

Software Engineering

Web Technology

Cyber Security

C Programming

Control System

Data Mining

Data Warehouse
Javatpoint Services
JavaTpoint offers too many high quality services. Mail us on [email protected] , to get more information about given services.
- Website Designing
- Website Development
- Java Development
- PHP Development
- Graphic Designing
- Digital Marketing
- On Page and Off Page SEO
- Content Development
- Corporate Training
- Classroom and Online Training
Training For College Campus
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected] Duration: 1 week to 2 week


8051 Microcontroller Architecture with Applications
The 8051 Microcontroller was designed in the 1980s by Intel. Its foundation was on Harvard Architecture and was developed principally for bringing into play Embedded Systems . At first, it was created using NMOS technology but as NMOS technology needs more power to function therefore Intel re-intended Microcontroller 8051 employing CMOS technology and a new edition came into existence with a letter ‘C’ in the title name, for illustration: 80C51. These most modern Microcontrollers need a fewer amount of power to function in comparison to their forerunners. There are many applications with an 8051 microcontroller. So, 8051 Microcontroller Projects have great significance in Engineering final year. This article discusses an overview of 8051 microcontroller architecture and its working.
What is an 8051 Microcontroller?
The microcontroller like 8051 was designed in the year 1981 by Intel. The microcontroller is one kind of integrated circuit that includes 40-pins with dual inline package or DIP, RAM-128 bytes, ROM-4kb & 16-bit timers–2. Based on the requirement, it includes addressable & programmable 4 – parallel 8-bit ports. In the 8051 microcontroller architecture, the system bus plays a key role to connect all the devices to the central processing unit. This bus includes a data bus- an 8-bit, an address bus-16-bit & bus control signals. Other devices can also be interfaced throughout the system bus like ports, memory, interrupt control, serial interface, the CPU, timers.
There are two buses in 8051 Microcontroller one for the program and another for data. As a result, it has two storage rooms for both programs and data of 64K by 8 sizes. The microcontroller comprises of 8-bit accumulator & an 8-bit processing unit. It also consists of 8 bit B register as majorly functioning blocks and 8051 microcontroller programming is done with embedded C language using Keil software. It also has several other 8 bit and 16-bit registers.
For internal functioning & processing Microcontroller, 8051 comes with integrated built-in RAM. This is prime memory and is employed for storing temporary data. It is an unpredictable memory i.e. its data can get be lost when the power supply to the Microcontroller switched OFF. This microcontroller is very simple to use, affordable less computing power, simple architecture & instruction set.
The main features of the 8051 microcontroller architecture include the following.
- 8-bit CPU through two Registers A & B.
- 8K Bytes – Internal ROM and it is a flash memory that supports while programming the system.
- 256 Bytes – Internal RAM where the first RAM with 128 Bytes from 00H to 7FH is once more separated into four banks through 8 registers in every bank, addressable registers -16 bit & general-purpose registers – 80.
- The remaining 128 bytes of the RAM from 80H to FFH include Special Function Registers (SFRs). These registers control various peripherals such as Serial Port, Timers, all I/O Ports, etc.
- Interrupts like External-2 & Internal-3
- Oscillator & CLK Circuit.
- Control Registers like PCON, SCON, TMOD, TCON, IE, and IP.
- 16-bit Timers or Counters -2 like T0 & T1.
- Program Counter – 16 bit & DPRT (Data Pointer).
- I/O Pins – 32 which are arranged like four ports such as P0, P1, P2 & P3.
- Stack Pointer (SP) – 8bit & PSW (Processor Status Word).
- Serial Data Tx & Rx for Full-Duplex Operation
8051 Microcontroller Architecture
The 8051 microcontroller architecture is shown below. Let’s have a closer look at the features of the 8051 microcontroller design:

CPU (Central Processor Unit):
As you may be familiar that the Central Processor Unit or CPU is the mind of any processing machine. It scrutinizes and manages all processes that are carried out in the Microcontroller. The user has no power over the functioning of the CPU. It interprets the program printed in storage space (ROM) and carries out all of them and does the projected duty. CPU manages different types of registers in the 8051 microcontrollers .
Interrupts:
As the heading put forward, Interrupt is a subroutine call that reads the Microcontroller’s key function or job and helps it to perform some other program which is extra important then. The characteristic of 8051 Interrupt is extremely constructive as it aids in emergency cases. Interrupts provide us a method to postpone or delay the current process, carry out a sub-routine task and then all over again restart standard program implementation.
The Micro-controller 8051 can be assembled in such a manner that it momentarily stops or break the core program at the happening of the interrupt. When the sub-routine task is finished then the implementation of the core program initiates automatically as usual. There are 5 interrupt supplies in the 8051 Microcontroller, two out of five are peripheral interrupts, two are timer interrupts and one is serial port interrupt.
The micro-controller needs a program that is a set of commands. This program enlightens the Microcontroller to perform precise tasks. These programs need a storage space on which they can be accumulated and interpret by the Microcontroller to act upon any specific process. The memory which is brought into play to accumulate the program of the Microcontroller is recognized as Program memory or code memory. In common language, it’s also known as Read-Only Memory or ROM.
The microcontroller also needs memory to amass data or operands for the short term. The storage space which is employed to momentarily data storage for functioning is acknowledged as Data Memory and we employ Random Access Memory or RAM for this principle reason. Microcontroller 8051 contains code memory or program memory 4K so which has 4KB Rom and it also comprises data memory (RAM) of 128 bytes.
Fundamentally Bus is a group of wires which function as a communication canal or means for the transfer of Data. These buses comprise 8, 16, or more cables. As a result, a bus can bear 8 bits, 16 bits altogether. There are two types of buses:
- Address Bus: Microcontroller 8051 consists of a 16-bit address bus. It is brought into play to address memory positions. It is also utilized to transmit the address from the Central Processing Unit to Memory.
- Data Bus: Microcontroller 8051 comprise of 8 bits data bus. It is employed to cart data.
As we all make out the Microcontroller is a digital circuit piece of equipment, thus it needs a timer for its function. For this function, Microcontroller 8051 consists of an on-chip oscillator that toils as a time source for the CPU (Central Processing Unit). As the productivity thumps of the oscillator are steady as a result, it facilitates harmonized employment of all pieces of the 8051 Microcontroller. Input/Output Port: As we are acquainted with that Microcontroller is employed in embedded systems to manage the functions of devices.
Thus to gather it to other machinery, gadgets or peripherals we need I/O (input/output) interfacing ports in Micro-controller. For this function Micro-controller 8051 consists of 4 input/output ports to unite it to other peripherals.Timers/Counters: Micro-controller 8051 is incorporated with two 16 bit counters & timers . The counters are separated into 8-bit registers. The timers are utilized for measuring the intervals, to find out pulse width, etc.
Types of Interrupts
The interrupts of the 8051 microcontrollers have the following sources
- TF0 (Timer 0 Overflow Interrupt)
- TF1 (Timer 1 Overflow Interrupt)
- INT0 (External Hardware Interrupt)
- INT1 (External Hardware Interrupt)
- RI/TI (Serial Communication Interrupt)
The memories of the 8051 microcontroller architecture include a program memory and data memory.
- The instructions of the CPU are stored in the Program Memory. It is usually implemented as Read-Only Memory or ROM, where the Program written into it will be retained even when the power is down or the system is reset.
- Data Memory in a Microcontroller is responsible for storing values of variables, temporary data, intermediate results, and other data for the proper operation of the program.
Timer and Control Unit
The main function of a timer is to make a delay otherwise time gap among two events. This microcontroller includes two timers where each timer is 16-bit where the system can generate two delays concurrently to produce the suitable delay. Generally, every microcontroller uses hardware delays where a physical device can be used through the processor to generate the particular delay which is called a timer.
The delay can be generated through the timer based on the requirement of the processor & transmits the signal to the processor whenever the particular delay gets generated.
By using this processor, we can also produce a delay based on the requirement of the system. However, this will guide to remain the processor active all the time because it will not perform any other task in that specific period. As a result, the existence of a timer within the microcontroller permits the processor to be free for performing other operations.
The microcontroller also includes a program counter, data pointer, stack & stack pointer, instruction registers including latches, temporary registers & buffers for the I/O ports.
Registers in microcontrollers are mainly used to store data and short-term instructions which are mainly used to process addresses to fetch data. This microcontroller includes 8-bit registers which have 8-bit start from D0 to D7. Here, D0 to D7 is LSB (least significant bit) and D7 is the most significant bit (MSB).
To make the data process better than 8-bit, then it must be separated into eight different bit parts. It includes several registers however general-purpose type registers are frequently available to programmers. There are classified into two types like General purpose & Special purpose. So, most of the general-purpose registers are listed below.
- An accumulator is mainly used to execute arithmetic & logic instructions.
- Registers like B, R0 toR7 are used for storing instruction addresses & data.
- Data Pointers or DPTR is used to allow & process data in dissimilar addressing modes. This register includes DPH (high byte) & a DPL (low byte) which is mainly used to hold a 16-bit address. So, it can be used as a base register within not direct jumps, lookup table instructions & external data transfer.
- Program counter or PC is a 16-bit register used to store the next instruction’s address to be performed
- These registers are 8-bits other than program counter & data pointer registers.
This microcontroller includes simply one 8 bit data type where the size of each register is 8-bit. If the data is better than 8-bit, then is the programmer accountable to separate data into 8-bit parts before processing. For assemblers, the most widely used data directive is the DB directive in assembly language.
PSW Register
The term PSW stands for Program status word and it is one kind of register in the microcontroller. It is also called a flag register, used to demonstrate the position of arithmetic logic instructions such as zero carry bit, carry bit, etc. PSW or flag register is an 8-bit register where 6-bits are used. This register includes 8-flags where these flags are known as conditional flags. These flags will perform instruction simply if the condition is satisfied.
These conditional flags are overflow, parity, auxiliary carry & carry. The Program status word registers bit numbers like 3 & 4 are used to alter the bank registers whereas 1 & 5 are not used but they can be used by the programmer for executing a specific task.
Register Banks
For stacks & register banks, Ram with 32 Bytes is used and these are separated in four types of banks. So, every back includes 8-registers which range from R0 to R7. Here, R0 & R7 denotes the locations of RAM like zero location and seventh location. The second bank register begins from location 8 & ends 05H. The third bank register begins from 10H & completed at the 17H location. The final bank can be placed among the 18H-1FH.
The part of RAM like Stack is mainly used through the processor for data storage otherwise address momentarily. In a microprocessor, it is a very significant part because there are extremely restricted numbers of registers for storing addresses and data.
In the 8051 microcontrollers, the stack is 8-bit wide and it can hold data from 00 – FFH. The stack pointer can be used through the CPU to allow the stack. This microcontroller includes an 8-bit stack pointer that means it can allow values from 00H to FFH. Once it is activated, then the stack pointer includes the 07 value.
Organization of Memory
The microcontroller has complex memory organization and it includes a separate address bus that is used for program memory, external RAM & data memory. It depends on Harvard architecture that is developed through Harvard in the year 1944.
Addressing Modes
Microprocessor gets data in different methods. Generally, the data stored within memory, register & can be used from instant value. So, these different methods for accessing data are known as addressing modes. Different types of microcontrollers include different addressing modes which depend on the plan of manufacturers. The addressing modes of this microcontroller include the following.
- Register indirect

Applications of 8051 Microcontroller Architecture
The microcontroller 8051 applications include a large number of machines, principally because it is simple to incorporate in a project or to assemble a machine around it. The following are the key spots of the spotlight:

- Energy Management: Competent measuring device systems aid in calculating energy consumption in domestic and industrialized applications. These meter systems are prepared competent by integrating microcontrollers.
- Touch screens: A high degree of microcontroller suppliers integrate touch sensing abilities in their designs. Transportable devices such as media players, gaming devices & cell phones are some illustrations of micro-controller integrated with touch sensing screens.
- Automobiles: The microcontroller 8051 discovers broad recognition in supplying automobile solutions. They are extensively utilized in hybrid motor vehicles to control engine variations. Also, works such as cruise power and anti-brake mechanism have created it more capable with the amalgamation of micro-controllers.
- Medical Devices: Handy medicinal gadgets such as glucose & blood pressure monitors bring into play micro-controllers, to put on view the measurements, as a result, offering higher dependability in giving correct medical results.
Thus, this is all about an overview of 8051 microcontroller architecture, working, and its applications. Here is a question for you, what are the different families available in the 8051 microcontrollers?
Photo Credits:
- 8051 Microcontroller by blogspot
- Block Diagram of 8051 Microcontroller by aninditadhikary
Share This Post:

Comments are closed.
Continue to site >>>

About | Contact | Advertise

- Microcontroller Based Projects
Digital Thermometer using LM35 and 8051 Microcontroller

Sometimes people find it difficult to read temperature from analog thermometer because of fluctuations. So here we are going to build a simple Digital thermometer using 8051 microcontroller in which LM35 sensor is used for measuring the temperature. We have also used LM35 to build digital thermometer using Arduino , NodeMCU , PIC , Raspberry Pi and other microcontrollers.
This project will also serve as a proper interfacing of ADC0804 with 8051 and 16*2 LCD with 8051 microcontroller .
Components Required:
- 8051 development board
- ADC0804 board
- 16*2 LCD display
- LM35 sensor
- Potentiometer
- Jumper wires
Circuit Diagram:
Circuit diagram for Digital Thermometer Circuit using LM35 is given below:

Measuring Temperature with LM35 using 8051:
8051 microcontroller is a 8 bit microcontroller which has 128 bytes of on chip RAM , 4K bytes of on chip ROM, two timers, one serial port and four 8bit ports. 8052 microcontroller is an extension of microcontroller. The table below shows the comparison of 8051 family members.

16*2 LCD is a widely used display for embedded applications. Here is the brief explanation about pins and working of 16*2 LCD display. There are two very important registers inside the LCD. They are data register and command register. Command register is used to send commands such as clear display, cursor at home etc., data register is used to send data which is to be displayed on 16*2 LCD. Below table shows the pin description of 16*2 lcd.
The below table shows frequently used LCD command codes.
ADC0804 IC:
The ADC0804 IC is an 8-bit parallel ADC in the family of the ADC0800 series from National Semiconductor. It works with +5 volts and has a resolution of 8bits. The step size and Vin range varies for different values of Vref/2. The table below shows the relation between Vref/2 and Vin range.
In our case Vref/2 is connected to 1.28 volts, so step size is 10mV. For ADC0804 step size is calculated as (2 * Vref / 2) / 256.
Following formula is used to calculate output voltage:
Where Dout is digital data output in decimal, Vin = analog input voltage and step size (resolution) is the smallest change. Learn more about ADC0804 here , also check interfacing of ADC0808 with 8051 .
LM35 Temperature Sensor:
The LM35 is a temperature sensor whose output voltage is linearly proportional to Celsius temperature. The LM35 comes already calibrated hence requires no external calibration. It outputs 10mV for each degree of Celsius temperature.
LM35 sensor produces voltage corresponding to temperature. This voltage is converted to digital (0 to 256) by ADC0804 and it is fed to 8051 microcontroller. 8051 microcontroller converts this digital value into temperature in degree Celsius. Then this temperature is converted into ascii form which is suitable for displaying. This ascii values are fed to 16*2 lcd which displays the temperature on its screen. This process is repeated after specified interval.
Below is the setup image for LM35 Digital Thermometer using 8051:

You can find all the LM35 based digital thermometers here.
Code explanation:
The complete C program for this Digital Thermometer using LM35 is given at the end of this project. The code is split into small meaningful chunks and explained below.
For 16*2 LCD interfacing with 8051 microcontroller , we have to define pins on which 16*2 lcd is connected to 8051 microcontroller. RS pin of 16*2 lcd is connected to P2.7 , RW pin of 16*2 lcd is connected to P2.6 and E pin of 16*2 lcd is connected to P2.5. Data pins are connected to port 0 of 8051 microcontroller.
Similarly, for ADC0804 interfacing with 8051 microcontroller, we have to define pins on which ADC0804 is connected to 8051 microcontroller. RD pin of ADC0804 is connected to P3.0, WR pin of ADC0804 is connected to P3.1 and INTR pin of ADC0804 is connected to P3.2. Data pins are connected to port 1 of 8051 microcontroller.
Next we have to define some functions which are used in the program. Delay function is used to create specified time delay, c mdwrt function is used to send commands to 16*2 lcd display, datawrt function is used to send data to 16*2 lcd display and convert_display function is used to convert the ADC data into temperature and to display it on 16*2 lcd display.
In below part of the code, we are sending commands to 16*2 lcd . Commands such as clear display, increment cursor, force the cursor to beginning of 1 st line are sent to 16*2 lcd display one by one after some specified time delay.
In this part of the code, we are sending data to 16*2 lcd . Data to be displayed on 16*2 lcd display are sent to display one by one after some specified time delay.
In below part of the code , we are sending commands to 16*2 lcd display. The command is copied to port 0 of 8051 microcontroller. RS is made low for command write. RW is made low for write operation. High to low pulse is applied on enable(E) pin to start command write operation.
In this part of the code, we are sending data to 16*2 lcd display. The data is copied to port 0 of 8051 microcontroller. RS is made high for command write . RW is made low for write operation. High to low pulse is applied on enable(E) pin to start data write operation.
In this part of the code, we are converting digital data into temperature and displaying it on 16*2 lcd display.
Also, check other thermometers using LM35 with different microcontrollers:
- Digital Thermometer using Arduino and LM35
- Temperature Measurement using LM35 and AVR Microcontroller
- Room Temperature Measurement with Raspberry Pi
- Log in or register to post comments
Done a gud job ,it's really
Done a gud job ,it's really superb
Awesome, keep it up.
Hey Really well written and described. Keep up the good work! All the best
Nice work.!!
temperature measurement
How to measure negative temperature by LM35
Its not possible with LM35
Proteus Simulation
Is it possible to use the code for Proteus Simulation? Thanks and more power.
yes , u can use same code for
yes , u can use same code for proteus simulation
project doubt
sir, we have dumped the program into the micro controller but its not working (no errors & no warnings) we didn't purchased the microcontroller development board instead we have built crystal oscillator &reset circuit to it what is the problem behind it ? can u rply to it as soon as possible
Are you sure the code is
Are you sure the code is uploaded correctly? If yes then try a basic blink program on your hardware and check if that is working properly
Yes sir , we have checked it & the led is blinking but the temperature is not displaying on the lcd
Check your LCD connections
Check your LCD connections make sure the contrast pin of the LCD is set correctly using a pot
Impressive explanation helps a lot thanks.
We have implemented the
We have implemented the circuit and code as given, LCD is glowing but nothing is displaying on the LCD. Proteus simulation also gives the same result-glowing LCD but no display of characters. What is the problem? Please help us ASAP as it is required for our academic project.
The problem should be with
The problem should be with your hardware, check the contrast pin of the LCD
I have executed this circuit design in Proteus and have burnt the keil hex code onto the microcontroller. On running the simulation, there were no such errors found but it is not dusplaying an output on the LCD. What's wrong?
Check your hardware
Check your hardware connection, make sure your contrast level on LCD is set properly
Yes read about that, tried
Yes read about that, tried all the possibilities, how exactly do I ensure what you're suggesting?
Is your LCD blank or showing
Is your LCD blank or showing black boxes? You shouldnotice your LCD from having black boxes to going blank when you set contrast level
It brightens on running the
It brightens on running the simulation but is blank, no black boxes or anything like that
Is there some problem in the
Is there some problem in the code? Maybe that's why the display is not showing any readings and just glowing? Can someone please help me, it's urgent.
Facing the same problem! Did you get the solution ?
No I didn't! The project is
No I didn't! The project is done and submitted though. I would suggest follow some other site's code. Technically, if the code was right, it should have been successful in Proteus, it wasn't. So there's a glitch in the code. Either from your own code or refer to something else.
In your code, you are reading ADC data from port , storing it to variable value, and directly displaying it. You are not converting ADC data to temperature. Please add the Data Convertion section. I am facing a problem in convertion
for 100 D Centi, ADC o/p is
for 100 D Centi, ADC o/p is 64 so first you will convert ADC out put to Decimal & then Decimal will be converted to ASCII to display it....right? Please reply if i am wrong.....

Join 100K+ Subscribers
Your email is safe with us, we don’t spam.
Be a part of our ever growing community.
Copyright © 2022 Circuit Digest . All rights reserved.
- Coding Ground
- Corporate Training

- Microprocessor Tutorial
- Microprocessor - Home
- Microprocessor - Overview
- Microprocessor - Classification
- 8085 Microprocessor
- Microprocessor - 8085 Architecture
- 8085 Pin Configuration
- Addressing Modes & Interrupts
- 8085 Instruction Sets
- 8086 Microprocessor
- Microprocessor - 8086 Overview
- 8086 Functional Units
- 8086 Pin Configuration
- 8086 Instruction Sets
- Microprocessor - 8086 Interrupts
- 8086 Addressing Modes
- Multiprocessor Configuration
- Configuration Overview
- 8087 Numeric Data Processor
- I/O Interfacing
- I/O Interfacing Overview
- 8279 Programmable Keyboard
- 8257 DMA Controller
- Microcontrollers
- Microcontrollers - Overview
Microcontrollers - 8051 Architecture
- 8051 Pin Description
- 8051 Input Output Ports
- Microcontrollers - 8051 Interrupts
- Peripheral Devices
- Programmable Peripheral Interface
- Intel 8255A - Pin Description
- 8253 - Programmable Interval Timer
- 8253/54 - Operational Modes
- Microprocessor Useful Resources
- Microprocessor - Quick Guide
- Microprocessor - Useful Resources
- Microprocessor - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable as per the requirement. An on-chip crystal oscillator is integrated in the microcontroller having crystal frequency of 12 MHz.
Let us now discuss the architecture of 8051 Microcontroller.
In the following diagram, the system bus connects all the support devices to the CPU. The system bus consists of an 8-bit data bus, a 16-bit address bus and bus control signals. All other devices like program memory, ports, data memory, serial interface, interrupt control, timers, and the CPU are all interfaced together through the system bus.

WatElectronics.com
8051 Microcontroller Architecture and Block Diagram with Applications
July 30, 2019 By admin

8051 Microcontroller Architecture
The 8051 Microcontroller is one of the basic types of microcontrollers, designed by Intel in 1980s. This microcontroller was based on Harvard Architecture and developed primarily for use in embedded systems technology. Normally, this microcontroller was developed using NMOS technology, which requires more power to operate. Therefore, Intel redesigned Microcontroller 8051 using CMOS technology and their updated versions came with a letter C in their name, for instance an 80C51 it is an 8 bit microcontroller. These latest Microcontrollers requires less power to operate as compared to their previous versions. The 8051 Microcontroller has two buses and two memory spaces of 64K X 8 size for program and data units. It has an 8 bit processing unit and 8 bit accumulator units.
Following diagram is 8051 Microcontroller architecture . Let us have a look at each part or block of this Architecture of microcontroller.

Central Processor Unit (CPU)
As we know that the CPU is the brain of any processing device of the microcontroller. It monitors and controls all operations that are performed on the Microcontroller units. The User has no control over the work of the CPU directly . It reads program written in ROM memory and executes them and do the expected task of that application.
As its name suggests, Interrupt is a subroutine call that interrupts of the microcontrollers main operations or work and causes it to execute any other program, which is more important at the time of operation. The feature of Interrupt is very useful as it helps in case of emergency operations. An Interrupts gives us a mechanism to put on hold the ongoing operations, execute a subroutine and then again resumes to another type of operations.
The Microcontroller 8051 can be configured in such a way that it temporarily terminates or pause the main program at the occurrence of interrupts. When a subroutine is completed, Then the execution of main program starts. Generally five interrupt sources are there in 8051 Microcontroller. There are 5 vectored interrupts are shown in below
Out of these, (INT0) ̅ and (INT1) ̅ are external interrupts that could be negative edge triggered or low level triggered. When All these interrupts are activated, set the corresponding flogs except for serial interrupt,.The interrupt flags are cleared when the processor branches to the interrupt service routine (ISR). The external interrupt flags are cleared when the processor branches to the interrupt service routine, provides the interrupt is a negative edge triggered whereas the timers and serial port interrupts two of them are external interrupts, two of them are timer interrupts and one serial port interrupt terminal in general.
Microcontroller requires a program which is a collection of instructions. This program tells microcontroller to do specific tasks. These programs require a memory on which these can be saved and read by Microcontroller to perform specific operations of a particular task. The memory which is used to store the program of the microcontroller is known as code memory or Program memory of applications. It is known as ROM memory of microcontroller also requires a memory to store data or operands temporarily of the micro controller. The data memory of the 8051 is used to store data temporarily for operation is known RAM memory. 8051 microcontroller has 4K of code memory or program memory,that has 4KB ROM and also 128 bytes of data memory of RAM.
Basically Bus is a collection of wires which work as a communication channel or medium for transfer of Data. These buses consists of 8, 16 or more wires of the microcontroller. Thus, these can carry 8 bits,16 bits simultaneously. Hire two types of buses that are shown in below
- Address Bus
Address Bus : Microcontroller 8051 has a 16 bit address bus for transferring the data. It is used to address memory locations and to transfer the address from CPU to Memory of the microcontroller. It has four addressing modes that are
- Immediate addressing modes.
- Bank address (or) Register addressing mode.
- Direct Addressing mode.
- Register indirect addressing mode.
Data Bus : Microcontroller 8051 has 8 bits of the data bus, which is used to carry data of particular applications.
Generally, we know that the microcontroller is a device, therefore it requires clock pulses for its operation of microcontroller applications. For this purpose, microcontroller 8051 has an on-chip oscillator which works as a clock source for Central Processing Unit of the microcontroller. The output pulses of oscillator are stable. Therefore, it enables synchronized work of all parts of the 8051 Microcontroller.
Input/Output Port
Normally microcontroller is used in embedded systems to control the operation of machines in the microcontroller. Therefore, to connect it to other machines, devices or peripherals we require I/O interfacing ports in the microcontroller interface. For this purpose microcontroller 8051 has 4 input, output ports to connect it to the other peripherals
Timers/Counters
8051 microcontroller has two 16 bit timers and counters. These counters are again divided into a 8 bit register. The timers are used for measurement of intervals to determine the pulse width of pulses.
Please refer to this link to know more about 8051 Microcontroller MCQs .
Applications of 8051 Microcontroller
Some of the applications of 8051 is mainly used in daily life & industrial applications also some of that applications are shown below
- Light sensing and controlling devices
- Temperature sensing and controlling devices
- Fire detections and safety devices
- Automobile applications
- Defense applications
Some industrial applications of micro controller and its applications
- Industrial instrumentation devices
- Process control devices
Some of 8051 microcontroller devices are used in measurement applications
- Voltmeter applications
- Measuring and revolving objects
- Current meter objects
- Hand held metering system
8051 Microcontroller Applications in Embedded Systems
The applications of 8051 microcontroller involves in 8051 based projects. The list of 8051 projects is listed below.
- Arduino Managed High Sensitive LDR based Power Saver for Street Light Control System
- The Temperature Humidity Monitoring System of Soil Based on Wireless Sensor Networks using Arduino
- RFID based Electronic Passport System for Easy Governance using Arduino
- Arduino based RFID Sensed Device Access
- Arduino based DC Motor Speed Control
- Arduino Based Line Following Robot
- Zigbee based Automatic Meter Reading System
- GSM based Electricity Energy Meter Billing with Onsite Display
- Android Phone Speech Recognition Sensed Voice Command based Notice Board Display
- Parking Availability Indication System
- Voice Controlled Home Appliances
- Remote Control Home Appliances
- PC Mouse operated Electrical Load Control Using VB Application
- Solar Highway Lighting System with Auto Turn Off in Daytime
- 8051 Microcontroller based Wireless Energy Meter
- Farmer Friendly Solar Based Electric Fence for Deterring Cattles
- Vehicle Movement Sensed Streetlight with Daytime auto off Features
Please refer to this link to know more about ARM Architecture MCQs & Microcontrollers MCQs
Do you have any innovative ideas to implement the 8051 microcontroller based electronics projects? Then, feel free to share your ideas for getting your project solutions from us and also other readers, by posting in the comments section below.
PCB Manufacturing
Rigid-flex pcb.
- Heavy Copper PCB
- High Frequency PCB
- High Tg PCB
- Metal Core PCBs
- Aluminum PCBs
- Rogers Material
PCB Assembly
- Custom Cable Assembly
- Custom Wiring Harness
- Capabilities
- Pad Hole Ring Copper
- Pad Hole Ring Copper Specification
Contact WellPCB Team
- Your Name *
- Phone Number *
- Tell us your needs (as specific as possible) *
- File (Gerber files and BOM need to be compressed into one ZIP file.)
AT89c51 Microcontroller: Programming, Pinout, Features, and Alternatives
Atmel AT89 series fall under the 8-bit microcontroller family compatible with Intel 8051. Their advantages include cost-effectiveness and high flexibility when used in embedded control applications. Examples of the chip under the series are AT89C2051, AT89C51, etc. For today, we’ll discuss the AT89C51 microcontroller.
What is the AT89C51 Microcontroller?
AT89C51 is a CMOS 8-bit microcontroller of high performance but low power. Further, it has an erasable and flashes programmable (4K bytes) EPROM .

Manufacturers use the high-density nonvolatile memory technology of an Atmel to produce a powerful microcomputer. Moreover, it’s often conjunction with pinout and set instructions from MCS-51 industry standards.
AT89C51 Pinout
The table below summarizes the pin configuration of AT89C51.
At89c51 pinout
Features of Microcontroller
The features and specifications of at89c51 comprise the following;
- First, it has six interrupt sources and a 128 × 8-bit internal RAM.
- Then, its fully static operation via the external oscillator ranges from 0Hz to 24MHz.
- Thirdly, it is compatible with MCS-51™ products.
- Despite lacking comparators, DAC and in-built ADC module, and data EEPROM, it has an internal oscillator.
- It has a 4Kb flash memory.
- It also has power-down and low-power idle modes.
- The 40-pinned at89c51 has an operating voltage of 2V to 5.5V and an operating temperature ranging from -55°C to 125°C.
- Besides having a three-level program memory lock, it also has a programmable serial channel. Additionally, it has two 16-bit timers/counters and 32-programmable I/O lines.
- Lastly, it can endure 1000 write/erase cycles during 4K bytes of in-system reprogrammable flash memory endurance.
Other ATMEL MCUs
They are as follows;
- ATtiny88,
- ATMega328P ,
- ATtint45, and
- AT89S52.
How to Program the AT89C51 (8051) Microcontroller
You can use software like Keil µVision or Arduino to program AT89C51 . We’ll also need a programming environment like an Integrated Development Environment (IDE), USBASP programmer, and MAX232 programming hardware. You’ll purchase all the components separately.
- First, a compiler converts the software into readable HEX files . An IPE then dumps the files into MCUs for reading.
- Then, you can save time by simulating the software before using it on the hardware.
How to select your Atmel Microcontroller?
Undeniably, there are several microcontrollers from Atmel and PIC families, all with advantages and disadvantages. Choosing the best one for your project, therefore, requires a good criterion.
The list below gives examples of the factors you can consider.
- First, ensure your MCU can support communication protocols like CAN , I2C, SPI, and UART for such projects. Some MCUs may also support two or more modules for one protocol.
- Secondly, check on your actuators and sensors , then verify the modules your MCU may need. For instance, a supportive resolution and ADC channel in MCUs may be ideal for reading many Analog voltages.
- Then, smaller sizes like 8-pin MCUs, which are relatively cheaper, are suitable with a price and size limitation.
- In addition, choose an MCU that suits the operating voltage in your system. For example, a 3.3V MCU operates well on a system (devices or sensors) that communicate and work on 3.3V.
- Finally, your MCU must have wide applications and good online community support, such as Atmega338 or AT89S52.
Applications
Some applications of at89c51 include;
- As a replacement for the Arduino module,

(Arduino UNO microcontroller)
- In projects that require multiple I/O communications and interfaces,
- Advanced level A/D applications in consumer, appliances, industrial, and automotive applications,
- In learning Atmel, and
- Multiple DIY projects.
That sums up our at89c51 article. For further inquiries or questions, kindly contact us .

Cras quis nulla commodo
Circuit board fabrication and pcb assembly turnkey services.
We use cookies
We use our own and third-party cookies to personalize content and analyze web traffic. Read more about cookies.

- 8051 Microcontroller , General
8051 Microcontroller Introduction and Basics
- October 9, 2017
- By Administrator
This article is about the 8051 Microcontroller Introduction and some of its basic features. The 8051 Microcontroller is one of the most popular and most commonly used microcontrollers in various fields like embedded systems, consumer electronics, automobiles, etc.
Technically called as Intel MCS-51 Architecture, the 8051 microcontroller series was developed by Intel in the year 1980 and were very popular in the 80’s (still are popular).
8051 Microcontroller has many features like Serial Communication, Timers, Interrupts, etc. and hence many students and beginners start their work on the concept of Microcontrollers with 8051 Microcontroller (although this trend seems to be changed with the introduction of Arduino).
Even though 8051 Microcontroller might seem a little bit out of fashion, we feel that it is one of the best platforms to get started with Microcontrollers, Embedded Systems and Programming (both C and Assembly).

So, in this post, you’ll be given an introduction to 8051 microcontroller and some of the basics of 8051 Microcontroller.
But before going in to the Introduction and Basics of 8051 Microcontroller, we need to a little bit about what a Microcontroller is and Difference between Microprocessor and Microcontroller.
The Differences between Microprocessor and Microcontroller are tabulated in this post.
What is a Microcontroller?
A Microcontroller is a VLSI IC that contains a CPU (Processor) along with some other peripherals like Memory (RAM and ROM), I/O Ports, Timers/Counters, Communication Interface, ADC, etc.

On the contrary, a Microprocessor (which was developed before Microcontroller) is just a Processor (CPU) and doesn’t have the above mentioned peripherals. In order to make it work or build a system around it, we need to interface the peripherals separately.

Until the development of Microcontrollers, almost all process and control tasks were implemented using Microprocessors. As Microprocessor need the additional peripherals to work as a system, the overall cost of the control system was high.
But with the development of Microcontroller, the situation has changed completely including the world of Embedded Systems.
8051 Microcontroller Introduction and History
The 8051 Microcontroller Introduction gives a brief overview about the 8051 Microcontroller and its history. Intel’s 8051 Microcontroller (Intel MSC-51 Architecture) was a successor to 8048 Microcontroller (Intel MSC-48 Architecture).
Originally, 8051 Microcontrollers were developed using N-MOS Technology but the use of battery powered devices and their low power consumption lead to usage of CMOS Technology (which is famous for its low power consumption).
Even though Intel developed 8051 Microcontrollers (which is discontinued in 2007), more than 20 semiconductor manufacturers are still producing 8051 compatible microcontrollers i.e. processors based on MSC-51 Architecture.
Some of the 8051 Microcontrollers produced by different manufacturers are: Atmel (AT89C51, AT89S51), Phillips (S87C654), STC Micro (STC89C52), Infineon (SAB-C515, XC800), Siemens (SAB-C501), Silicon Labs (C8051), NXP (NXP700, NXP900), etc.
Majority of the modern 8051 Microcontrollers are Silicon IP Cores (Intellectual Property Cores) but discrete 8051 Microcontroller IC’s are also available. Because of their low power consumption, smaller size and simple architecture, 8051 IP Cores are used in FPGAs (Field Programmable Gate Array) and SoCs (System on Chip) instead of Advanced ARM Architecture based MCUs.
Applications of 8051 Microcontroller
Even with the development of many advanced and superior Microcontrollers, 8051 Microcontroller is still being used in many embedded system and applications.
Some of the applications of 8051 Microcontroller are mentioned below:
- Consumer Appliances (TV Tuners, Remote controls, Computers, Sewing Machines, etc.)
- Home Applications (TVs, VCR, Video Games, Camcorder, Music Instruments, Home Security Systems, Garage Door Openers, etc.)
- Communication Systems (Mobile Phones, Intercoms, Answering Machines, Paging Devices, etc.)
- Office (Fax Machines, Printers, Copiers, Laser Printers, etc.)
- Automobiles (Air Bags, ABS, Engine Control, Transmission Control, Temperature Control, Keyless Entry, etc)
- Aeronautical and Space
- Medical Equipment
- Defense Systems
- Industrial Process and Flow Control
- Radio and Networking Equipment
- Remote Sensing
8051 Microcontroller Basics
8051 is an 8 – bit Microcontroller i.e. the data bus of the 8051 Microcontroller (both internal and external) is 8 – bit wide. It is a CISC based Microcontroller with Harvard Architecture (separate program and data memory).
Since the basic layout of a microcontroller includes a CPU, ROM, RAM, etc. the 8051 microcontroller also has a similar layout. The following image shows a brief layout of a typical 8051 Microcontroller.

8051 Microcontroller Features
- 8 – Bit ALU : ALU or Arithmetic Logic Unit is the heart of a microcontroller. It performs arithmetic and bitwise operation on binary numbers. The ALU in 8051 is an 8 – Bit ALU i.e. it can perform operations on 8 – bit data.
- 8 – Bit Accumulator :The Accumulator is an important register associated with the ALU. The accumulator in 8051 is an 8 – bit register.
- RAM : 8051 Microcontroller has 128 Bytes of RAM which includes SFRs and Input / Output Port Registers.
- ROM : 8051 has 4 KB of on-chip ROM (Program Memory).
- I/O Ports : 8051 has four 8 – bit Input / Output Ports which are bit addressable and bidirectional.
- Timers / Counters : 8051 has two 16 – bit Timers / Counters.
- Serial Port : 8051 supports full duplex UART Communication .
- External Memory : 8051Microcontroller can access two 16 – bit address line at once: one each for RAM and ROM. The total external memory that an 8051 Microcontroller can access for RAM and ROM is 64KB (2 16 for each type).
- Additional Features : Interrupts, on-chip oscillator, Boolean Processor, Power Down Mode, etc.
NOTE : Some of the features like size of RAM and ROM, number of Timers, etc. are not generic. They vary by manufacturer.
8051 Microcontroller Packaging
8051 Microcontroller is available in a variety of IC Packaging Types. The most popular and commonly used 8051 Microcontroller Packaging is Dual in-line or DIP. It is often available as a 40 – pin PDIP or Plastic DIP IC.
The other common packaging type is 44 – Lead PLCC (Plastic Leaded Chip Carrier). It is a kind of surface mount package.
Another surface mount packaging for 8051 microcontroller is 44 – Lead TQFP (Thin Quad Flat Package).
This article gave an introduction to 8051 Microcontroller and some its basic features. In the next article, we will see the Pinout Diagram, Pin Description and Architecture of 8051 Microcontroller.
Related Posts:
- 8051 Microcontroller Memory Organization
- 8051 Microcontroller Instruction Set
- 8051 Microcontroller Special Function Registers (SFRs)
- Bitwise Operators in Microcontroller Programming
- Basics of Embedded C Program
- Interfacing I2C LCD with STM32F103C8T6 | STM32 I2C LCD…
10 Responses
Very knowledgeable
Ty so much for this kind of easy notes. It’s really best and simple to understand.
Thanks much buddy
Very good information with easy language.Thanks
Hi, quite sentimental article: I wrote Masters thesis on Motorola 6800 microcontroller simulation on ICL 1900 mainframe, but yet in 1979, year before 8051 was born … Nothing has changed apart the world.
it is very useful for easy understanding of the basics
Its awesome to learn and understand in a easy way thank you thank you very much
this information is very helpful for me thank u so much
Very nice and short presentation. Very helpful for the beginners, Thanks
Very well written series. Much easier to read than the original product manual. I could have made very good use of this series when I started using the 8051 in 1990. Since then I have designed and built several machine controllers. My background is Avionics technician (35years) & Industrial / University Electronics Tech. I have been the compiler / subject author of a complete aircraft maintenance manual. Now retired, I’m still messing with electronics.
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
- Affiliate Disclosure
- Terms and Conditions
- Privacy Policy
Copyright © 2022 Electronicshub.org

- All Electronics Projects
- Community Projects
- NEW | DIY Webinars
- Submit Your Project
- Mini Projects
- College Projects
- Advanced Projects
- AI/ML Projects
- Reference Designs
- S/W Projects
- Tech Trends
- Tech updates
- Aerospace & Defence
- Communication & Networks
- Energy & Power
- LEDs & Lighting
- Testing Times
- Thought Leaders
- Industry Powered Content
- NEW @ Electronicsforu.com
- New Products
- Innovative Components
- Components Corner
- Tech Updates
- Press Releases
- Rewards & Achievements
- Your Activities
- Leaderboard
- All About Points, Achievement Unlocks & Gaining Ranks
- Email Notification Settings
- NEW | Electronics Calculators
- NEW | Events
- Premium Content
- Startup Contests
- Design Contests
- LOGIN 2 WIN
- SCORE & WIN

Network Consists of Further Focused Websites (Channels)

Inspired by our flagship publication
Electronics for you.

- Sample For Free
- Subscribe For Print
- Subscribe For Ezine
CHECKED OUT EFY EXPRESS?

- READ E-ZINE
© Copyright 2022 - EFY Group

Digital Door Lock – Password based Electronic Code Lock using 8051 var cid = '4751671870'; var pid = 'ca-pub-4648753796436329'; var slotId = 'div-gpt-ad-circuitstoday_com-box-3-0'; var ffid = 1; var alS = 1002 % 1000; var container = document.getElementById(slotId); var ins = document.createElement('ins'); ins.id = slotId + '-asloaded'; ins.className = 'adsbygoogle ezasloaded'; ins.dataset.adClient = pid; ins.dataset.adChannel = cid; ins.style.display = 'block'; ins.style.minWidth = container.attributes.ezaw.value + 'px'; ins.style.width = '100%'; ins.style.height = container.attributes.ezah.value + 'px'; container.style.maxHeight = container.style.minHeight + 'px'; container.style.maxWidth = container.style.minWidth + 'px'; container.appendChild(ins); (adsbygoogle = window.adsbygoogle || []).push({}); window.ezoSTPixelAdd(slotId, 'stat_source_id', 44); window.ezoSTPixelAdd(slotId, 'adsensetype', 1); var lo = new MutationObserver(window.ezaslEvent); lo.observe(document.getElementById(slotId + '-asloaded'), { attributes: true });
As the world grows to be digitally dependent, even doors can now be designed to be secure and safe. The digital version of the lock and key holds a lot of promising features. The digital door lock is securely placed with passwords. However, this may also attract unethical hackers, therefore, an extra layer of security is also required. In this electronics project-based article, we have created a digital door lock that is controlled using a basic controller, the 8051 microcontrollers. The aim of this article is to understand the fundamental working principle behind a digital door lock.
What is a Digital Door Lock?
The Digital Door Lock in general is a password-based electronic code lock. In this project, we have designed the digital door lock using an 8051 microcontroller, a keypad, and a 12-volt dc relay. In this article, we have designed a simple digital door lock using 8051 -which can be used as a security checking system to limit access to an area/room only for certain individuals with the password. So our digital door lock project can be called with a very wide range of names like a digital combination lock using 8051 or a digital security code lock using 8051 microcontrollers or a password security system using 8051 or an electronic code lock or a digital code lock using 8051. People call this kind of a “ security system ” with different names, though all of them mean to build a basic password-based security system using a microcontroller like 8051 or AVR or PIC or Arduino (a controller of choice) with extra features like automatic door lock/opening facility, sound alarm, GSM based SMS alert, etc.
Digital Door Lock – Project Summary
Note:- We have a wonderful collection of 8051 projects which we have designed and published previously. Take a look If you are interested in building 8051 based applications and systems yourself! It’s a lot of fun to learn and build new kinds of stuff.
Let’s get to building our password-based digital door lock now. The circuit diagram of the digital code lock is given below. Assemble the circuit as shown in the diagram.
Password based Digital Door Lock/Electronic Code Lock – Circuit Diagram

Components Used
Connections explained.
Make the connections of the digital code lock project as shown in the circuit diagram. We have explained the connections below.
Keypad to 8051 – In this particular electronic code lock project, we have interfaced a 4×4 keypad to Port 3 of 8051 microcontroller. Row pins are connected from P3.0 to P3.3, whereas Column pins are connected from P3.4 to P3.7. Read our tutorial on interfacing keypad to 8051 – to learn how keypad is connected to 8051 and how keypresses are identified and displayed.
16×2 LCD Module to 8051 – We are using a 16×2 lcd module to display the status messages of the project. We have connected this LCD module in 8 bit mode (using 8 data lines). The 8 data lines are connected to Port 0 of 8051. An external pull-up resistance is connected using a 10K Resistor Network (with 8 pins) at Port 0 to interface the 8 data lines of LCD. The LCD controlling pins RS, R/W, and E are connected to Port 2 pins P2.7, P2.6, and P2.5 respectively. Read our tutorial on interfacing LCD to 8051 – to learn how to connect the LCD module to 8051 properly and also to learn how to display text messages on the LCD module perfectly.
Push button switch – is used to setup reset circuit of 8051 and Crystal is used to provide necessary clock to 8051.
Working of the Digital Door Lock Circuit
The objective of the Digital Door Lock project is to allow access to people who input the 5 digit password correctly and to not allow access to people who input passwords wrongly. We use a 4×4 Keypad to input digits to the microcontroller and a 12V relay is used to control the electronic solenoid lock (not shown in the circuit diagram) of the door. The password is stored inside the 8051 programs (program memory). In the example program given below, we use password 12345 and is stored in the program memory location with the label – PASSW.
Program/ Code – Password Based Security System
The program is written in assembly language. The important aspects and subroutines of the program are explained below.
KEY_SCAN – is the subroutine to identify a keypress. The method of column scanning is employed in identifying the pressed key. The pressed key is identified and is assigned a decimal equivalent value (ASCII value) of the pressed key. You may read the tutorial on the keypad to 8051 – interfacing to learn more about programming.
READ_KEYPRESS – is the subroutine to collect user inputs. A counter is set up using register R0 to count 5 times (this will limit the user input collection to the first 5 key presses). Register R1 is assigned address location 160D. The collected user inputs are saved in address location starting from 160D. This location is incremented successively using INC R1 – command of 8051. So first user input is stored in 160D, second user input in 161D, third in 162D, fourth in 163D, and fifth user input in 164D. These address locations are accessed using register R1 via the indirect addressing method .
Note:- There are two delay routines written in the program. DELAY1 – is used as a delay for outputting messages on the LCD module properly. After sending a message/data to the LCD module, DELAY1 is called so that the message stays on the LCD screen for the stipulated delay time. DELAY2 (is a 2.5 seconds delay) is used to provide the necessary debouncing effect for the keypad. (A push-button switch or any kind of mechanical switch has a bouncing effect . This effect has to be nullified either with a capacitor or with some tweaks inside the software – for example – a 1 or 2 seconds delay after a key press is scanned)
CHECK_PASSWORD – is the subroutine to compare user input password (5 digits) with the actually stored password in the program. Comparison is made digit by digit by selecting each digit from stored password with the help of DPTR and loading it to Accumulator (with MOVC A,@A+DPTR). Each digit loaded to the accumulator is then compared with the corresponding digit stored as user input (in address locations 16D to 164D) by loading them one by one to register R1. Digits are compared by X-OR ing them with command XRL A,@R1. Based on the outcome of the comparison, this subroutine has commands written to either allow access (and turn ON relay) or to not allow access and display an “Access Denied” message on the LCD screen.
So that’s all about the Password-based Security System using 8051. We hope you have understood the circuit, it’s working, and the program really well. If you have any doubts, please ask in the comments section. If you would like to learn more interesting and similar projects like this electronic password lock, take a look at the following security system/lock projects.
RFID-based Security System using 8051 – is a security system very similar to Digital Door Lock or Electronic Code Lock in concept. The major difference in this project is that unique RFID Tags are used to identify authorized personnel (instead of keypad and password). An RFID reader is interfaced to 8051 to read RFID Tags.
Related Posts
Interfacing external memory eeprom to 8051 microcontroller, learn to build real time clock using 8051and ds1307 rtc module, interfacing nokia 5110 display to 8051 micro controller, 37 comments.
only the lcd is glowing . Nothing is displayed on screen.
Plz send the pcb layout
If motor burns then how will you open the door
Whether the resistors and capacitors would be available in the development board? or do we need to connect it externally to the cicuit??
There is no source of 5 v in circuit For vcc
Will u please say me the Correct password as per above given program????
Please provide program code.hex
the relay part is not working for me can any one help me
How to interface the motor
I am not getting 4th line… Can anyone help me SEL EQU 41H
hello .. i wan to know.. how to add the password digit.. for example.. i want to use 6 or 8 digit for my password.. i really want to know to solve my problem in my mini project… thank you.. i need your help………….
where to add a buzzler
1)can anyone tell me that how, i can upload this program to 8051 2)and how i can change the password
how to burn assembly language in 8051 ..someone please tell the procedure (full instruction) [email protected]
Plz..provide program in C language..
thanku very much for very useful work
please provide the code in C-language
what is function for TMOD,TH1,SCON and also SEL EQU 41H
Type above and press Enter to search. Press Esc to cancel.

IMAGES
VIDEO
COMMENTS
The Intel MCS-51 (commonly termed 8051) is a single chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems.The architect of the Intel MCS-51 instruction set was John H. Wharton. Intel's original versions were popular in the 1980s and early 1990s, and enhanced binary compatible derivatives remain popular today. It is an example of a complex instruction set ...
8051 is one of the first most popular microcontroller also known as MCS-51. It was introduced by Intel in the year 1981. Initially it came out as N-type metal-oxide-semiconductor (NMOS) based microcontroller, but later versions were based on complementary metal-oxide-semiconductor (CMOS) technology.
Ⅰ Introduction. The 8051 microcontroller series, technically referred to as the Intel MCS-51 Architecture, was developed by Intel in 1980 and was very popular in the 80's (still are popular). In differen t fields, such as embedded systems, consumer electronics, vehicles, etc., the 8051 Microcontroller is one of the most prominent and most commonly used microcontrollers.
The 8051 Microcontroller was designed in the year 1981 by the company Intel and is also called the Intel MCS-51. It has several pragmatic and good features, which are listed as follows: 8-bit microcontroller Built with 40 pins DIP ROM storage of 4KB RAM storage of 128 bytes 4 parallel 8-bit ports 2 timers of 16-bits
Atmel® introduced the first 8-bit Flash microcontroller in 1993. This first-generation Flash microcontroller was based on the classic 8051 core. The on-chip Flash memory retained its contents even after power was turned off, and was electrically erasable and programmable. Atmel 8051 8-bit microcontrollers were the industry's first Flash based
The 8051 Microcontroller (MCU) series was developed by Intel in 1980 for embedded systems. It follows CISC (Complex Instruction Set Computer) architecture. It has separate memory spaces for instructions and data. The Intel MCS-51 (commonly termed 8051) was developed using NMOS (N-Type Metal-Oxide-Semiconductor) technology.
Conclusion 8051 Pin Diagram 8051 Pin Description It is the very famous 8051 microcontroller along with Arduino and ESP Family. But unlike both family It comes in DIP package and is a single or main component which requires to be programmed. This 8051 can easily be programmed either using Arduino ICSP or using any other FTDI custom software.
8051 Microcontroller Notes Dr.YNM • 419.6k views Case study revivng automobile industry Dev Ajith • 4.5k views Microcontroller overview 1 Sally Salem • 1.5k views Vlsi design mosfet vennila12 • 17.3k views Question paper with solution the 8051 microcontroller based embedded systems...
The end directive indicates the end of the assembly code. The assembler will ignore content after the END directive and it is supposed to be used as the last line of the 8051 Microcontroller assembly code. Conclusion. In this tutorial, we have discussed different assembler directives of the 8051 Microcontroller. To see the complete datasheet of ...
Installing and setting up Keil C51 for 8051. Step 1: Head to the Keil C51 site to download the installation files for Keil C51 IDE. Once downloaded run the .exe file, and then launch the Keil C51 IDE. Step 2: Click on the Project dropdown menu and then click on New μvision Project. Step 3: Create a new folder at any suitable location on your ...
The 8051 microcontroller programming is performed in embedded C language using Keil software. Features of 8051 Microcontroller: Let's see the common feature of 8051 microcontroller: It having four register banks 64K bytes on-chip programmable memory (ROM) 128 bytes on-chip data memory (RAM) Address bus is 16-bit unidirectional
Microcontroller 8051 contains code memory or program memory 4K so which has 4KB Rom and it also comprises data memory (RAM) of 128 bytes. Bus Fundamentally Bus is a group of wires which function as a communication canal or means for the transfer of Data. These buses comprise 8, 16, or more cables.
8051 Architecture. The 8051 processes 8-bit data and is an 8-bit microcontroller. Here is the block diagram showing microcontroller architecture. According to it, the 8051 consists of a CPU, RAM, Flash Memory (EEPROM) and I/O. Their peripherals communicate using the internal data bus that is an 8-bit data bus.
Measuring Temperature with LM35 using 8051: 8051 microcontroller is a 8 bit microcontroller which has 128 bytes of on chip RAM , 4K bytes of on chip ROM, two timers, one serial port and four 8bit ports. 8052 microcontroller is an extension of microcontroller. The table below shows the comparison of 8051 family members.
Microcontrollers 8051 Architecture - 8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable as per
What is 8051 Trainer Board? A microcontroller is a small integrated circuit designed to do a specific operation in an embedded system. A typical microcontroller board contains a processor, memory, and input/output (I/O) ... Conclusion: In conclusion, even though 8051 trainer board is a very useful microcontroller board we
The 8051 Microcontroller has two buses and two memory spaces of 64K X 8 size for program and data units. It has an 8 bit processing unit and 8 bit accumulator units. 8051 Microcontroller Architecture. Following diagram is 8051 Microcontroller architecture. Let us have a look at each part or block of this Architecture of microcontroller.
Atmel AT89 series fall under the 8-bit microcontroller family compatible with Intel 8051. Their advantages include cost-effectiveness and high flexibility when used in embedded control applications. Examples of the chip under the series are AT89C2051, AT89C51, etc. For today, we'll discuss the AT89C51 microcontroller.
The 8051 is the name of a big family of microcontrollers. The device which we are going to use along this tutorial is the 'AT89S52' which is a typical 8051 microcontroller manufactured by Atmel™. Note that this part doesn't aim to explain the functioning of the different components of a 89S52 microcontroller, but
Electronics Hub - Tech Reviews | Guides & How-to | Latest Trends
This presentation includes all informative notes/tutorial on 8051 microcontroller. Various features of 8051 microcontroller are: 8-bit CPU. 16-bit Program Counter. 8-bit Processor Status Word (PSW) 8-bit Stack Pointer. Internal RAM of 128bytes. Special Function Registers (SFRs) of 128 bytes. 32 I/O pins arranged as four 8-bit ports (P0 - P3)
16 Conclusion. The foregoing should give a fair idea how the C51 compiler can be used in real embedded program development. Its great advantage is that it removes the necessity of being an expert in 8051 assembler to produce effective programs. Really, for the 8051, C51 should be viewed as a universal low to medium level language which both ...
Keypad to 8051 - In this particular electronic code lock project, we have interfaced a 4×4 keypad to Port 3 of 8051 microcontroller. Row pins are connected from P3.0 to P3.3, whereas Column pins are connected from P3.4 to P3.7. ... Conclusion. So that's all about the Password-based Security System using 8051. We hope you have understood ...