Contents
8051 Features
- 8 bit based Central Processing Unit
- In-build Clock circuit and Oscillators
- 32 bit I/O lines
- 64Kb External data memory, 64Kb external program memory
- Two 16bit Timer/Counter
- Five interrupt based on two priority
- Full duplex serial port
- P0-port does not have pull-up resistor.
- Harvard architecture
- CISC
8051 Block Diagram
Accumulator
- 8 bit register also called as A regiester or Acc register
B- Register
- Its moslt using Multiply and division operations
Program Status Word (PSW)
- This is Special function register, can also address bit or byte method
- It contains the programming status.
- It is mainly using for select the particular register bank form four register banks
Stack Pointer
- 8 bit Special function register.
- Stack may be in any location of On chip memory of RAM
- Stack pointer values will increment when execute the PUSH and CALL instructions
Data Pointer
- 16 Bit register (DPH-8bit and DPL-8bit)
I/O Ports 0-3 Latch and Drivers
Four different I/O Ports(P0,P1,P2,P3.
- Each Port have 8 pins (32 pins).
- All port pins are working Bi-directional method.
- Each Ports are contains separate Latch, Output Driver and Input Buffer.
- Port Pin as a INPUT Mode
- pin = 1 (input) //define
- Port Pin as a OUTPUT Mode
- pin = 0 (output) //define
Serial Data Buffer
- It contains Two buffer register
- Transmit buffer register
- parallel in serial out
- Receiver buffer registers
- serial in parallel out
Timer register
- It has Two 16 bit registers namely TH0, TL0 and TH1, TL1
- Its mainly using for choosing timer and counter
Timer 0 and Timer 1 interrupts are generated by the timer register bits TF0 and TF1 Selecting the timer by configuring TMOD register and its mode of operation. Choosing and loading the initial values of TLx and THx for appropriate modes. Enabling the IE registers and corresponding timer bit in it. Setting the timer run bit to start the timer. Writing the subroutine for the timer for time required and clear timer value TRx at the end of subroutine.
Control Registers
- IP
- IE
- TMOD
- TCON
- SCON
- PCON
Timer and Control Unit
- It gives all timing and control of micro-controller
Oscillator
- Its using for generate a signal for controller
Instruction register
- This decode the next execute instruction’s op-code
EPROM and Program address register
RAM Address registers
ALU
SFR Register Banks
8051 Pin Diagram
- Vcc – +5v supply Voltage.
- Vss – Ground Pin
- Reset – Using for reset the micro-controller
EA(Bar) /Vp-p
- High – Accessing Internal Program Memory
- Low – Accessing External Program Memory
Note :Should gives 21volts DC supply, while programming EPROM .in Internal
XTAL1 and XTAL2 – Using Crystal Oscillator
Types of Memory
- Code Memory
- Internal RAM
- External RASM
- Special Function Registers(SFRs)
- Bit Memory
8051 Data sheet
8051 IDE
Development Tool (Compiler, Assembler, Linker, Debugger)
Data type size in IAR 8051
- Note : the below program is executed in IAR embedded workbench with 8051 Core.
- 8051 char,unsigned char, int, unsigned int size.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
//What will be printed as the result of the operation below ///compiled in IAR 8051 core #include <stdio.h> int main() { printf("\n 8051 char size : %d",sizeof(char)); printf("\n 8051 unchar size : %d",sizeof(unsigned char)); printf("\n 8051 int size : %d",sizeof(int)); printf("\n 8051 unsigned int size : %d",sizeof(unsigned int)); return 0; } /* Output : 8051 char size : 1 8051 unchar size : 1 8051 int size : 2 8051 unsigned int size : 2 */ |
8051 Interface
Interfacing is one of the important concepts in micro-controller 8051 because the micro-controller is a CPU that can perform some operation on a data and gives the output. However to perform the operation we need an input device to enter the data and in turn output device displays the results of the operation. Here we are using keyboard and LCD display as input and output devices along with the micro-controller. Interfacing is the process of connecting devices together so that they can exchange the information and that proves to be easier to write the programs. There are different type of input and output devices as for our requirement such as LEDs, LCDs, 7segment, keypad, motors, Buzzer and other devices etc. See more https://aruneworld.com/category/embedded/8051-mcu/8051-interface/
8051 Other Links
- http://www.instructables.com/id/ARDUINO-AS-A-8051-PROGRAMMER/
- https://tiktakx.wordpress.com/2014/04/19/programming-8051-using-arduino-up-for-grabs/
- http://www.keil.com/dd/chip/2999.htm
- Line Follower Robot using 8051 Microcontroller
- GSM Module Interfacing with 8051 Microcontroller
- Displaying an Image on Graphical LCD using 8051 Microcontroller
- Digital Clock using 8051 Microcontroller
- Interfacing ADC0808 with 8051 Microcontroller
- Digital Code Lock using 8051 Microcontroller
- Bluetooth Controlled Home Automation System using 8051
- PIR Sensor and GSM Based Security System
- RFID and Keypad Based Security System using 8051 Microcontroller
- RFID Based Attendance System
- Cell Phone Controlled Robot using 8051 Microcontroller
- Edge Avoiding Robot Using 8051
- Keil 8051 Example Programs*
- 8051projects*
- circuitdigest 8051-microcontroller-projects*
- https://www.engineersgarage.com/microcontroller/8051projects/
- http://www.electronicshub.org/8051-microcontroller-projects-engineering-students/
- http://www.circuitstoday.com/category/8051
- Interfacing of 8051 with (i2c based) 24LC64 EEPROM (code + Proteus simulation)*
- 8051 DAC (using DAC0808) code + Proteus simulation*
- 8051 LCD Interfacing code (In 4bit mode) + Proteus Simulation
- saeedsolutions (8051 micro-controller Projects)*