echo '' ;

8051

The 8051 microcontroller, introduced by Intel in 1980, is a widely-used 8-bit microcontroller. It has become one of the most popular microcontrollers due to its versatile architecture and rich feature set. This architecture follows a Harvard architecture with separate program memory and data memory. It includes on-chip RAM and ROM, I/O ports, timers/counters, serial communication ports, and interrupts, making it suitable for a wide range of embedded control applications.

Read more: 8051

The instruction set of this controller is well-optimized for embedded systems programming, offering a variety of instructions for arithmetic, logic, data transfer, and control operations. Development tools such as assemblers, compilers, simulators, and in-circuit emulators are available for software development and debugging purposes.

This microcontroller finds applications in diverse fields including industrial control systems, automotive electronics, consumer electronics, telecommunications, and more, owing to its reliability, versatility, and widespread availability.

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

Block Diagram

 

RegisterDescription
Accumulator8-bit register also called A register or Acc register.
B-RegisterMostly used for Multiply and Division operations.
Program Status Word (PSW)Special function register that can also address bit or byte methods. Contains programming status.
Stack Pointer8-bit special function register. Stack may be in any location of On-chip memory of RAM.
Stack pointer values will increment when executing PUSH and CALL instructions.
Data Pointer16-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


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

Data sheet

IDE

Development Tool (Compiler, Assembler, Linker, Debugger)


Data type size in IAR 8051

  • Note : the below program is executed in IAR embedded workbench  with this controller Core.
  • char,unsigned char,  int, unsigned int size.
#include <stdio.h>

int main() {
    printf("\n8051 char size : %d", sizeof(char));
    printf("\n8051 unsigned char size : %d", sizeof(unsigned char));
    printf("\n8051 int size : %d", sizeof(int));
    printf("\n8051 unsigned int size : %d", sizeof(unsigned int));
    return 0;
}

OutPut

8051 char size : 1
8051 unsigned char size : 1
8051 int size : 2
8051 unsigned int size : 2

Interface using 8051

“Interfacing is a fundamental concept in the realm of microcontrollers, particularly in the context of the this controller. As the microcontroller acts as a CPU capable of processing data and generating output, the need arises for input devices to feed data and output devices to display results. In this scenario, we utilize input devices like keyboards and output devices such as LCD displays in conjunction with the microcontroller. Interfacing entails the process of linking these devices to facilitate the exchange of information, thereby simplifying program development. Various input and output devices, including LEDs, LCDs, 7-segment displays, keypads, motors, buzzers, and others, can be employed to meet specific requirements. Explore more. https://aruneworld.com/category/embedded/8051-mcu/8051-interface/

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.