Embedded systems roles at Bosch India, Texas Instruments, Intel India, and Qualcomm India are highly specialised and well-compensated. Interviews cover microcontroller architecture, real-time operating systems, interrupt handling, and serial communication protocols. This guide covers the exact technical depth expected at these companies.
Microcontrollers vs Microprocessors and Memory Architecture
The distinction between microcontrollers and microprocessors is a fundamental embedded systems interview question.
Microcontroller vs Microprocessor:
- Microprocessor: only the CPU; requires external memory (RAM, ROM, flash), external I/O peripherals, and support chips. Examples: Intel Core i7, ARM Cortex-A53 (used in Raspberry Pi). Used for general-purpose computing where you need high performance and an operating system
- Microcontroller: integrates CPU, RAM, ROM/flash, timers, ADC/DAC, UART, SPI, I2C, GPIO all on a single chip. Examples: STM32 (ARM Cortex-M), PIC, AVR (Arduino), ESP32. Used for embedded control applications where cost, power, and size matter
- Key trade-off: microcontrollers are cheaper and lower power; microprocessors are more powerful
Memory types in embedded systems:
- ROM (Read-Only Memory): stores the program code (flash in modern MCUs); non-volatile (retains data without power)
- RAM (Random Access Memory): stores runtime data (stack, heap, global variables); volatile (loses data without power)
- Flash: electrically erasable programmable ROM used in modern MCUs; can be erased and reprogrammed; stores firmware
- EEPROM: electrically erasable byte-by-byte; used for storing configuration data that persists across power cycles
- Stack: used for local variables and function call frames; grows downward in most ARM architectures
- Heap: used for dynamic memory allocation (malloc/free); avoid in RTOS systems due to fragmentation
Memory-mapped I/O:
- Peripheral registers (GPIO, UART, SPI, ADC) are mapped to specific memory addresses in the MCU's address space
- You read from and write to peripheral registers by reading and writing to these addresses in C
- The volatile keyword: always use volatile for variables that map to hardware registers to prevent the compiler from caching or optimising away reads
- Example: volatile uint32t *gpioodr = (volatile uint32t *)0x40020014; *gpioodr |= (1 << 5); // Set pin 5 high
- Bit manipulation: embedded programming relies heavily on bit manipulation: set bit (reg |= (1 << n)), clear bit (reg &= ~(1 << n)), toggle bit (reg ^= (1 << n)), test bit (reg & (1 << n))
RTOS, Interrupt Handling, and Watchdog Timers
RTOS concepts and interrupt handling are core embedded systems interview topics at Bosch India, Qualcomm India, and automotive electronics companies.
RTOS (Real-Time Operating System):
- An RTOS provides deterministic scheduling — tasks run within guaranteed time bounds (deadlines)
- Task: the basic unit of execution in an RTOS (equivalent to a thread in Linux)
- Priority-based preemptive scheduling: the highest-priority ready task always runs; a lower-priority task is preempted when a higher-priority task becomes ready
- FreeRTOS: the most widely used open-source RTOS in India; used on STM32, ESP32, and many other MCUs
- xTaskCreate(): create a task in FreeRTOS; parameters: task function, name, stack size, parameters, priority, task handle
- vTaskDelay(pdMSTOTICKS(100)): delay a task for 100 milliseconds without blocking other tasks
- Mutex: mutual exclusion; only the task that took the mutex can give it back; used to protect shared resources
- Semaphore: counting or binary; used for signalling between tasks (e.g., an ISR gives a semaphore; a task waits on it)
- Message queue: a FIFO buffer for passing data between tasks; xQueueSend() and xQueueReceive()
- Priority inversion: a high-priority task is blocked waiting for a resource held by a low-priority task; a medium-priority task preempts the low-priority task; the high-priority task is indirectly blocked. Solution: priority inheritance (the mutex holder temporarily inherits the priority of the highest waiter)
Interrupt handling:
- ISR (Interrupt Service Routine): a function that executes in response to a hardware interrupt (GPIO edge, UART receive, timer overflow)
- ISR rules: keep ISRs short and fast; never block in an ISR (no delay, no mutex wait, no malloc)
- Deferred interrupt processing: use a flag or give a semaphore in the ISR; a task waits on that semaphore and does the heavy work
- Interrupt priority: MCUs (ARM Cortex-M) have configurable interrupt priorities; higher-priority interrupts can preempt lower-priority ISRs
- Nested interrupts: enabled when an ISR allows higher-priority interrupts to fire during its execution
Watchdog timer:
- A hardware timer that resets the MCU if software fails to periodically reset (pet/kick) it
- Prevents system lockup: if the firmware hangs (infinite loop, deadlock), the watchdog fires and resets the MCU
- Independent watchdog (IWDG): clocked by an independent oscillator; cannot be disabled by software; resets the MCU if not refreshed within the timeout
- Window watchdog (WWDG): must be refreshed within a specific time window (not too early, not too late); detects timing anomalies
Serial Communication Protocols: SPI, I2C, UART, and CAN
Communication protocols are a mandatory topic in embedded systems interviews. Understand the trade-offs between SPI, I2C, UART, and CAN.
UART (Universal Asynchronous Receiver-Transmitter):
- Asynchronous: no shared clock signal; both devices agree on baud rate (bits per second: common values are 9600, 115200)
- Two wires: TX (transmit) and RX (receive); cross-connected between devices (device A TX to device B RX)
- Full-duplex: can transmit and receive simultaneously
- Data frame: start bit, 5-9 data bits, optional parity bit, 1-2 stop bits
- Used for: debug consoles, GPS modules, Bluetooth HC-05 modules
SPI (Serial Peripheral Interface):
- Synchronous: shared clock (SCLK) line; data is sampled on clock edges
- Four wires: MOSI (Master Out Slave In), MISO (Master In Slave Out), SCLK, CS/SS (Chip Select; one per slave)
- Full-duplex: simultaneous transmit and receive
- No addressing: the master selects a slave by pulling its CS line low
- Fast: typically 1-70 MHz; much faster than I2C
- Used for: flash memory, SD cards, LCD displays, ADCs
I2C (Inter-Integrated Circuit):
- Synchronous, two wires: SDA (data) and SCL (clock); both are open-drain with pull-up resistors
- Multi-master, multi-slave: up to 127 devices on the same bus using 7-bit addressing
- Half-duplex: only one direction at a time
- Speeds: 100 kHz (standard), 400 kHz (fast), 1 MHz (fast-plus), 3.4 MHz (high-speed)
- Clock stretching: a slave can hold SCL low to pause the master when it needs more time to process
- Used for: sensors (temperature, pressure, IMU), EEPROMs, RTC modules, small OLEDs
CAN (Controller Area Network):
- Differential bus (CAN-H and CAN-L); two wires; terminated with 120-ohm resistors at each end
- Message-based: no addresses for nodes; each message has a CAN ID (11-bit standard or 29-bit extended)
- Priority arbitration: lower CAN ID = higher priority; arbitration is lossless (the losing sender retries automatically)
- Multi-master: any node can transmit when the bus is idle
- Error detection: CRC, bit stuffing, acknowledgement; high reliability
- Speeds: up to 1 Mbps (classical CAN); CAN FD supports up to 5-8 Mbps in the data phase
- Used for: automotive ECUs (Engine Control Unit), industrial automation, robotics; mandatory knowledge at Bosch India
Frequently asked questions
Explore more