






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
MTL200 STUDY GUIDE WITH COMPLETE SOLUTION.
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!
What is the difference between volatile and non volatile memory in microcontrollers? - ANSWER Volatile memory (RAM) loses stored data when power is removed. Non-volatile memory (Flash, EEPROM) retains data even when power is lost.
How does a microcontroller execute instructions stored in its memory? - ANSWER It follows the Fetch-Decode-Execute cycle: Fetch retrieves the instruction, Decode interprets it, and Execute performs the operation.
Explain the role of the Control Unit (CU) in a microcontroller? - ANSWER The CU directs instruction execution, manages communication between ALU, registers, and memory, and controls data flow.
What is the purpose of the Status Register in a microcontroller? - ANSWER It stores flags that indicate operation results, such as carry, zero, and overflow, which are used for conditional execution.
How many clock cycles does it take for an instruction to execute on an ATmega328P? - ANSWER Most AVR instructions execute in 1 clock cycle, except for branching/jump instructions, which take 2-3 cycles.
Name and explain three types of memory used in the ATmega328P microcontroller? - ANSWER Flash (stores program code), SRAM (stores variables during execution), and EEPROM (stores data that must be retained after power loss).
What is the function of the Stack Pointer (SP), and how does it change when pushing and popping data? - ANSWER The SP holds the top address of the stack. Pushing data decrements SP, while popping data increments SP.
What is the difference between general purpose registers and special function registers? - ANSWER General purpose registers (R0-R31) store temporary data and arithmetic results, while special function registers (e.g., SREG, SP) control system functions.
What is the function of the PINx register in ATmega328P? - ANSWER It reads the current logic level of an input pin.
How do you configure Port D, Pin 5 as an output and set it to HIGH in C? - ANSWER Use DDRD |= (1 << PD5); to set PD5 as an output and PORTD |= ( << PD5); to set it HIGH.
What is the difference between PORTx, PINx, and DDRx registers? - ANSWER DDRx configures pin direction, PORTx writes HIGH/LOW or enables pull-ups, and PINx reads input pin states.
Write an Assembly instruction to toggle a specific pin (e.g., PB3) without affecting other bits? - ANSWER IN R16, PORTB; EOR R16, (1 << PB3); OUT PORTB, R16;
Explain how a Timer Overflow Interrupt works in ATmega328P? - ANSWER The timer counts up until overflow, setting the TOVx flag, which triggers an interrupt if enabled.
What is the difference between a polling system and an interrupt system in microcontrollers? - ANSWER Polling continuously checks conditions, using CPU resources, while interrupts notify the CPU only when needed, improving efficiency.
computer in a single chip that includes a microprocessor, memory, and I/O interfaces designed for specific applications.
What is the difference between a microprocessor and a microcontroller? - ANSWER A microprocessor requires external components to function, while a microcontroller has built in RAM, ROM, and I/O interfaces, making it ideal for embedded applications.
What is an embedded system? - ANSWER An embedded system is a dedicated computing system with a microcontroller or microprocessor designed for a specific task.
What are bits and bytes? - ANSWER A bit is the smallest unit of data, representing 0 or 1, while a byte consists of 8 bits.
How do you convert a binary number to decimal? - ANSWER Multiply each bit by 2 raised to its position from right to left and sum the results.
How do you convert a hexadecimal number to decimal? - ANSWER Multiply each digit by 16 raised to its position from right to left and sum the results.
What is two's complement? - ANSWER Two's complement is a method for representing negative binary numbers by inverting all bits and adding 1.
What is ASCII code? - ANSWER ASCII (American Standard Code for Information Interchange) is a character encoding standard that represents text using numerical codes.
What is a bus in a microcontroller? - ANSWER A bus is a group of lines that carry data, addresses, or control signals between components in a microcontroller.
What is an address bus? - ANSWER An address bus is unidirectional and carries memory addresses from the CPU to memory or I/O devices.
What is a data bus? - ANSWER A data bus is bidirectional and transfers data between the CPU and memory or peripherals.
What is a control bus? - ANSWER A control bus carries control signals that direct operations such as read, write, and reset.
What is RAM? - ANSWER RAM (Random Access Memory) is volatile memory used for temporary data storage and program execution.
What is ROM? - ANSWER ROM (Read-Only Memory) is non volatile memory used to store firmware or permanent instructions.
What is EEPROM? - ANSWER EEPROM (Electrically Erasable Programmable Read-Only Memory) is a non volatile memory that allows data to be written and erased electrically.
What is the function of the Program Counter (PC)? - ANSWER The Program Counter stores the address of the next instruction to be executed.
How do you enable internal pull up resistors? - ANSWER Set the corresponding bit in the PORTx register while configuring the pin as an input.
What is the function of the ADC in a microcontroller? - ANSWER The ADC (Analog to Digital Converter) converts analog signals into digital values.
What is the resolution of the ATmega328P ADC? - ANSWER The ATmega328P has a 10-bit ADC, providing 1024 discrete levels.
What is the reference voltage for the ATmega328P ADC? - ANSWER The reference voltage determines the full scale range of the ADC and can be set to 5V, 1.1V, or an external source.
What is a prescaler in an ADC? - ANSWER A prescaler divides the system clock to set the ADC sampling rate.
What is oversampling in ADC? - ANSWER Oversampling involves taking multiple samples and averaging them to reduce noise and improve resolution.
What is PWM (Pulse Width Modulation)? - ANSWER PWM is a technique that varies the duty cycle of a digital signal to simulate an analog output.
How do you generate a PWM signal in ATmega328P? - ANSWER Use the Timer/Counter module to generate a PWM signal.
What are the modes of an ATmega328P timer? - ANSWER ATmega328P timers operate in Normal, CTC (Clear Timer on Compare Match), and PWM modes.
What is an interrupt? - ANSWER An interrupt is a signal that temporarily halts normal program execution to handle an urgent task.
What is an interrupt vector? - ANSWER An interrupt vector is the memory location that stores the address of an interrupt service routine (ISR).
What is an external interrupt? - ANSWER An external interrupt is triggered by an external event, such as a button press.
How do you enable external interrupts on ATmega328P? - ANSWER Configure the External Interrupt Control Register (EICRA) and enable the interrupt in the External Interrupt Mask Register (EIMSK).
What is the difference between JMP and CALL instructions? - ANSWER JMP
unintended rapid toggling caused by mechanical switches.
What is a bootloader? - ANSWER A bootloader is a small program that enables the microcontroller to load new firmware without external programmers.
What is a floating point number? - ANSWER A floating point number represents decimal values in binary using scientific notation.
What is fixed point arithmetic? - ANSWER Fixed-point arithmetic represents decimal numbers with a fixed number of fractional bits.
What is an inline function in C? - ANSWER An inline function replaces the function call with the actual function code during compilation to reduce execution overhead.
What is recursion in programming? - ANSWER Recursion occurs when a function calls itself repeatedly until a base condition is met.
What is the difference between a macro and a function in C? - ANSWER A macro is a preprocessor directive that replaces code before compilation, while a function executes at runtime.
What is an aliasing effect in ADC? - ANSWER Aliasing occurs when the sampling rate is too low, causing incorrect frequency representation.
What is the difference between polling and interrupts? - ANSWER Polling continuously checks for events, whereas interrupts react only when an event occurs.
What is a non maskable interrupt? - ANSWER A non maskable interrupt (NMI) cannot be disabled and is used for critical system functions.
What is an ISR (Interrupt Service Routine)? - ANSWER An ISR is a function executed in response to an interrupt event.
What is the purpose of SPI (Serial Peripheral Interface)? - ANSWER SPI is a synchronous serial communication protocol for fast data transfer between devices.
What is I2C (Inter Integrated Circuit)? - ANSWER I2C is a communication protocol that uses two wires (SDA and SCL) to connect multiple devices.
What is the difference between SPI and I2C? - ANSWER SPI is faster but