1/14
Flashcards covering Units 1 and 2 high-priority questions on microcontroller introduction, architecture, programming, I/O interfacing, ADC, and PWM.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is a Microcontroller and what is its primary significance?
A microcontroller is a compact, self-contained single-chip microcomputer integrating a CPU, program memory (Flash/ROM), data memory (RAM), Timers, Interrupt Controller, and parallel/serial I/O ports on a single silicon die. Its significance lies in its ultra-low power consumption, economical cost, and ability to execute dedicated, real-time control operations 24/7 without external support ICs.
What are the primary differences between a Microprocessor and a Microcontroller?
A Microprocessor is a standalone CPU containing processing circuits (ALU, registers, control unit) without on-chip RAM, ROM, or I/O, requiring external support chips for general-purpose PC computing. A Microcontroller integrates CPU, RAM, Flash/ROM, and I/O ports on a single silicon chip for dedicated, low-power tasks. Differences are summarized by the mnemonic 'SCAM-BIP': Size, Cost, Architecture, Memory, Bus, I/O, and Power.
What is the difference between Harvard and Von Neumann Architecture?
Harvard Architecture uses physically separate memories and separate buses for program instructions and data, allowing simultaneous instruction fetching and data reading/writing. Von Neumann Architecture uses a single shared memory space and bus for code and data, causing the Von Neumann Bottleneck where instruction and data access cannot occur simultaneously.
What are the core components inside a microcontroller and their respective roles?
How do PIC, AVR, and ARM microcontroller families compare in architecture, speed, and applications?
• PIC (Microchip): 8-bit RISC, modified Harvard architecture, single accumulator (WREG), executes 1 instruction per 4 clock cycles; used in industrial PLCs and white goods (e.g., PIC16F877A). • AVR (Atmel/Microchip): 8-bit RISC, modified Harvard, 32 general-purpose registers, executes 1 instruction per 1 clock cycle; core of Arduino Uno (ATmega328P). • ARM (ARM Holdings IP): 32-bit RISC, load-store Harvard architecture, ultra-high speed (tens to hundreds of MHz), lowest power per MIPS; used in smartphones, IoT gateways, and automotive ADAS.
What are real-world applications of microcontrollers in automotive, consumer, and industrial domains?
• Automotive: Engine Control Unit (ECU) for microsecond fuel injection and spark timing; Anti-lock Braking System (ABS) rapidly pulsing hydraulic brakes 30 times/sec; Airbags deploying within 20ms. • Consumer: Microwave ovens scanning keypads and controlling magnetron relays; Washing machines modulating motor RPM. • Industrial: Robotic arms and CNC generating stepper/servo motor PWM pulses; PLCs sequencing factory conveyor actuators.
What are cross-compilers, assemblers, and linkers in microcontroller development tools?
• Cross-Compiler: A compiler running on a Host PC (x86) that generates executable machine code for a target microcontroller (AVR/ARM), necessary because microcontrollers lack RAM to compile locally. • Assembler: Translates human assembly mnemonics directly into binary opcodes (.obj). • Linker / Locator: Merges object files with runtime libraries and assigns physical memory addresses (.hex).
What are the advantages and limitations of Embedded C versus Assembly language?
• Embedded C: Features hardware-access keywords (e.g., sbit); offers high portability, fast prototyping, and high readability, with slight compiler memory overhead (used in 95% of industry).
• Assembly Language: Uses low-level processor mnemonics; delivers maximum execution speed and absolute minimum binary size, but has zero portability and tedious development (used for bootloaders and critical ISRs).
What is an Integrated Development Environment (IDE) and what are its key features and examples?
An IDE is a unified software application combining a source code editor, cross-compiler, assembler, linker, and debugger within a single GUI. Features include syntax highlighting, device selection databases, one-click build engines for Intel HEX files, and interactive debugging. Examples: Keil μVision (8051/ARM), MPLAB X (PIC), and Atmel Studio / Microchip Studio (AVR).
Why is an infinite loop like while(1) mandatory in microcontroller software?
Microcontrollers have no Operating System to return execution to when main() exits. If main() terminates, the CPU's Program Counter runs into uninitialized memory space, executing random garbage instructions and crashing the system. An infinite loop (while(1)) ensures the firmware executes continuously and reliably 24/7.
How is an active-high LED circuit designed and programmed in Embedded C?
• Hardware Circuit: MCU Pin P1.0 → [Anode LED Cathode] → [Resistor] → GND (0V). Current-limiting resistor formula: R=IVCC−VLED=10mA5V−2V=300 to 330Ω
• Embedded C Program: Includes <reg51.h>, defines sbit LED = P1^0;, initializes LED = 0;, and toggles LED = 1; and LED = 0; inside a while(1) loop separated by delay_ms(500) calls.
What is the difference between a Software Simulator and an In-Circuit Debugger (ICD)?
• Software Simulator (e.g., Keil Simulator, Proteus): Pure software running on a PC that models CPU and peripheral behavior without physical hardware; fast and free, but timing is approximate and cannot test real electrical noise. • In-Circuit Debugger - ICD (e.g., PICkit, Atmel-ICE, ST-Link): Hardware probe interface using JTAG or SWD connecting PC to silicon on a PCB; runs at true crystal clock speed in real-time to detect physical hardware faults.
What is the purpose of a 10kΩ Pull-Up Resistor and how is Switch Debouncing resolved?
• Pull-Up Resistor (10kΩ): Prevents an unconnected input pin from entering a floating state by pulling it reliably to Logic 1 (+5V) when open, while pressing the button pulls it to GND (Logic 0).
• Switch Debouncing: Resolves mechanical contact bounce (10 to 20ms) by adding a 20ms delay (delay_ms(20)) in software before re-confirming the button state.
How does a 10-bit ADC operate and how are its step size and conversion calculated?
A 10-bit ADC samples continuous analog voltages (0V to 5V) and converts them into 210=1024 levels (digital values 0 to 1023). • Step Size Formula: Resolution=1023VREF=10235.0V≈4.88mV • Conversion Formula: Digital Value=(VREFVIN)×1023 (e.g., for VIN=2.5V, output =511).
What is Pulse Width Modulation (PWM) and how are Duty Cycle and Average Voltage calculated?
PWM simulates continuous analog outputs by rapidly switching a digital pin between 0V and 5V and modulating the Duty Cycle. • Duty Cycle Formula: Duty Cycle (%)=(TPERIODTON)×100% • Average Voltage Formula: VAVG=VCC×Duty Cycle (e.g., at 50% duty cycle with 5V, VAVG=2.5V).