Skip to main content
  1. Data Science Blog/

The Basics of Microprocessor and Microcontroller

·2013 words·10 mins· loading · ·
IT Infrastructure Programming Learning Resources Computer Hardware Embedded Systems

On This Page

Table of Contents
Share with :

The Basics of Microprocessor and Microcontroller
#

What is a Microcontroller?
#

A microcontroller (MCU) is a compact, integrated computing device that includes a processor (CPU), memory (RAM & ROM), and input/output (I/O) peripherals on a single chip. It is designed for specific embedded system applications like controlling devices, automation, and real-time processing.

🔹 Key Features of a Microcontroller:

  • CPU (Central Processing Unit) – Executes instructions.
  • ROM (Read-Only Memory) – Stores program code.
  • RAM (Random Access Memory) – Stores temporary data.
  • I/O Ports – Communicates with external devices like sensors, motors, and displays.
  • Timers & Counters – Used for delay generation and counting events.
  • Serial Communication (UART, SPI, I2C, etc.) – Allows data transfer between devices.
  • Power-efficient – Designed for low-power applications like IoT, automation, and consumer electronics.

Examples of Microcontrollers
#

Famous Microcontrollers and Their Origins

MicrocontrollerDeveloped byYearDetails
8051Intel1980One of the most widely used 8-bit microcontrollers, later produced by Atmel, NXP, and others.
AVR (ATmega328P - Arduino Uno)Atmel (now Microchip)1996Popular for hobbyists and embedded systems, used in Arduino Uno.
PIC MicrocontrollersGeneral Instrument (later Microchip)1975Introduced as the PIC1650, widely used in industrial and automation applications.
ARM Cortex-M SeriesARM Holdings2004Designed for low-power, high-performance embedded applications, licensed to companies like STM, NXP, TI.
ESP8266Espressif Systems (China)2014Revolutionized IoT with affordable Wi-Fi capabilities.
ESP32Espressif Systems2016Successor to ESP8266, adding Bluetooth, improved performance, and lower power consumption.

Examples of Microprocessors
#

Famous Microprocessors and Their Origins

MicroprocessorDeveloped byYearDetails
Intel 4004Intel1971The world’s first commercially available microprocessor, a 4-bit CPU, used in calculators.
Intel 8080Intel1974An 8-bit microprocessor that powered early personal computers like the Altair 8800.
Intel 8086Intel1978A 16-bit processor that led to the x86 architecture, still used in modern Intel/AMD CPUs.
Motorola 68000Motorola1979A powerful 16/32-bit CPU used in Apple Macintosh, Sega Genesis, and Amiga computers.
Intel 80386 (i386)Intel1985First 32-bit x86 processor, introduced multitasking and virtual memory.
Intel PentiumIntel1993A widely used 32-bit processor that dominated the PC market in the 1990s.
AMD AthlonAMD1999AMD’s first processor to outperform Intel Pentium III, pushing competition in the CPU market.
Intel Core SeriesIntel2006A major shift in Intel CPUs with multi-core processing (Core 2 Duo, Core i3, i5, i7, etc.).
ARM Cortex-A SeriesARM Holdings2005-presentARM-based processors used in mobile devices, tablets, and IoT devices, known for power efficiency.
Apple M1Apple2020Apple’s ARM-based processor replacing Intel in MacBooks, known for high efficiency and performance.

What is the Difference Between Microcontroller and Microprocessor
#

FeatureMicrocontroller (MCU)Microprocessor (MPU)
DefinitionA compact system with CPU, RAM, ROM, and I/O peripherals in one chip.A standalone CPU that requires external memory and peripherals.
PurposeDesigned for specific tasks in embedded systems.Designed for general-purpose computing.
ComponentsIncludes CPU, RAM, ROM, I/O ports, timers, ADC, etc., on a single chip.Only CPU; requires external RAM, ROM, I/O devices.
Memory IntegrationBuilt-in RAM & ROM for program storage.External RAM & ROM must be added.
Processing PowerTypically lower (8-bit, 16-bit, 32-bit).Higher (32-bit, 64-bit for modern processors).
Power ConsumptionLow power, optimized for efficiency.Higher power consumption, designed for performance.
CostLow cost, ideal for mass production.Expensive, especially with additional components.
Examples8051, ATmega328P, PIC, ARM Cortex-M, ESP32.Intel i7, AMD Ryzen, ARM Cortex-A.
ApplicationsIoT devices, automation, robotics, medical devices, automotive systems.Laptops, desktops, smartphones, servers.

In conclusion, Microcontrollers are self-sufficient, low-power, and application-specific. Microprocessors require external components and are used in general-purpose computing.

Can you tell me something more about a micorocontroller like 8051?
#

The 8051 microcontroller is an 8-bit microcontroller developed by Intel in 1980 for embedded system applications. It became one of the most widely used microcontrollers in various applications due to its simple architecture, reliability, and ease of programming.


Key Features of the 8051 Microcontroller
#

  1. 8-bit CPU – Processes 8-bit data at a time.
  2. 16-bit Address Bus – Can access up to 64 KB of external memory.
  3. 4 KB On-chip ROM – Used for storing the program code.
  4. 128 Bytes On-chip RAM – Provides fast access memory for temporary data storage.
  5. 32 I/O Pins – Divided into four 8-bit ports (P0, P1, P2, P3).
  6. Two 16-bit Timers/Counters – Used for delay generation, counting external events, etc.
  7. Serial Communication (UART) – Supports asynchronous communication.
  8. Interrupt System – Supports five interrupt sources for handling multiple tasks.
  9. Clock Frequency – Typically 11.0592 MHz, but can operate at other speeds.
  10. Harvard Architecture – Has separate memory for program and data, allowing simultaneous access.

Pin Diagram of 8051
#

The 40-pin 8051 microcontroller has the following key pins:

Pin No.NameFunction
1-8P1.0 - P1.7Port 1 (General-purpose I/O)
9RSTReset pin (Active HIGH)
10-17P3.0 - P3.7Port 3 (I/O + Special functions)
18-19XTAL1, XTAL2External Crystal Oscillator
20GNDGround
21-28P2.0 - P2.7Port 2 (I/O + High Byte of External Memory Address)
29PSENProgram Store Enable (for external ROM)
30ALE/PROGAddress Latch Enable
31EA/VPPExternal Access Enable
32-39P0.0 - P0.7Port 0 (I/O + Multiplexed Address/Data Bus)
40VCCPower Supply (+5V)

Architecture of 8051
#

The 8051 microcontroller follows the Harvard architecture, meaning it has separate program memory (ROM) and data memory (RAM). It consists of:

  1. CPU – Processes instructions.
  2. RAM – Stores temporary data (128 bytes, including registers and stack).
  3. ROM – Stores permanent program code (4 KB).
  4. I/O Ports – Four 8-bit ports (P0, P1, P2, P3) for communication.
  5. Timers – Two 16-bit timers (Timer0 & Timer1) for timing operations.
  6. Serial Communication (UART) – Used for RS232-based communication.
  7. Interrupt System – Supports multiple interrupt sources.

Programming the 8051
#

The 8051 microcontroller is typically programmed using Assembly Language or Embedded C. The program is written, compiled, and then uploaded to the ROM.

Example: LED Blinking Code (in Assembly)
#

ORG 0000H       ; Start program from address 0000H
MOV P1, #00H    ; Configure Port 1 as output
AGAIN:
    MOV P1, #0FFH  ; Turn ON LED
    ACALL DELAY    ; Call delay function
    MOV P1, #00H   ; Turn OFF LED
    ACALL DELAY    ; Call delay function
    SJMP AGAIN     ; Repeat indefinitely

DELAY:
    MOV R7, #0FFH  ; Outer loop
    MOV R6, #0FFH  ; Inner loop
LOOP:
    DJNZ R6, LOOP
    DJNZ R7, DELAY
    RET
END

Example: LED Blinking Code (in Embedded C)
#

#include <reg51.h>

void delay() {
    int i, j;
    for(i = 0; i < 1000; i++)
        for(j = 0; j < 100; j++);
}

void main() {
    while(1) {
        P1 = 0xFF;  // Turn ON LED
        delay();
        P1 = 0x00;  // Turn OFF LED
        delay();
    }
}

Variants of the 8051 Microcontroller
#

Several manufacturers have created improved versions of the 8051, such as:

  • Intel 8051 (Original version)
  • Atmel AT89C51 (Flash memory version)
  • NXP (Philips) 8051 Variants (Enhanced peripherals)
  • Silicon Labs 8051 Variants (High-speed versions)

Applications of 8051 Microcontroller
#

  1. Embedded Systems – Used in various small embedded applications.
  2. Home Appliances – Washing machines, microwave ovens, etc.
  3. Automotive Systems – Engine control units, vehicle monitoring.
  4. Industrial Automation – Process controllers, robotic systems.
  5. Medical Devices – Patient monitoring systems.
  6. Communication Systems – Serial data transmission, remote controls.

Why is 8051 Still Popular?#

  • Simple architecture makes it easy for beginners to learn.
  • Availability of variants with improved features.
  • Low power consumption for battery-powered applications.
  • Extensive community support and libraries.

How can you categorize microcontrollers?
#

Microcontroller designs can be categorized based on their architecture, processing capability, power efficiency, and application-specific features. Here are some methods of microcontroller categorization:

1. Architecture-Based Designs
#

  • Harvard Architecture: Separate memory buses for program (instructions) and data memory, allowing simultaneous access.
  • Von Neumann Architecture: A single memory for both instructions and data, leading to simpler but sometimes slower performance.

2. Bit-Width Designs
#

  • 8-bit Microcontrollers: Simpler, lower power, used in basic applications like home appliances and IoT devices.
  • 16-bit Microcontrollers: Enhanced performance, better power efficiency, used in automotive and industrial control.
  • 32-bit Microcontrollers: High processing power, used in complex applications like robotics, embedded AI, and real-time systems.

3. Core-Based Designs
#

  • RISC (Reduced Instruction Set Computing): ARM Cortex-M, AVR, and PIC microcontrollers are based on RISC, optimized for efficiency.
  • CISC (Complex Instruction Set Computing): Some x86-based microcontrollers use CISC, which has more powerful instructions but can be less efficient.
  • DSP-based Microcontrollers: Designed for signal processing tasks, used in audio, video, and communication systems.

4. Power-Efficient Designs
#

  • Low-Power Microcontrollers: Designed for battery-powered applications (e.g., ARM Cortex-M0+, MSP430).
  • Energy Harvesting Microcontrollers: Operate on minimal energy, often used in IoT sensors.

5. Application-Specific Designs
#

  • General-Purpose Microcontrollers: Used in various consumer electronics, industrial automation, and simple computing tasks.
  • Automotive Microcontrollers: Designed for vehicle control systems (e.g., engine control, ADAS).
  • IoT Microcontrollers: Include wireless connectivity (Wi-Fi, Bluetooth, LoRa) for IoT applications (ESP32, Nordic NRF).
  • Medical Microcontrollers: Used in medical devices like pacemakers, glucose monitors.
  • Industrial Microcontrollers: Built for reliability, safety, and long-term operation in harsh environments.

6. Memory-Based Designs
#

  • Flash Memory Microcontrollers: Store program code in rewritable Flash memory (e.g., Atmel ATmega series).
  • ROM-Based Microcontrollers: Programmed once, used in cost-sensitive applications.
  • FRAM Microcontrollers: Use Ferroelectric RAM for fast and energy-efficient non-volatile storage.

7. Connectivity-Oriented Designs
#

  • Wireless Microcontrollers: Have built-in Wi-Fi, Bluetooth, Zigbee (ESP32, NRF52).
  • CAN Bus Microcontrollers: Used in automotive and industrial applications.
  • USB-enabled Microcontrollers: Built-in USB for easy communication (e.g., Atmel SAMD21).

In these microcontroller or microprocessor architectures what is Bus and their types?
#

In computing and embedded systems, a bus is a communication pathway used to transfer data between different components of a system, such as the CPU, memory, and peripherals. There are several types of buses, categorized based on their function and architecture.

Types of Buses in Computer Architecture
#

Bus TypeFunctionCarriesExample Usage
Address BusTransfers memory addresses from the CPU to memory or peripherals.Address signals (one-way).When the CPU requests data from RAM, it sends the memory address via the address bus.
Data BusTransfers actual data between components (CPU, memory, peripherals).Data (bidirectional).Fetching an instruction from memory or transferring data to a hard drive.
Control BusSends control signals to coordinate data transfer (e.g., read/write).Control signals (one-way or bidirectional).CPU sending a “read” or “write” signal to memory.

Types of Buses Based on Architecture
#

Bus TypeDescriptionExample Usage
System BusA combination of address, data, and control buses, connecting CPU to memory and main components.Used in traditional computer architectures (Von Neumann architecture).
Front-Side Bus (FSB)Connects the CPU to the memory controller hub (Northbridge).Older Intel processors (Pentium 4, Core 2 Duo).
Back-Side Bus (BSB)Connects CPU to L2/L3 cache for faster access.Faster memory access in older architectures.
Memory BusConnects RAM to the CPU for data exchange.DDR memory access in computers.
Peripheral BusConnects peripheral devices like printers, keyboards, and displays.USB, PCIe, SATA for external devices.
Expansion BusAllows additional hardware to be connected to the system.PCI, PCI Express (PCIe), AGP (older graphics interface).
Internal BusConnects internal CPU components, such as registers and ALU.Used within CPU microarchitecture.
High-Speed BusUsed for high-speed data transfer, such as graphics or high-performance storage.PCIe for GPUs, NVMe for SSDs.

Types of Buses in Embedded Systems and Microcontrollers
#

Bus TypeDescriptionExample Usage
I²C (Inter-Integrated Circuit)A two-wire serial communication bus for low-speed peripherals.Used for sensors, EEPROMs, small LCD displays.
SPI (Serial Peripheral Interface)High-speed serial bus with master-slave architecture.Flash memory, SD cards, displays.
UART (Universal Asynchronous Receiver-Transmitter)Asynchronous serial communication for data transfer.Serial communication (RS-232, USB-to-Serial).
CAN (Controller Area Network)Bus designed for robust communication in vehicles and industrial systems.Automotive applications, industrial automation.
USB (Universal Serial Bus)Standardized bus for connecting external devices.Keyboards, mice, storage devices.
JTAG (Joint Test Action Group)Used for debugging and programming microcontrollers.Microcontroller testing and firmware updates.

Key Takeaways
#

  • System Bus: Connects CPU, memory, and motherboard components.
  • Peripheral & Expansion Buses: Connect external devices like graphics cards, SSDs, and peripherals.
  • Embedded Buses: Used in microcontrollers and IoT devices for communication.
Dr. Hari Thapliyaal's avatar

Dr. Hari Thapliyaal

Dr. Hari Thapliyal is a seasoned professional and prolific blogger with a multifaceted background that spans the realms of Data Science, Project Management, and Advait-Vedanta Philosophy. Holding a Doctorate in AI/NLP from SSBM (Geneva, Switzerland), Hari has earned Master's degrees in Computers, Business Management, Data Science, and Economics, reflecting his dedication to continuous learning and a diverse skill set. With over three decades of experience in management and leadership, Hari has proven expertise in training, consulting, and coaching within the technology sector. His extensive 16+ years in all phases of software product development are complemented by a decade-long focus on course design, training, coaching, and consulting in Project Management. In the dynamic field of Data Science, Hari stands out with more than three years of hands-on experience in software development, training course development, training, and mentoring professionals. His areas of specialization include Data Science, AI, Computer Vision, NLP, complex machine learning algorithms, statistical modeling, pattern identification, and extraction of valuable insights. Hari's professional journey showcases his diverse experience in planning and executing multiple types of projects. He excels in driving stakeholders to identify and resolve business problems, consistently delivering excellent results. Beyond the professional sphere, Hari finds solace in long meditation, often seeking secluded places or immersing himself in the embrace of nature.

Comments:

Share with :

Related

What is a Digital Twin?
·805 words·4 mins· loading
Industry Applications Technology Trends & Future Computer Vision (CV) Digital Twin Internet of Things (IoT) Manufacturing Technology Artificial Intelligence (AI) Graphics
What is a digital twin? # A digital twin is a virtual representation of a real-world entity or …
Frequencies in Time and Space: Understanding Nyquist Theorem & its Applications
·4103 words·20 mins· loading
Data Analysis & Visualization Computer Vision (CV) Mathematics Signal Processing Space Exploration Statistics
Applications of Nyquists theorem # Can the Nyquist-Shannon sampling theorem applies to light …
The Real Story of Nyquist, Shannon, and the Science of Sampling
·1146 words·6 mins· loading
Technology Trends & Future Interdisciplinary Topics Signal Processing Remove Statistics Technology Concepts
The Story of Nyquist, Shannon, and the Science of Sampling # In the early days of the 20th century, …
BitNet b1.58-2B4T: Revolutionary Binary Neural Network for Efficient AI
·2637 words·13 mins· loading
AI/ML Models Artificial Intelligence (AI) AI Hardware & Infrastructure Neural Network Architectures AI Model Optimization Language Models (LLMs) Business Concepts Data Privacy Remove
Archive Paper Link BitNet b1.58-2B4T: The Future of Efficient AI Processing # A History of 1 bit …
Ollama Setup and Running Models
·1753 words·9 mins· loading
AI and NLP Ollama Models Ollama Large Language Models Local Models Cost Effective AI Models
Ollama: Running Large Language Models Locally # The landscape of Artificial Intelligence (AI) and …