MCQ Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Unit: 1. Introduction to Microcontroller Architecture.

1. Which of the following is not a common feature of Harvard architecture used in


microcontrollers?
A) Separate program and data memory
B) Single bus for data and instructions
C) Ability to fetch an instruction and operand simultaneously
D) Different address spaces for program and data memory
Answer: B) Single bus for data and instructions In the context of microcontroller architecture

2. What does the term "RISC" stand for, and what is its primary advantage?
A) Reduced Instruction Set Computer; simplifies hardware design
B) Reduced Interrupt Service Call; improves real-time processing
C) Regular Instruction Sequence Code; ensures code uniformity
D) Random Instruction Set Controller; allows flexible instruction execution
Answer: A) Reduced Instruction Set Computer; simplifies hardware design

3. Which microcontroller feature is crucial for minimizing power consumption in


battery-operated devices?
A) Integrated DMA controller
B) Multiple I/O ports
C) Sleep and idle modes
D) High clock speed capability
Answer: C) Sleep and idle modes In a microcontroller with a Von Neumann architecture

4. Which of the following statements is true?


A)The same memory and bus are used for both data and instructions.
B) Instructions and data are stored in separate memory banks.
C) It has two separate buses for data and instructions.
D) It can execute multiple instructions in parallel without pipelining.
Answer: A) The same memory and bus are used for both data and instructions.

5. What is the primary function of the Program Counter (PC) in a microcontroller?


A) To store the current executing instruction
B) To hold the address of the next instruction to be executed.
C) To count the number of executed instructions.
D) To manage interrupt handling.
Answer: B) To hold the address of the next instruction to be executed.

6. What is the most important difference between a microprocessor and a


microcontroller?
a) Microprocessors are used where extensive processing power is required
while microcontrollers are used to control embedded systems.
b) Microcontrollers are of lower cost as compared to microprocessors.
c) Microcontrollers contain RAM and ROM while microprocessors do not
d) Microcontrollers have a lower clock-speed as compared to
microprocessors
Answer: a) Microprocessors are used in applications requiring extensive
processing power, while microcontrollers are used for controlling embedded
systems.

7. Which of the below following is the simplest microcontroller known to


have an embedded system?
a) PIC
b) ARM
c) AVR
d) Intel
Answer: c) AVR

8. Which microcontroller family offers a Harvard architecture where it


has separate program and data memory?
a) PIC
b) ARM
c) 8051
d) AVR
Answer: d) AVR

9. What is the operating frequency range for PIC16CXXXX to


PIC18FXXXX microcontrollers?
a) 1 MHz to 10 MHz
b) DC to 20 Hz
c) DC to 20 to 40 MHz
d) 20 MHz to 50 MHz
Answer: c) DC to 20 to 40 MHz

10.What is the maximum number of ADC channels available in the


PIC18FXXXX/4550 microcontroller?
a) 14 channels
b) 18 channels
c) 15 channels
d) 13 channels
Answer: d) 13 channels
UNIT-2: Introduction to Embedded System
1. Which memory storage is widely used in PCs and Embedded
Systems?
a) EEPROM
b) Flash memory
c) SRAM
d) DRAM
Answer:- d

2. Which level simulates the algorithms that are used within the
embedded systems?
a) algorithmic level
b) switch level
c) gate level
d) circuit level
Answer:- a

3. How an embedded system communicate with the outside


world?
a) Memory
b) Output
c) Peripherals
d) Input
Answer: c

4. Which of the following offers external chips for memory and


peripheral interface circuits?
a) Embedded system
b) Peripheral system
c) Microcontroller
d) Microprocessor
Answer: d

5. Which is the single device capable of providing prototyping


support for a range of microcontroller?
a) Umbrella device
b) OTP
c) RAM
d) ROM
Answer: a
1) ARM7 processors are suitable for:
A) High-performance computing
B) Low-power, cost-sensitive applications
C) Desktop computers
D) Mainframe computer
Answer: B) Low-power, cost-sensitive applications

2) Which ARM processor version is known for being used in high-performance applications?
A) ARM7
B) ARM9
C) ARM11
D) ARM Cortex-M
Answer: C) ARM11

3) What does CISC stand for in embedded microcontroller cores?


A) Complex Instruction Set Computing
B) Compact Instruction Set Computing
C) Computer Instruction Set Configuration
D) Complex Integration System Computing
Answer: A) Complex Instruction Set Computing

4) Which type of microcontroller core focuses on a small set of instructions for efficiency?
A) CISC
B) RISC
C) ARM
D) DSP
Answer: B) RISC

5) What type of embedded system is used in critical applications where timing is crucial?
A) Standalone
B) Networked
C) Real-time
D) Mobile
Answer: C) Real-time

UNIT III: PIC 18FXXX Microcontroller

1.What is the primary purpose of the Bank Select Register (BSR) in the PIC18FXXX
microcontroller?

A) To select the oscillator frequency

B) To manage power-down modes

C) To select the appropriate memory bank

D) To configure watchdog timers

2.Which of the following is true about the Program Memory in the PIC18FXXX
microcontroller?

A) It is used for storing data variables.

B) It is non-volatile memory used for storing the program code.

C) It is volatile and used for temporary data storage.


D) It is only used for configuration settings.

3.What happens when the Watchdog Timer (WDT) in the PIC18FXXX microcontroller is
not cleared within the designated time?

A) The microcontroller enters a low-power mode.

B) The microcontroller resets.

C) The WDT is automatically disabled.

D) An interrupt is triggered.

4.Which of the following registers in PIC18FXXX microcontrollers is used to configure the


clock source and oscillator settings?

A) STATUS register

B) TRIS register

C) CONFIG register

D) PORT register

5.What is the purpose of Power-Down modes in PIC18FXXX microcontrollers?

A) To reset the microcontroller

B) To disable peripheral support

C) To reduce power consumption

D) To enhance the clock frequency

1. Which of the following bits in the T1CON register is used to select the clock
source for Timer1 in the PIC18F microcontroller?

A) `TMR1CS`
B) `TMR1ON`

C) `T1CKPS`

D) `T1OSCEN`

Answer: A) `TMR1CS`

2. In the PIC18F microcontroller, which CCP mode allows capturing the value of
the timer when an event occurs on the CCP pin?

A) PWM Mode

B) Capture Mode

C) Compare Mode

D) Timer Mode

Answer: B) Capture Mode

3. Which register is responsible for configuring the analog channels and voltage
reference for the ADC module in the PIC18F microcontroller?

A) `ADCON1`

B) `ADRES`

C) `PORTA`

D) `TRISA`

Answer: A) `ADCON1`
4. What is the function of the PIR1 register in the context of interrupts in the
PIC18F microcontroller?

A) To enable external interrupts

B) To hold the status of peripheral interrupts

C) To configure the timer prescaler

D) To control the ADC module

Answer: B) To hold the status of peripheral interrupts

5. In DC motor speed control using CCP in PWM mode, what parameter of the
PWM signal directly affects the speed of the motor?

A) Frequency of the PWM signal

B) Duty cycle of the PWM signal

C) Voltage reference of the ADC

D) Timer overflow rate

Answer: B) Duty cycle of the PWM signal


1). Restarting a Watchdog timer is known as ________?
Pushing
Pulling
Kicking
Picking
2). CLRWDT is _______?
Clear Watchdog Timer
Clean Watchdog Timer
Close Watchdog Timer
Communicate Watchdog Timer
3). How the watchdog is kicked in Linux OS?
By a User Space Program
By CLRWDT
By Writing to Control Port
By Writing to Register
4). Device driver can _________ Watchdog?
Pull
Push
Restart
Pick

5). Watchdog monitors ______ programs?


Microprocessor
Microcontroller
Hardware
Software
6). Time intervals in watchdog are ______?
Fixed
Programmable
a&b
Dynamic

Unit: 4
1.What is the primary purpose of Timer 0 and Timer 1 in PIC18F microcontrollers?

● A) Generating PWM signals


● B) Controlling the speed of DC motors
● C) Counting external events or generating time delays
● D) Performing ADC conversions
● Answer: C) Counting external events or generating time delays

2.Which register is used to configure the interrupt priorities in PIC18F microcontrollers?

● A) INTCON
● B) PIR1
● C) IPR1
● D) SFR
● Answer: A) INTCON

3.In the context of CCP modes in PIC18F, what does PWM stand for?
● A) Pulse Width Modulation
● B) Phase Width Modulation
● C) Pulse Wave Modulation
● D) Phase Wave Modulation
● Answer: A) Pulse Width Modulation

4.What is the role of the ADCON0 register in the PIC18F microcontroller?

● A) To configure the CCP modules


● B) To select the ADC input channel and start conversion
● C) To enable Timer interrupts
● D) To configure the PORTB pins as input or output
● Answer: B) To select the ADC input channel and start conversion

5.Which of the following is a key feature of the in-built ADC in PIC18F microcontrollers?

● A) It supports up to 16-bit resolution


● B) It requires an external clock source for operation
● C) It allows multiple channels to be scanned automatically
● D) It uses control registers for setting conversion parameters
● Answer: D) It uses control registers for setting conversion parameters

1.In PIC18F, Timer1 in Mode 1 operates as a:

a) 8-bit timer with external clock


b) 16-bit timer with internal clock
c) 16-bit timer with external clock
d) 8-bit timer with internal clock

2.Which interrupt priority level is highest in PIC18F?

a) Level 0
b) Level 1
c) Level 2
d) Level 3

3.In CCP compare mode, the output pin is toggled when:

a) The timer value matches the CCPRx register


b) The timer overflows
c) The CCPx pin changes state
d) An external interrupt occurs

4.Dead time is introduced in H-bridge motor drivers to:

a) Increase motor speed


b) Reduce motor current
c) Prevent shoot-through current
d) Improve motor efficiency

5.A PID controller can be implemented using a microcontroller to improve the performance of a
DC motor speed control system by:

a) Correcting steady-state error


b) Improving transient response
c) Reducing overshoot
d) All of the above

Peripheral Support in PIC 18FXXXX

Question 1: Which of the following peripherals is NOT commonly supported by the PIC
18FXXXX series microcontrollers?
A) Timers
B) ADC (Analog-to-Digital Converter)
C) DAC (Digital-to-Analog Converter)
D) UART (Universal Asynchronous Receiver/Transmitter)
Answer: C) DAC (Digital-to-Analog Converter)

Timers and Interrupt Structure


Question 2: In the PIC18F microcontroller, which special function register (SFR) is primarily
responsible for controlling the interrupt enable/disable mechanism?
A) INTCON
B) PIR1
C) TMR0
D) CCPR1
Answer: A) INTCON

CCP Modes in PIC18F


Question 3: What does the Capture mode in CCP (Capture/Compare/PWM) module of PIC18F
microcontrollers do?
A) Captures the value of the timer when an external event occurs
B) Compares the value of two timers
C) Generates a PWM signal with a fixed frequency
D) Controls the speed of a DC motor
Answer: A) Captures the value of the timer when an external event occurs

Use of Timers with Interrupts


Question 4: Which timer mode in the PIC18F microcontroller is typically used for generating
precise time delays without affecting other operations?
A) Mode 0
B) Mode 1
C) Mode 2
D) Mode 3
Answer: B) Mode 1

Question 5: When interfacing a temperature sensor with the PIC18F microcontroller using the
ADC, which control register is used to select the analog input channel?
A) ADCON0
B) ADCON1
C) ADCON2
D) ADRESL
Answer: A) ADCON0
Question 6: In the PIC18F microcontroller, which of the following registers is primarily
responsible for configuring the mode of Timer0?
A) T0CON
B) T1CON
C) INTCON
D) PR2
Answer: A. T0CON
Question 7: When configuring a Capture mode in the CCP (Capture/Compare/PWM) module of
the PIC18F, what edge is captured when the CCPxM3 bits in the CCPxCON register are
configured as '0101'?
A) Rising Edge
B) Falling Edge
C) Every Rising and Falling Edge
D) Every 4th Rising Edge
Answer: B. Falling Edge

Question 3: Which Special Function Register (SFR) in PIC18F microcontrollers is directly


associated with the configuration of PORTB change interrupts?
A) INTCON
B) TRISB
C) LATB
D) IOCB
Answer: D. IOCB

Question 4: In PWM generation using the CCP module of PIC18F, the duty cycle can be
adjusted by modifying which of the following registers?
A) PR2 and TMR2
B) CCPxCON and T2CON
C) CCPRxL and CCPxCON
D) TMR1 and CCPxL
Answer: C) CCPRxL and CCPxCON
Question 5: The in-built ADC of the PIC18F microcontroller features an ADCON1 register that
is primarily responsible for:
A) Selecting the clock source for the ADC module.
B) Configuring the reference voltage and input channels.
C) Enabling the ADC module.
D) Reading the conversion result from the ADC module.
Answer: B. Configuring the reference voltage and input channels.

1. Which mode of operation is selected when the TMR0 module is configured as a 16-bit timer
in PIC18F?
A) Mode 0
B) Mode 1
C) Mode 2
D) Mode 3
Answer: B) Mode 1

2. What does the RBIF bit in the INTCON register of PIC18F signify?
A) TMR0 Overflow Interrupt Flag
B) PORTB Change Interrupt Flag
C) External Interrupt Flag
D) ADC Interrupt Flag
Answer: B) PORTB Change Interrupt Flag

3. In CCP mode for PWM generation, what is the main role of the PR2 register?
A) Sets the duty cycle
B) Determines the PWM frequency
C) Configures the CCP mode
D) Controls the ADC sampling rate
Answer: B) Determines the PWM frequency

4. what is the purpose of the CCP1CON register in PIC18F?


A) Controls the ADC module
B) Configures CCP1 mode (Capture, Compare, PWM)
C) Sets up Timer1
D) Configures PORTB interrupt settings
Answer: B) Configures CCP1 mode (Capture, Compare, PWM)

5. Which control register is primarily responsible for starting the Analog-to-Digital Conversion
(ADC) in PIC18F?
A) ADCON0
B) ADCON1
C) PIR1
D) INTCON
Answer: A) ADCON0
Question 1: Which of the following is true about Timer0 in PIC18FXXXX when operating in
Mode 0?
a) It functions as an 8-bit timer/counter.
b) It functions as a 16-bit timer/counter.
c) It functions as a 32-bit timer/counter.
d) It is used exclusively for PWM generation.
Answer: a) It functions as an 8-bit timer/counter.

Question 2: Which register is primarily responsible for enabling or disabling global interrupts in
PIC18FXXXX?
a)INTCON
b) TMR1
c) PIR1
d) TRISB
Answer: a) INTCON

Question 3: Which event triggers the PORTB change interrupt in PIC18FXXXX?


a) A high-to-low transition on any PORTB pin
b) A low-to-high transition on any PORTB pin
c) Any change in the state of RB4 to RB7 pins
d) The completion of an ADC conversion
Answer: c) Any change in the state of RB4 to RB7 pins

Question 4: What happens when a Timer1 overflow occurs while interrupts are enabled in
PIC18FXXXX?
a) The timer stops counting.
b) The TMR1IF flag is set and an interrupt is generated if enabled.
c) The timer automatically resets and continues counting.
d) The program counter resets to the beginning of the code.
Answer: b) The TMR1IF flag is set and an interrupt is generated if enabled.

Question 5: In the PWM mode of the CCP module in PIC18FXXXX, which register controls the
duty cycle?
a) CCP1CON
b) PR2
c) CCPR1L
d) T2CON
Answer: c) CCPR1L

1. In PWM mode, the CCPR1L register holds the:


a) Period of the PWM signal
b) Duty cycle of the PWM signal
c) Frequency of the PWM signal
d) Phase of the PWM signal
Answer: b) Duty cycle of the PWM signal
2. How does the CCP module control the speed of a DC motor?
a) By adjusting the motor’s voltage
b) By varying the PWM duty cycle
c) By changing the current
d) By altering the resistance
Answer: b) By varying the PWM duty cycle

3. Which register is used to select the ADC channel in the PIC18F microcontroller?
a) ADCON0
b) ADCON1
c) ADCON2
d) ADRES
Answer: a) ADCON0

4. What type of sensor is typically interfaced with the ADC of a PIC18F microcontroller?
a) Digital sensor
b) Analog sensor
c) Binary sensor
d) Boolean sensor
Answer: b) Analog sensor

5. Which of the following can be a common application of interfacing a temperature sensor with a
PIC18F microcontroller?

a) Motor speed control


b) Light intensity measurement
c) Temperature monitoring system
d) Frequency counter
Answer: c) Temperature monitoring system

UNIT V- Real Word Interfacing With PIC 18FXXXX


1. What is the primary function of Port pins in PIC18FXXXX microcontrollers?
a. Data processing
b. Memory allocation
c. Input and output operations
d. Power management
Answer: c) Input and output operations

2. Which sensor can be used to detect motion when interfacing with a PIC18FXXXX
microcontroller?
a. LDR sensor
b. PIR sensor
c. Ultrasonic sensor
d. Temperature sensor
Answer: b) PIR sensor

3. Which type of programming language is used to develop embedded applications for the
PIC18FXXXX microcontroller?
a. Assembly language
b. Python
c. Embedded C
d. JavaScript
Answer: c) Embedded C

4. Which communication protocol is commonly used for interfacing external EEPROM with
the PIC18FXXXX microcontroller?
a. UART
b. SPI
c. I2C
d. PWM
Answer: c) I2C

5. Which component is necessary for controlling multiple LEDs with fewer GPIO pins on a
PIC18FXXXX microcontroller?
a. Shift register
b. Diode
c. Capacitor
d. Transistor
Answer: a) Shift register

6. Which of the following is a common interface method used to connect sensors to a PIC 18F
microcontroller?
a. I2C
b. UART
c. SPI
d. All of the above

Answer: D) All of the above

7. When interfacing a digital sensor with a PIC 18F microcontroller, which type of pin
configuration is generally used?
a. Analog input
b. Digital input
c. PWM output
d. Comparator input

Answer:B) Digital Input

8. For interfacing an LCD display with a PIC 18F microcontroller, which protocol is commonly
employed?
a. SPI
b. I2C
c. Parallel
d. Both B and C

Answer: D) Both B and C

9. What is the purpose of using a voltage divider when interfacing an analog sensor with a PIC 18F
microcontroller?
a. To increase the sensor's signal range
b. To convert the analog signal to a digital one
c. To scale down the sensor's output voltage to match the ADC input range
d. To amplify the signal
Answer: C) To scale down the sensor's output voltage to match the ADC input range

10. In a PIC 18F microcontroller, what is the primary function of the ADC (Analog-to-Digital
Converter)?
a. To generate PWM signals
b. To read digital input signals
c. To convert analog signals into digital values
d. To interface with external memory

Answer: C) To convert analog signals into digital values

11. Which of the following is a typical function of a port in microcontroller programming?


a) To store data permanently
b) To interface external devices with the microcontroller
c) To execute conditional logic operations
d) To handle interrupt requests
Ans: b) To interface external devices with the microcontroller

12. What is the purpose of interfacing an LED with a microcontroller?


a) To store large amounts of data
b) To provide visual feedback based on microcontroller output
c) To amplify signals from the microcontroller
d) To measure temperature changes
Ans: b) To provide visual feedback based on microcontroller output

13. Which pin configuration is commonly used to interface an LCD with a microcontroller?
a) I2C
b) UART
c) Parallel
d) SPI
Ans: c) Parallel

14. What is a primary purpose of interfacing a keyboard with a microcontroller?


a) To provide a means for user input
b) To output data to external storage
c) To amplify audio signals
d) To monitor environmental conditions
Ans: a) To provide a means for user input

15. Which type of sensor is typically used for motion detection in embedded systems?
a) Temperature sensor
b) Light sensor
c) PIR (Passive Infrared) sensor
d) Humidity sensor
Ans: c) PIR (Passive Infrared) sensor

1. What is the primary function of Port pins in PIC18FXXXX microcontrollers?

a) Data processing
b) Memory allocation
c) Input and output operations
d) Power management

Answer: c) Input and output operations

2. Which sensor can be used to detect motion when interfacing with a PIC18FXXXX
microcontroller?
a) LDR sensor
b) PIR sensor
c) Ultrasonic sensor
d) Temperature sensor
Answer: b) PIR sensor
3. Which type of programming language is used to develop embedded applications for the
PIC18FXXXX microcontroller?
a) Assembly language
b) Python
c) Embedded C
d) JavaScript
Answer: c) Embedded C
4. Which communication protocol is commonly used for interfacing external EEPROM
with the PIC18FXXXX microcontroller?
a) UART
b) SPI
c) I2C
d) PWM
Answer: c) I2C
5. Which component is necessary for controlling multiple LEDs with fewer GPIO pins on a
PIC18FXXXX microcontroller?
a) Shift register
b) Diode
c) Capacitor
d) Transistor
Answer: a) Shift register
1)Which register is used to configure the edge trigger for the RB0/INT pin?
a) INTCON
b) OPTION_REG
c) TMR0
d) T1CON
Answer: b) OPTION_REG

2)Which timer is typically used with the CCP module in PWM mode?
a) Timer2
b) Timer0
c) Timer1
d) Timer3
Answer: a) Timer2

3)The GIE bit in INTCON register is used to:


a) Enable peripheral interrupts
b) Enable global interrupts
c) Disable all interrupts
d) Prioritize interrupts
Answer: b) Enable global interrupts

4)Which register in PIC18F is used to configure the ADC module?


a) ADCON0
b) ADCON1
c) ADCON2
d) All of the above
Answer: d) All of the above

5)In Compare mode, what occurs when the TMR1 register value matches the
CCPR1 value?
a) An interrupt is generated
b) The CCP pin changes state
c) Both a and b
d) The timer resets
Answer: c) Both a and b

1.What type of signal can be generated using a DAC?


A) Digital signal
B) Analog signal
C) Pulse Width Modulated signal
D) Square wave only
Answer: B) Analog signal
2. Which embedded C function is typically used to output data to a DAC?
A) DAC_Output(value);
B) dac_write(value);
C) DAC_Send(value);
D) analogWrite(value);
Answer: B) dac_write(value);

3. Which of the following tools is commonly used for debugging embedded C code on a
PIC microcontroller?
A) MPLAB X IDE
B) Keil uVision
C) Arduino IDE
D) Visual Studio Code
Answer: A) MPLAB X IDE

4. In designing a PIC test board, what component is essential for debugging?


A) LED indicators
B) JTAG or ICSP header
C) Oscillator circuit
D) Voltage regulator
Answer: B) JTAG or ICSP header

5. What is the primary purpose of using a test board in embedded system design?
A) To integrate multiple microcontrollers
B) To provide a stable environment for testing and debugging code
C) To reduce the cost of development
D) To increase the speed of the microcontroller
Answer: B) To provide a stable environment for testing and debugging code

1. Which of the following ports on a PIC microcontroller is commonly used for


digital input/output operations?

A) PORTA

B) PORTB

C) PORTC

D) PORTD

2. What is the primary purpose of using a DAC in an embedded system?


A) To convert digital signals to analog signals

B) To convert analog signals to digital signals

C) To amplify digital signals

D) To filter noise from analog signals

3. In an embedded C program, which function is typically used to interface with an


LED connected to a microcontroller?

A) led_write()

B) digitalWrite()

C) gpio_toggle()

D) set_led()

4. Which type of signal is most commonly used by motion detectors in home


protection systems to detect movement?

A) Infrared (IR)

B) Ultrasonic

C) Radio Frequency (RF)

D) Visible Light

5. When interfacing a 4x4 keypad with a microcontroller, how many pins are
required to read the input from the keypad?

A) 4 pins

B) 8 pins
C) 16 pins

D) 12 pins

1. What does the term "interrupt" refer to in the context of PIC18FXXXX microcontrollers?

a) A delay in program execution

b) A software subroutine

c) A signal that temporarily halts the CPU to execute a special task

d) A type of memory used for storage

2. Which register pair in the PIC18FXXXX microcontroller is used to control the PWM duty cycle?

a) CCPR1L and CCP1CON

b) TMR0L and TMR0H

c) ADCON0 and ADCON1

d) SPBRG and SPBRGH

3. To interface an external EEPROM with a PIC18FXXXX microcontroller, which communication protocol


would be most appropriate?

a) UART

b) SPI

c) I2C

d) CAN

4. Which of the following sensors would typically require the use of the ADC module for interfacing with
a PIC18FXXXX microcontroller?

a) Digital accelerometer

b) Hall effect sensor with digital output


c) LDR (Light Dependent Resistor)

d) RFID reader

5. When interfacing an LED with a PIC18FXXXX microcontroller, what is the purpose of the
current-limiting resistor?

a) To increase the brightness of the LED

b) To prevent damage to the microcontroller and LED

c) To stabilize the voltage

d) To decrease the power consumption of the LED

1)Which CCP mode is used to capture the time of an external event?

A) Capture

B) Compare

C) PWM

D) None of the above

2)In CCP PWM mode, the duty cycle of the PWM signal is determined by the ratio of the CCPx value to
the:

A) TMR0

B) TMR1

C) CCPRx

D) PR2

3)How can you interface a temperature sensor (e.g., LM35) to the ADC of the PIC18FXX
microcontroller?

A) Connect the sensor's output to the VREF+ pin.

B) Connect the sensor's output to the ANx pin.

C) Use a voltage divider to scale the sensor's output.

D) Connect the sensor's output directly to the ADC input.


4)What is the resolution of the ADC in the PIC18FXX microcontroller?

A) 8-bit

B) 10-bit

C) 12-bit

D) 16-bit

5)How can you use CCP PWM to control the speed of a DC motor?

A) By varying the duty cycle of the PWM signal.

B) By changing the frequency of the PWM signal.

C) A voltage divider is used to control the motor voltage.

D) A transistor is used to switch the motor current.

1. LCD InterfacingWhich command initializes an LCD in 8-bit mode using embedded C?

- A) LCD_Init(8);

- B) lcd_cmd(0x38);

- C) LCD_Command(8);

- D) lcd_config(0x38);

Answer: B) lcd_cmd(0x38);

2. How many data pins are required to interface a character LCD in 4-bit mode?e?

- A) 8

- B) 6

- C) 4

- D) 2

Answer:C) 4

3. Which function is used to send a command to an LCD in embedded C?

- A) lcd_cmd(cmd);
- B) lcd_write(cmd);

- C) LCD_Send(cmd);

- D) LCD_Command(cmd);

Answer:A) lcd_cmd(cmd);

4. What is the role of the Enable € pin in LCD interfacing?

- A) To turn on the backlight

- B) To latch the data into the LCD

- C) To reset the LCD

- D) To select between command and data modes

Answer: B) To latch the data into the LCD

5. Which function is used to display a character on the LCD in embedded C?

- A) lcd_print(char);

- B) LCD_Display(char);

- C) lcd_write(char);

- D) LCD_Send(char);

Answer: C) lcd_write(char);

1. What does the term "interrupt" refer to in the context of PIC18FXXXX microcontrollers?

a) A delay in program execution

b) A software subroutine

c) A signal that temporarily halts the CPU to execute a special task

d) A type of memory used for storage

2. Which register pair in the PIC18FXXXX microcontroller is used to control the PWM duty cycle?

a) CCPR1L and CCP1CON

b) TMR0L and TMR0H


c) ADCON0 and ADCON1

d) SPBRG and SPBRGH

3. To interface an external EEPROM with a PIC18FXXXX microcontroller, which communication protocol


would be most appropriate?

a) UART

b) SPI

c) I2C

d) CAN

4. Which of the following sensors would typically require the use of the ADC module for interfacing with
a PIC18FXXXX microcontroller?

a) Digital accelerometer

b) Hall effect sensor with digital output

c) LDR (Light Dependent Resistor)

d) RFID reader

5. When interfacing an LED with a PIC18FXXXX microcontroller, what is the purpose of the
current-limiting resistor?

a) To increase the brightness of the LED

b) To prevent damage to the microcontroller and LED

c) To stabilize the voltage

d) To decrease the power consumption of the LED

1. Which of the following is true about the SSPBUF register in


PIC18F microcontrollers?
A) It is used to transmit data in I2C mode.
B) It is used to receive data in SPI mode.
C) It is used to transmit and receive data in I2C and SPI modes.
D) It is used to control the baud rate in UART mode.
Answer: C) It is used to transmit and receive data in I2C and SPI
modes.

2. Which bit in the TRISB register is used to set the direction of


the RB0 pin in PIC18F microcontrollers?
A) TRISB0
B) TRISB1
C) TRISB2
D) TRISB3
Answer: A) TRISB0

3. What is the function of the FOSC4 bit in the PIC18F


microcontroller's configuration word?
A) Selects the internal oscillator frequency
B) Enables the fail-safe clock monitor
C) Selects the external clock source
D) Enables the clock output on the OSC2 pin
Answer: A) Selects the internal oscillator frequency

4. Which of the following instructions is used to clear the W


register in PIC18F microcontrollers?
A) CLRWDT
B) CLRW
C) WREG 0x00
D) WREG 0
Answer: B) CLRW

5. Which register is used to enable the analog-to-digital


converter (ADC) module in PIC18F microcontrollers?
A) ADCON0
B) ADCON1
C) ADCON2
D) ADEN
Answer: A) ADCON0
1)Which of the following waveforms can be generated directly using a DAC when provided with
the appropriate digital input signals?
A) Square wave
B) Sine wave
C) Triangular wave
D) All of the above
Answer: D) All of the above
2)When designing a PIC test board, why is it important to include decoupling capacitors close to
the power supply pins of the PIC microcontroller?

A) To reduce the power consumption of the microcontroller


B) To stabilize the input voltage by filtering out noise and voltage spikes
C) To increase the clock speed of the microcontroller
D) To improve communication speed with external devices

Answer: B) To stabilize the input voltage by filtering out noise and voltage spikes

3)Which of the following types of motion detectors is commonly used for detecting the presence
of a person by sensing body heat?

A) Ultrasonic sensor
B) Passive Infrared (PIR) sensor
C) Microwave sensor
D) Laser sensor

Answer: B) Passive Infrared (PIR) sensor

4)When interfacing a 16x2 LCD with a microcontroller, what is the purpose of the RS (Register
Select) pin?

A) To control the backlight of the LCD


B) To select between sending data to the data register or sending commands to the instruction
register
C) To reset the LCD to its initial state
D) To enable the LCD display

Answer: B) To select between sending data to the data register or sending commands to the
instruction register
5)When interfacing an LED with a microcontroller, why is a current-limiting resistor typically
used in series with the LED?

A) To increase the brightness of the LED


B) To prevent the LED from overheating and burning out
C) To reduce the voltage across the microcontroller
D) To allow the LED to operate at higher currents

Answer: B) To prevent the LED from overheating and burning out

1. Which Special Function Register (SFR) in the PIC18F microcontroller is responsible for
managing global and peripheral interrupts, including enabling or disabling all unmasked
interrupts?
A) PORTB
B) INTCON
C) PIR1
D) TMR0
Answer:
B) INTCON

2. Which register in the PIC18F microcontroller controls the selection of the analog input
channel for the ADC module?
A) ADCON0
B) ADRESL
C) ADCON1
D) ADCON2
Answer:
A) ADCON0

3. In the PIC18F microcontroller's ADC module, where is the result of the analog -to-digital
conversion stored?
A) ADCON0 & ADCON1
B) PORTB & PORTC
C) ADRESL & ADRESH
D) TMR0L & TMR0H
Answer:
C) ADRESL & ADRESH

4. In Pulse Width Modulation (PWM), what does the duty cycle represent?
A) The number of pulses per second
B) The duration of one complete cycle
C) The percentage of time the signal is high during one period
D) The amplitude of the pulse signal
Answer:
C) The percentage of time the signal is high during one period
5. Which of the following is a common application of Pulse Width Modulation (PWM)?
A) Generating high-frequency audio signals
B) Regulating motor speed
C) Amplifying analog signals
D) Measuring temperature
Answer:
B) Regulating motor speed

1. Port Structure with Programming


Q1: Which of the following is true about a microcontroller's I/O port?
 a) It can only be configured as input.
 b) It can only be configured as output.
 c) It can be configured as both input and output.
 d) It can only be used for communication.
Ans: c) It can be configured as both input and output.

Q2: What is the significance of the TRIS register in a PIC microcontroller?


 a) It is used to store data temporarily.
 b) It controls the direction of the port pins.
 c) It is used for arithmetic operations.
 d) It is used to clear the watchdog timer.
Ans: b) It controls the direction of the port pins.

2. Interfacing of LED
Q3: What is the typical current required to light an LED connected to a
microcontroller?
 a) 1 mA
 b) 10 mA
 c) 20 mA
 d) 50 mA
Ans: c) 20mA

3. Motion Detectors
Q4: Which type of sensor is commonly used for motion detection in
embedded systems?
 a) LDR (Light Dependent Resistor)
 b) PIR (Passive Infrared Sensor)
 c) Thermistor
 d) Piezoelectric Sensor
Ans: b) PIR (Passive Infrared Sensor)
4.Design of PIC Test Board and Debugging
Q5: What is the primary purpose of a PIC test board?
 a) To permanently program a microcontroller.
 b) To test and debug the functionality of a PIC microcontroller.
 c) To provide additional memory for a microcontroller.
 d) To control the power supply to a microcontroller.
Ans: b) To test and debug the functionality of a PIC microcontroller.

1. Which register would you configure to enable internal pull-up resistors for a PORTB
pin in a PIC microcontroller?
- A) TRISB
- B) PORTB
- C) LATB
- D) INTCON2
- Answer: D) INTCON2

2. What is the typical sequence to clear the display of an LCD using embedded C?
- A) lcd_cmd(0x01);
- B) lcd_clear();
- C) lcd_write(0x00);
- D) LCD_Reset();
- Answer: A) lcd_cmd(0x01);

3. Which method is most efficient for detecting a key press in a matrix keypad?
- A) Continuously scanning all rows and columns
- B) Interrupt-driven row scanning
- C) Polling each column in sequence
- D) Using a timer to periodically scan the keypad
- Answer: B) Interrupt-driven row scanning

4. In an embedded home security system, how would you prevent false triggers from a
PIR sensor?
- A) Increase the sensitivity of the PIR sensor
- B) Implement a software filter to require consistent detection over a period
- C) Reduce the power supply voltage to the sensor
- D) Disable the sensor at regular intervals
- Answer: B) Implement a software filter to require consistent detection over a period

5. What is the primary disadvantage of using a DAC for waveform generation in


embedded systems?
- A) Limited frequency range
- B) Inability to generate square waves
- C) High power consumption
- D) Requires a high-resolution ADC for operation
- Answer: A) Limited frequency range

Which of the following is the correct method to turn an LED on using a microcontroller GPIO pin?

A) Connect the LED directly to the GPIO pin without a resistor

B) Connect the anode of the LED to the GPIO pin and the cathode to ground through a resistor

C) Connect the cathode of the LED to the GPIO pin and the anode to ground through a resistor

D) Connect the LED between two GPIO pins without a resistor

Answer: B) Connect the anode of the LED to the GPIO pin and the cathode to ground through a resistor

When interfacing a 4x4 matrix keyboard with a microcontroller, how does the microcontroller detect
which key is pressed?

A) By reading the voltage level on each row and column

B) By continuously scanning rows and columns to detect the shorted pair corresponding to the pressed
key

C) By receiving a serial signal from the keyboard

D) By using an ADC to convert the pressed key into a digital value

Answer: B) By continuously scanning rows and columns to detect the shorted pair corresponding to the
pressed key

In a typical motion detector system, how does an ultrasonic sensor detect motion?

A) By measuring the change in infrared radiation levels

B) By detecting sound waves generated by movement

C) By emitting sound waves and measuring the time it takes for the echoes to return

D) By using a laser to detect changes in light intensity

Answer: C) By emitting sound waves and measuring the time it takes for the echoes to return
During the debugging process of a PIC microcontroller, which tool is commonly used to step through the
program code and examine the values of registers in real-time?

A) Logic analyzer

B) Oscilloscope

C) In-circuit debugger (ICD)

D) Multimeter

Answer: C) In-circuit debugger (ICD)

In a DAC-based waveform generator, what determines the frequency of the output waveform?

A) The resolution of the DAC

B) The reference voltage applied to the DAC

C) The rate at which the digital values are updated (sampling rate)

D) The type of DAC used (R-2R, weighted resistor, etc.)

Answer: C) The rate at which the digital values are updated (sampling rate)

Q.1.) What does "PIC" in PIC18FXXXX stand for?

A) Peripheral Interface Controller


B) Programmable Integrated Circuit
C) Processor Interface Chip
D) Programmable Input Controller
Correct Answer: A) Peripheral Interface Controller

Q.2.) What is the primary function of an ADC (Analog-to-Digital Converter) in a


PIC18FXXXX microcontroller?

A) Convert digital signals to analog signals


B) Measure the voltage of an analog input and convert it to a digital value
C) Convert digital signals to pulse-width modulated signals
D) Measure the frequency of digital input signals
Correct Answer: B) Measure the voltage of an analog input and convert it to a digital value
Q.3.)Which communication protocol is often used for interfacing external devices like
sensors or EEPROMs with the PIC18FXXXX microcontroller?

A) SPI
B) UART
C) I2C
D) PWM
Correct Answer: C) I2C

Q.4.)What is the purpose of a crystal oscillator in the PIC18FXXXX microcontroller


circuit?

A) To amplify signals from sensors


B) To provide a stable clock signal for the microcontroller
C) To convert AC signals to DC
D) To store user data permanently
Correct Answer: B) To provide a stable clock signal for the microcontroller

Q.5.)How does the PIC18FXXXX microcontroller typically handle external interrupts?

A) By polling the input pin continuously


B) By executing an Interrupt Service Routine (ISR) when the interrupt occurs
C) By ignoring the interrupt if it's not from an analog source
D) By resetting the microcontroller automatically
Correct Answer: B) By executing an Interrupt Service Routine (ISR) when the interrupt occurs

1. What is the primary function of Timer 0 in PIC 18FXXXX microcontrollers?

a) To generate PWM signals

b) To measure pulse widths

c) To keep track of time

d) To handle interrupts

Answer: c) To keep track of time


1. Which mode of the CCP (Capture, Compare, PWM) module is used to measure the time between two
edges of an external signal?

a) Capture mode

b) Compare mode

c) PWM mode

d) None of the above

Answer: a) Capture mode

1. What is the purpose of the PORTB change interrupt in PIC 18FXXXX microcontrollers?

a) To detect changes on PORTA

b) To detect changes on PORTB

c) To detect changes on PORTC

d) To detect changes on PORTD

Answer: b) To detect changes on PORTB

1. Which register is used to control the ADC (Analog-to-Digital Converter) module in PIC 18FXXXX
microcontrollers?

a) ADCON0

b) ADCON1

c) ADCON2

d) ADCON3

Answer: a) ADCON0
1. What is the primary function of the CCP module in DC motor speed control?

a) To generate a PWM signal to control motor speed

b) To measure the motor's rotational speed

c) To control the motor's direction

d) To monitor the motor's temperature

Answer: a) To generate a PWM signal to control motor speed

1. Which of the following is true about Timer0 in PIC18F


microcontrollers?
● A) It can only be used as an 8-bit timer.
● B) It can function in both timer and counter mode.
● C) It operates exclusively in Timer mode.
● D) It cannot be used with interrupts.
Answer: B) It can function in both timer and counter mode.
2. Which Special Function Register (SFR) is primarily used to
enable global and peripheral interrupts in PIC18F?
● A) INTCON
● B) PIR1
● C) TMR0
● D) PIE2
Answer: A) INTCON
3. Which PORTB pins are associated with the change-on-state
interrupt in PIC18F microcontrollers?
● A) RB0-RB1
● B) RB4-RB7
● C) RB0-RB3
● D) RB4-RB5
Answer: B) RB4-RB7
4.What happens in Capture mode of the CCP module?
● A) The timer value is compared to a preset value.
● B) The PWM signal is generated.
● C) The value of a free-running timer is captured when an
event occurs.
● D) The motor speed is controlled.
Answer: C) The value of a free-running timer is captured when
an event occurs.
5. Which register controls the ADC conversion clock in PIC18F
microcontrollers?
● A) ADCON0
● B) ADCON1
● C) ADCON2
● D) ADRES
Answer: C) ADCON2
1. What is the primary difference between Timer Mode 0 and Mode 1 in the PIC18F
microcontroller?
a) Mode 0 is 8-bit, and Mode 1 is 16-bit
b) Mode 0 is 16-bit, and Mode 1 is 8-bit
c) Mode 0 operates as a counter, and Mode 1 as a timer
d) Mode 0 is for PWM, and Mode 1 is for Capture/Compare
Answer: a) Mode 0 is 8-bit, and Mode 1 is 16-bit

2. In PIC18F microcontrollers, which special function register (SFR) is used to enable the global
interrupt?
a) INTCON
b) PIR1
c) PIE1
d) TMR0
Answer: a) INTCON

3. How does the PORTB change interrupt work in PIC18F microcontrollers?


a) It triggers when the value of PORTB is incremented
b) It triggers when there is any change on PORTB<7:4> pins
c) It triggers when the entire PORTB register changes
d) It triggers only when RB0 changes
Answer: b) It triggers when there is any change on PORTB<7:4> pins

4. Which of the following is NOT a function of the Capture/Compare/PWM (CCP) module in


PIC18F
microcontrollers?
a) Capturing the value of a timer at a specific event
b) Comparing a set value with the value of a timer
c) Generating Pulse Width Modulation (PWM) signals
d) Performing Analog-to-Digital Conversion (ADC)
Answer: d) Performing Analog-to-Digital Conversion (ADC)

5. Whatis the purpose of the ADCON0 register in PIC18F microcontrollers?


a) To set the ADC clock source
b) To select the ADC input channel and start conversion
c) To hold the result of ADC conversion
d) To enable/disconnect the ADC module from the microcontroller
Answer: b) To select the ADC input channel and start conversion

Question 1: Which mode of the Timer in PIC 18FXXXX is used for generating a square wave output?
A) Mode 0

B) Mode 1
C) Mode 2

D) Mode 3

Answer: B) Mode 1

Question 2: What is the primary function of the CCP (Capture/Compare/PWM) module in PIC
18FXXXX?
A) To generate random numbers

B) To perform mathematical operations

C) To control peripheral devices like motors and LEDs

D) To store data

Answer: C) To control peripheral devices like motors and LEDs

Question 3: Which CCP mode is used to measure the pulse width of an incoming signal?
A) Capture mode

B) Compare mode

C) PWM mode

D) None of the above

Answer: A) Capture mode

Question 4: How can the speed of a DC motor be controlled using the CCP module?
A) By adjusting the pulse width of the PWM signal

B) By changing the frequency of the PWM signal

C) By varying the duty cycle of the PWM signal

D) All of the above


Answer: D) All of the above

Question 5: What is the primary function of the ADC (Analog-to-Digital Converter) in PIC 18FXXXX?
A) To convert digital signals into analog signals

B) To convert analog signals into digital signals

C) To perform mathematical operations

D) To generate random numbers

Answer: B) To convert analog signals into digital signals

You might also like