20RA210 Internal 2 Answer Key
20RA210 Internal 2 Answer Key
20RA210 Internal 2 Answer Key
Questions Cognitive
PART – A (Answer All Questions) (10*1 =10 Marks) Level/CO
1. Choose the ARM instruction used for conditional branching.
a) MOV b) ADD c) SUB d) LDR R/ CO3
5. Identify the function used to send data to the serial monitor for debugging in
Arduino. U/ CO4
a) sendData() b) writeData() c) print() d) display()
6. Choose the purpose of the pinMode() function in Arduino programming.
a) It initializes b) It sets the c) It configures a d) It defines user- R/ CO4
the serial operating digital pin as an defined functions.
communication voltage of the input or output.
Arduino board.
7. Select the most common communication protocol used to interface a digital
pressure sensor with Arduino. R/ CO4
a) SPI (Serial b) I2C (Inter- c) UART d) PWM (Pulse Width
Peripheral Integrated (Universal Modulation)
Interface) Circuit) Asynchronous
Receiver-
Transmitter)
8. Raspberry Pi Imager tool is commonly used to flash Raspberry Pi OS onto a R/CO5
microSD card
9. RPi.GPIO is python library is commonly used for interacting with the Raspberry
R/ CO5
Pi's GPIO pins
10. To set the voltage level of a GPIO pin as HIGH or LOW the purpose of the R/ CO5
GPIO.output() function in Python when working with GPIO pins
void setup() {
// Initialize the buzzer pin as an OUTPUT
13. pinMode(buzzerPin, OUTPUT); Ap/ CO4
}
void loop() {
// Generate a tone of 1000 Hz for 2 seconds
tone(buzzerPin, 1000); // Play a 1000 Hz tone on the buzzer
delay(2000); // Wait for 2 seconds (2000 milliseconds)
// Stop the tone (optional, but it's good practice)
noTone(buzzerPin);
RTOS: Typically lightweight, with a smaller footprint and faster boot times,
suitable for resource-constrained embedded systems.
Linux-Based OS: More complex, offers extensive features and services, but
consumes more system resources and has a longer boot time.
Multitasking and Scheduling:
U/CO5
Ap/CO4
Theory- 5 Marks
Any Two Questions
17. (a)Write an ARM assembly code snippet that uses data processing instructions to
perform addition and subtraction operations on registers. (5 Marks)
.data
result: .word 0 @ Define a variable to store the result
.text
.global main
main:
@ Initialize registers
mov r0, #10 @ Load 10 into r0
mov r1, #5 @ Load 5 into r1
@ Addition
add r2, r0, r1 @ Add r0 and r1, store the result in r2
@ Subtraction
sub r3, r0, r1 @ Subtract r1 from r0, store the result in r3
# Initialize GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(sensor_pin, GPIO.IN)
try:
while True: Ap/ CO5
# Read data from the sensor
sensor_value = GPIO.input(sensor_pin)
except KeyboardInterrupt:
print("Measurement stopped by the user")
finally:
GPIO.cleanup() # Cleanup GPIO configuration when the script exits
19. Explain the sequence of steps to install the Raspberry Pi operating system onto a
microSD card
Insert the microSD card into your computer's SD card reader or a USB SD card
reader adapter.
Step 4: Use Etcher to Flash the OS Image:
Click on the "Select Image" button in Etcher and choose the Raspberry Pi OS
image you downloaded in Step 1.
Etcher should automatically detect your microSD card. If it doesn't, use the "Select
Drive" button to choose your microSD card.
Double-check that you've selected the correct drive because all data on the selected
drive will be overwritten.
Click the "Flash!" button to start the flashing process. Etcher will write the OS
image to the microSD card. This process may take a few minutes.
Once the flashing process is complete, Etcher will validate the write to ensure it's
successful.
When both writing and validation are finished, Etcher will show a message
indicating the process is complete, and it will safely eject the microSD card.
If Etcher hasn't already ejected the microSD card, safely eject it from your
computer.
Step 6: Insert the microSD Card into the Raspberry Pi:
Insert the microSD card into the microSD card slot on your Raspberry Pi.
Step 7: Power Up Your Raspberry Pi:
The first time you boot your Raspberry Pi, it will launch the initial setup wizard.
Follow the on-screen instructions to set your preferences, create a user account,
and configure your Wi-Fi .