🔧
शुरुआती·8 min पढ़ने का समय

माइक्रोकंट्रोलर का परिचय

माइक्रोकंट्रोलर क्या है, कैसे चुनें — GPIO, SPI, I2C पेरिफेरल।

A microcontroller (MCU) is a self-contained computer on a single IC: processor core, flash memory, SRAM and programmable I/O peripherals. MCUs run a single program loop directly on hardware with microsecond response times — ideal for real-time control, embedded sensing and battery-powered IoT.

🌐विस्तृत तकनीकी सामग्री अंग्रेज़ी में है। पूर्ण अंग्रेज़ी संस्करण के लिए यहाँ क्लिक करें।

MCU vs Microprocessor vs SBC

A microprocessor (MPU) needs external RAM, Flash and peripherals. A microcontroller integrates all on one chip. An SBC (Raspberry Pi) has a powerful MPU running Linux. MCUs cost ¢25–$5, boot in microseconds and run on button batteries.

TypeExampleOSBoot TimeBest For
MCUSTM32F103None (bare-metal)< 1 msReal-time control, IoT
MCU (RTOS)ESP32-S3FreeRTOS< 100 msIoT with Wi-Fi/BT
SBCRaspberry Pi 5Linux10–20 sEdge AI, Linux apps

GPIO, Timers and Interrupts

GPIO pins can be configured as digital input, digital output or alternate-function (SPI, I2C, UART, PWM). Timers generate interrupts or PWM signals independently of the main loop. Interrupts immediately suspend the main program and run a handler function.

  • ▸Never directly source/sink more than the pin rated current (typically 8–25 mA).
  • ▸ADC pins sample analog voltages and convert them to a digital number.

Communication Protocols: UART, SPI, I2C

UART: 2 wires, asynchronous, point-to-point. SPI: 4 wires, synchronous, full-duplex, up to 50+ MHz. I2C: 2 wires, addressable — many devices share the same bus, each with a unique 7-bit address.

नोट: Popular beginner platforms: Arduino Uno (ATmega328P), ESP32 (dual-core, Wi-Fi + BT), STM32 (ARM Cortex-M).

टैग

MicrocontrollersGPIOSPII2CEmbedded systemsArduino