microcontroller_test_full
microcontroller_test_full
Instructions:
4. For design and analysis questions, explain your reasoning step by step.
d) Store data
a) PIC
b) ARM
c) AVR
d) 8051
Answer: c) AVR
Which addressing mode is used to load an immediate value directly into a register?
a) Direct addressing
b) Immediate addressing
c) Register addressing
d) Indirect addressing
a) ADD
b) AND
c) SUB
d) OR
Answer: b) AND
a) 128 bytes
b) 512 bytes
c) 1024 bytes
d) 2048 bytes
Which flag in the status register is set when the result of an operation is zero?
a) Z flag
b) C flag
c) N flag
d) S flag
Answer: a) Z flag
a) ADD
b) LSR
c) OR
d) CMP
Answer: b) LSR
d) To store data
a) UBRR
b) UCSRA
c) UCSRB
d) UDR
Answer: a) UBRR
a) 32
b) 64
c) 128
d) 256
Answer: a) 32
a) Complex instructions
d) Store data
a) SPI
b) I2C
c) USART
Which memory type is typically used for temporary data storage in microcontrollers?
a) ROM
b) EEPROM
c) SRAM
d) Flash
Answer: c) SRAM
a) MOV
b) LDI
c) STS
d) IN
Answer: c) STS
a) 8 bits
b) 16 bits
c) 32 bits
d) 64 bits
Answer: a) 8 bits
a) No operation
Answer: a) No operation
a) SRAM
b) EEPROM
c) Flash
d) Both b and c
In which mode can the USART transmit and receive data simultaneously?
a) Full Duplex
b) Half Duplex
c) Simplex
d) Synchronous
Which of the following registers stores the result of an arithmetic operation in AVR
microcontrollers?
a) UDR
b) SREG
c) ADC
d) Z flag
Answer: b) SREG
a) 1200 to 115200
b) 1000 to 10000
c) 1 to 1000
d) 9600 only
Which of the following is true about the Stack Pointer (SP) in AVR microcontrollers?
c) It is a non-volatile register
a) CMP
b) CP
c) SUB
d) AND
Answer: b) CP
a) USART
b) PWM
c) ADC
d) I2C
Answer: b) PWM
Which of the following instructions is used to rotate the contents of a register left through
the carry?
a) ROR
b) ROL
c) LSR
d) LSL
Answer: b) ROL
b) Analog-to-Digital Converter
d) Digital-to-Analog Converter
Task: Write an assembly program to subtract two 8-bit numbers and store the result in a
register.
Task: Write a program to rotate a register left using the ROL instruction.
Task: Write a program to check if a number is even or odd using the AND instruction.
Task: Write a program that uses a 16-bit addition between two numbers and stores the result.
Task: Write a program that compares two registers and sets a flag based on the result.
Task: Write an assembly program that uses the CMP instruction to compare two registers
Task: Write a program that uses the ADC module to read an analog value and convert it to
digital.
Task: Write a program that uses the USART to send data from a register.
Task: Write a program that uses the LDI instruction to load an immediate value into a
register.
Task: Write a program that toggles a bit using the XOR operation.
Task: Write a program to store data in the EEPROM and retrieve it later.
Task: Write an assembly program that simulates a simple counter using registers.
Task: Write an assembly program that uses the IN instruction to read from an input port.