Embedded C MCQ Banner

Embedded C Multiple Choice Questions (MCQs) and Answers

Master Embedded C with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Embedded C concepts. Begin your placement preparation journey now!

Q91

Q91 A counter stops incrementing on external events. What is the most probable issue?

A

Incorrect edge selection

B

Prescaler mismatch

C

Interrupt disabled

D

Timer mode used

Q92

Q92 What does I/O stand for in embedded systems?

A

Input Only

B

Input/Output

C

Interrupt Output

D

Indirect Operations

Q93

Q93 Which register is typically used to configure the direction of a GPIO pin?

A

PORT

B

PIN

C

DDR

D

OCR

Q94

Q94 What is the main purpose of pull-up resistors in GPIO programming?

A

Increase speed

B

Provide stable HIGH

C

Reduce voltage

D

Improve communication

Q95

Q95 Which of the following is true about SPI communication?

A

It uses a single data line

B

It uses a clock signal

C

It is slower than UART

D

It is wireless

Q96

Q96 What is the purpose of a GPIO interrupt in I/O programming?

A

To toggle pin state

B

To execute a specific function on pin state change

C

To reset GPIO

D

To configure pull-up

Q97

Q97 What does this code do?
PORTB |= (1 << PB0);

A

Sets PB0 HIGH

B

Sets PB0 LOW

C

Toggles PB0

D

Reads PB0

Q98

Q98 What will happen with this code?
if (PINB & (1 << PB1))
{
PORTC |= (1 << PC0);
}

A

Sets PC0 HIGH if PB1 is HIGH

B

Sets PC0 LOW if PB1 is HIGH

C

Toggles PC0

D

No action

Q99

Q99 What will be the effect of this code?
DDRD &= ~(1 << PD2); PORTD |= (1 << PD2);

A

Configures PD2 as input with pull-up resistor enabled

B

Configures PD2 as output

C

Configures PD2 as floating input

D

Disables PD2 pin

Q100

Q100 What will the following code achieve?
for(;;)
{
PORTB ^= (1 << PB0); _delay_ms(1000); }

A

PB0 blinks every second

B

PB0 stays LOW

C

PB0 toggles once

D

Error in code

Q101

Q101 A GPIO pin configured as input always reads LOW. What could be the most likely reason?

A

Pull-up resistor not enabled

B

Incorrect DDR configuration

C

Interrupt not triggered

D

Incorrect PORT configuration

Q102

Q102 A GPIO pin configured as output does not change state. What could be the issue?

A

Incorrect DDR configuration

B

Interrupt priority

C

Wrong clock frequency

D

Incorrect ADC setting

Q103

Q103 A peripheral connected via UART does not send data. What could be a likely cause?

A

Baud rate mismatch

B

Incorrect GPIO mode

C

Wrong interrupt priority

D

Clock frequency mismatch

Q104

Q104 What does RTOS stand for?

A

Real-Time Operating System

B

Random Task Operating System

C

Rapid Task Operating System

D

Real-Time Operation Scheduler

Q105

Q105 What is a task in the context of RTOS?

A

A function in a program

B

A program that runs continuously

C

A specific job executed by RTOS

D

A hardware interrupt

Q106

Q106 Which RTOS scheduling type ensures the highest priority task is always executed?

A

Round-robin

B

Priority-based

C

Time-slicing

D

First-in-first-out

Q107

Q107 What is the main purpose of a semaphore in RTOS?

A

To manage memory

B

To synchronize tasks

C

To schedule interrupts

D

To store data

Q108

Q108 What is the difference between a binary semaphore and a counting semaphore in RTOS?

A

Binary is faster

B

Counting allows multiple resource access

C

Binary uses memory

D

No difference

Q109

Q109 What does this code snippet do?
xSemaphoreGive(semaphore);

A

Creates a semaphore

B

Takes a semaphore

C

Releases a semaphore

D

Deletes a semaphore

Q110

Q110 What will happen in this code?
xTaskCreate(Task1, "Task1", 128, NULL, 2, NULL);

A

Creates Task1 with priority 2

B

Creates Task1 with priority 128

C

Deletes Task1

D

Task1 runs indefinitely

Q111

Q111 What does this configuration do?
vTaskStartScheduler();

A

Ends RTOS

B

Pauses tasks

C

Starts RTOS scheduler

D

Creates a new task

Q112

Q112 A task in RTOS does not start. What could be the most likely reason?

A

Incorrect priority

B

Scheduler not started

C

Semaphore issue

D

Task stack overflow

Q113

Q113 A high-priority task in RTOS does not execute. What could be the cause?

A

Semaphore not available

B

Task delay function

C

Incorrect priority assigned

D

Task is suspended

Q114

Q114 What is the maximum number of devices that can be connected in an I2C bus?

A

8 devices

B

16 devices

C

127 devices

D

256 devices

Q115

Q115 What is the role of the clock line (SCL) in the I2C communication protocol?

A

Carries data

B

Carries address

C

Synchronizes data transfer

D

Indicates device presence

Q116

Q116 Which of the following is a key feature of the SPI protocol that makes it faster than I2C?

A

Single master communication

B

Uses multiple lines

C

Supports higher speeds

D

Does not require pull-up resistors

Q117

Q117 In UART communication, what is the main purpose of the start bit?

A

Signals the end of transmission

B

Indicates data bit start

C

Resets the receiver

D

Synchronizes data transfer

Q118

Q118 What is the maximum speed supported by the I2C communication protocol?

A

100 Kbps

B

400 Kbps

C

1 Mbps

D

3.4 Mbps

Q119

Q119 What will this code do?
SPCR |= (1 << MSTR);

A

Sets SPI as master mode

B

Sets SPI as slave mode

C

Resets SPI settings

D

Starts SPI communication

Q120

Q120 What will be the effect of this code?
UCSR0A |= (1 << U2X0);

A

Doubles UART baud rate

B

Enables UART TX

C

Disables UART RX

D

Resets UART settings

ad verticalad vertical
ad