1Which Python library provides low-level control of Raspberry Pi GPIO pins?
Python libraries: RPi.GPIO and GPIO Zero
Easy
A.NumPy
B.RPi.GPIO
C.Tkinter
D.GPIO Zero
Correct Answer: RPi.GPIO
Explanation:
RPi.GPIO provides direct, low-level access to the GPIO pins of a Raspberry Pi.
Incorrect! Try again.
2Which GPIO Zero class is commonly used to control an LED?
Python libraries: RPi.GPIO and GPIO Zero
Easy
A.Servo
B.LED
C.Motor
D.Button
Correct Answer: LED
Explanation:
The LED class provides simple methods for turning an LED on, off, or toggling its state.
Incorrect! Try again.
3What is the purpose of GPIO.setup() in RPi.GPIO?
Python libraries: RPi.GPIO and GPIO Zero
Easy
A.Configure a pin's mode
B.Close the Python program
C.Read a pin's voltage
D.Remove event detection
Correct Answer: Configure a pin's mode
Explanation:
GPIO.setup() configures a GPIO pin as an input or an output.
Incorrect! Try again.
4Which RPi.GPIO function releases GPIO resources after a program finishes?
Python libraries: RPi.GPIO and GPIO Zero
Easy
A.GPIO.start()
B.GPIO.cleanup()
C.GPIO.input()
D.GPIO.output()
Correct Answer: GPIO.cleanup()
Explanation:
GPIO.cleanup() resets used GPIO pins and releases the library's resources.
Incorrect! Try again.
5What is the main advantage of interrupt-driven GPIO programming?
Interrupt-driven GPIO programming
Easy
A.It avoids continuous polling
B.It increases the supply voltage
C.It changes the board model
D.It adds more physical pins
Correct Answer: It avoids continuous polling
Explanation:
Interrupt-driven programming responds to pin events without repeatedly checking the pin in a loop.
Incorrect! Try again.
6Which signal change is called a rising edge?
Interrupt-driven GPIO programming
Easy
A.LOW to HIGH
B.LOW to LOW
C.HIGH to HIGH
D.HIGH to LOW
Correct Answer: LOW to HIGH
Explanation:
A rising edge occurs when a digital signal changes from LOW to HIGH.
Incorrect! Try again.
7What is a callback function in GPIO event handling?
Interrupt-driven GPIO programming
Easy
A.A function that installs the operating system
B.A function that supplies motor power
C.A function run when an event occurs
D.A function that changes pin numbering
Correct Answer: A function run when an event occurs
Explanation:
A callback function is automatically executed when the configured GPIO event is detected.
Incorrect! Try again.
8Why is switch debouncing used with GPIO interrupts?
Interrupt-driven GPIO programming
Easy
A.To generate an analog signal
B.To reverse the pin direction
C.To prevent repeated false triggers
D.To increase the logic voltage
Correct Answer: To prevent repeated false triggers
Explanation:
Debouncing prevents one physical button press from being detected as several rapid events.
Incorrect! Try again.
9What is the main purpose of an H-bridge circuit?
Motor control using H-bridge and motor driver ICs
Easy
A.Measure a motor's temperature
B.Convert a motor into a sensor
C.Reverse a motor's direction
D.Store a motor's position
Correct Answer: Reverse a motor's direction
Explanation:
An H-bridge reverses the current through a DC motor, allowing its rotation direction to change.
Incorrect! Try again.
10Why is a motor driver IC used between a GPIO pin and a DC motor?
Motor control using H-bridge and motor driver ICs
Easy
A.To store the Python program
B.To measure network traffic
C.To provide the required current
D.To expand the file system
Correct Answer: To provide the required current
Explanation:
A motor usually requires more current than a GPIO pin can safely supply, so a driver IC handles the load.
Incorrect! Try again.
11Which technique is commonly used to control the speed of a DC motor?
Motor control using H-bridge and motor driver ICs
Easy
A.Pulse-width modulation
B.File system mounting
C.Network address translation
D.Serial text encoding
Correct Answer: Pulse-width modulation
Explanation:
Pulse-width modulation controls average motor power by changing the signal's duty cycle.
Incorrect! Try again.
12What can happen if both sides of an H-bridge are switched incorrectly at the same time?
Motor control using H-bridge and motor driver ICs
Easy
A.A short circuit may occur
B.The GPIO count may increase
C.The motor becomes a sensor
D.The program gains more memory
Correct Answer: A short circuit may occur
Explanation:
Incorrect H-bridge switching can create a direct path between the power supply and ground.
Incorrect! Try again.
13What input signal is commonly used to set a hobby servo's position?
Servo and stepper motor control with acceleration profiles
Easy
A.Continuous audio samples
B.Timed control pulses
C.Random voltage spikes
D.Stored network packets
Correct Answer: Timed control pulses
Explanation:
A hobby servo uses the width of regularly repeated control pulses to determine its target position.
Incorrect! Try again.
14How does a stepper motor normally move?
Servo and stepper motor control with acceleration profiles
Easy
A.Only at maximum speed
B.In random angular jumps
C.Only in one direction
D.In fixed angular steps
Correct Answer: In fixed angular steps
Explanation:
A stepper motor rotates through a sequence of small, fixed angular steps.
Incorrect! Try again.
15What is an acceleration profile in motor control?
Servo and stepper motor control with acceleration profiles
Easy
A.A planned change in speed
B.A record of supply voltage
C.A map of GPIO pin names
D.A list of Python libraries
Correct Answer: A planned change in speed
Explanation:
An acceleration profile defines how motor speed increases or decreases over time.
Incorrect! Try again.
16Why is gradual acceleration useful when starting a stepper motor?
Servo and stepper motor control with acceleration profiles
Easy
A.It changes the motor type
B.It adds extra motor coils
C.It increases the GPIO voltage
D.It reduces missed steps
Correct Answer: It reduces missed steps
Explanation:
Gradual acceleration gives the motor time to reach higher speeds without losing synchronization.
Incorrect! Try again.
17What does DMA stand for?
Real-time GPIO control using DMA
Easy
A.Direct Memory Access
B.Data Measurement Array
C.Dynamic Module Allocation
D.Digital Motor Adjustment
Correct Answer: Direct Memory Access
Explanation:
DMA stands for Direct Memory Access, a method for transferring data with limited CPU involvement.
Incorrect! Try again.
18What is a key benefit of using DMA for GPIO timing?
Real-time GPIO control using DMA
Easy
A.Larger storage capacity
B.More consistent signal timing
C.More physical GPIO pins
D.Higher GPIO voltage levels
Correct Answer: More consistent signal timing
Explanation:
DMA can produce GPIO signals with stable timing because it reduces dependence on CPU scheduling.
Incorrect! Try again.
19How does DMA reduce CPU workload during GPIO control?
Real-time GPIO control using DMA
Easy
A.It transfers data independently
B.It removes the power supply
C.It converts outputs into inputs
D.It rewrites the operating system
Correct Answer: It transfers data independently
Explanation:
DMA moves data between memory and hardware with minimal continuous CPU intervention.
Incorrect! Try again.
20Which application benefits most directly from DMA-based GPIO control?
Real-time GPIO control using DMA
Easy
A.Editing a Python comment
B.Generating precisely timed pulses
C.Displaying static text documents
D.Renaming files in a folder
Correct Answer: Generating precisely timed pulses
Explanation:
DMA is useful for generating precise pulse sequences for applications such as motor control and waveform output.
Incorrect! Try again.
21A push button is physically connected to header pin 11 on a Raspberry Pi. Which RPi.GPIO configuration correctly refers to this pin by its Broadcom GPIO number?
Python libraries: RPi.GPIO and GPIO Zero
Medium
A.GPIO.setmode(GPIO.BOARD) and use channel 17
B.GPIO.setmode(GPIO.BOARD) and use channel 27
C.GPIO.setmode(GPIO.BCM) and use channel 11
D.GPIO.setmode(GPIO.BCM) and use channel 17
Correct Answer: GPIO.setmode(GPIO.BCM) and use channel 17
Explanation:
Physical header pin 11 corresponds to BCM GPIO17. In GPIO.BCM mode, the Broadcom number must be used.
Incorrect! Try again.
22An active-low relay module connected to GPIO17 turns on when its input is LOW. Which GPIO Zero declaration gives relay.on() the expected meaning?
With active_high=False, calling on() drives the pin LOW. initial_value=False keeps the relay inactive when the object is created.
Incorrect! Try again.
23An RPi.GPIO PWM output operates at kHz with a duty cycle of . What are the approximate HIGH and LOW times in each cycle?
Python libraries: RPi.GPIO and GPIO Zero
Medium
A.HIGH for ms and LOW for ms
B.HIGH for ms and LOW for ms
C.HIGH for ms and LOW for ms
D.HIGH for ms and LOW for ms
Correct Answer: HIGH for ms and LOW for ms
Explanation:
At kHz, the period is ms. A duty cycle gives ms HIGH and ms LOW.
Incorrect! Try again.
24A program uses several GPIO channels but must release only channel 18 before assigning it to another module. Which RPi.GPIO call is most appropriate?
Python libraries: RPi.GPIO and GPIO Zero
Medium
A.GPIO.output(18, GPIO.LOW)
B.GPIO.cleanup()
C.GPIO.cleanup(18)
D.GPIO.setup(18, GPIO.IN)
Correct Answer: GPIO.cleanup(18)
Explanation:
GPIO.cleanup(18) resets only channel 18. Calling GPIO.cleanup() without an argument resets every channel used by the program.
Incorrect! Try again.
25A mechanical button generates several transitions within ms of one press. Which event configuration best prevents multiple callbacks from the same press?
Interrupt-driven GPIO programming
Medium
A.Use repeated polling with no delay
B.Use a rising-edge event with bouncetime=20
C.Use a falling-edge event with bouncetime=1
D.Use both-edge detection without a callback
Correct Answer: Use a rising-edge event with bouncetime=20
Explanation:
A debounce interval longer than the observed ms bouncing period suppresses repeated callbacks caused by one physical press.
Incorrect! Try again.
26A sensor produces HIGH pulses lasting only microseconds, while the main loop checks the pin every ms. What is the best way to detect each pulse?
Interrupt-driven GPIO programming
Medium
A.Read the input twice per loop
B.Configure the pin as an output first
C.Increase the polling delay to ms
D.Register a rising-edge event callback
Correct Answer: Register a rising-edge event callback
Explanation:
Polling every ms can miss a microsecond pulse. Edge detection can capture the transition independently of the main loop's polling interval.
Incorrect! Try again.
27A GPIO callback currently performs a slow network request, causing later input events to be delayed. Which redesign is most appropriate?
Interrupt-driven GPIO programming
Medium
A.Replace the callback with a longer blocking delay
B.Place event data in a queue and return quickly
C.Increase the callback's debounce interval substantially
D.Move the network request into every GPIO callback
Correct Answer: Place event data in a queue and return quickly
Explanation:
Interrupt callbacks should do minimal work. A worker thread or main-loop task can process queued events without blocking subsequent GPIO handling.
Incorrect! Try again.
28A quadrature encoder has channels A and B. When an edge occurs on channel A, how can the program determine the rotation direction?
Interrupt-driven GPIO programming
Medium
A.Read channel B and compare its level with channel A
B.Toggle channel B whenever channel A changes
C.Measure only how long channel A remains HIGH
D.Count channel A edges without reading channel B
Correct Answer: Read channel B and compare its level with channel A
Explanation:
The phase relationship between channels A and B indicates direction. Reading B when A changes allows the program to determine which channel leads.
Incorrect! Try again.
29A DC motor is running through an H-bridge with IN1=HIGH, IN2=LOW, and a PWM signal on the enable pin. How should its direction be reversed while keeping approximately the same speed?
Motor control using H-bridge and motor driver ICs
Medium
A.Set IN1=HIGH, IN2=HIGH, and retain PWM
B.Set IN1=LOW, IN2=LOW, and retain PWM
C.Keep both inputs unchanged and use PWM
D.Set IN1=LOW, IN2=HIGH, and retain PWM
Correct Answer: Set IN1=LOW, IN2=HIGH, and retain PWM
Explanation:
Swapping the two direction inputs reverses the motor polarity. Keeping the same PWM duty cycle maintains approximately the same speed.
Incorrect! Try again.
30A V motor is controlled by ideal PWM at a duty cycle of . What approximate average voltage is applied to the motor?
Motor control using H-bridge and motor driver ICs
Medium
A. V
B. V
C. V
D. V
Correct Answer: V
Explanation:
For ideal PWM, the average voltage is V.
Incorrect! Try again.
31A custom H-bridge controlling an inductive DC motor causes voltage spikes when the motor is switched off. Which addition directly protects the switching transistors?
Motor control using H-bridge and motor driver ICs
Medium
A.A larger resistor in series with each GPIO input
B.A capacitor connected only across the logic supply
C.A pull-down resistor on the PWM control input
D.Flyback diodes across the motor current paths
Correct Answer: Flyback diodes across the motor current paths
Explanation:
Flyback diodes provide a safe path for the motor's inductive current when switching stops, limiting damaging voltage spikes.
Incorrect! Try again.
32A motor must rapidly change from forward to reverse without damaging the H-bridge. Which control sequence is safest?
Motor control using H-bridge and motor driver ICs
Medium
A.Float the GPIO pins and immediately apply reverse PWM
B.Drive every bridge input HIGH before changing direction
C.Disable PWM, allow dead time, change direction, then ramp PWM
D.Change direction inputs while maintaining maximum PWM
Correct Answer: Disable PWM, allow dead time, change direction, then ramp PWM
Explanation:
Disabling the drive and inserting dead time reduces shoot-through and current surges. Ramping PWM also limits mechanical and electrical stress.
Incorrect! Try again.
33A servo maps to a ms pulse and to a ms pulse in a ms period. Which pulse width and duty cycle approximately command ?
Servo and stepper motor control with acceleration profiles
Medium
A. ms and
B. ms and
C. ms and
D. ms and
Correct Answer: ms and
Explanation:
is one quarter of the range, so the pulse is ms. Its duty cycle is .
Incorrect! Try again.
34A stepper motor must accelerate smoothly from rest to a high target speed. How should the delay between consecutive step pulses change during acceleration?
Servo and stepper motor control with acceleration profiles
Medium
A.Remain constant at the minimum value
B.Start long and gradually decrease
C.Start short and gradually increase
D.Alternate randomly between long and short
Correct Answer: Start long and gradually decrease
Explanation:
A long initial delay produces a low stepping rate. Gradually decreasing the delay raises the stepping rate and creates smooth acceleration.
Incorrect! Try again.
35A stepper motor has a full-step angle and is driven using microsteps per full step. How many step pulses are required for one complete revolution?
Servo and stepper motor control with acceleration profiles
Medium
A. pulses
B. pulses
C. pulses
D. pulses
Correct Answer: pulses
Explanation:
The motor has full steps per revolution. With microsteps, it requires pulses.
Incorrect! Try again.
36A loaded stepper motor misses steps when commanded to start immediately at high speed but works correctly when started slowly. What is the best software solution?
Servo and stepper motor control with acceleration profiles
Medium
A.Apply an acceleration ramp before reaching full speed
B.Reduce the number of motor phases being energized
C.Reverse the direction signal before each step pulse
D.Replace all timing delays with a fixed short delay
Correct Answer: Apply an acceleration ramp before reaching full speed
Explanation:
A stepper has limited torque at high stepping rates. An acceleration ramp allows its rotor and load to gain speed without losing synchronization.
Incorrect! Try again.
37A Raspberry Pi must generate a precise pulse train while simultaneously handling network traffic. Why is DMA-based GPIO control preferable to a Python timing loop?
Real-time GPIO control using DMA
Medium
A.DMA transfers timed data with less CPU scheduling jitter
B.DMA removes the need to configure GPIO pin directions
C.DMA converts every digital output into an analog output
D.DMA increases the GPIO pins' maximum voltage level
Correct Answer: DMA transfers timed data with less CPU scheduling jitter
Explanation:
DMA can feed prearranged GPIO timing data with limited CPU intervention, making pulse timing less sensitive to operating-system scheduling delays.
Incorrect! Try again.
38A DMA waveform keeps a GPIO pin HIGH for microseconds and LOW for microseconds in each cycle. What are its frequency and duty cycle?
Real-time GPIO control using DMA
Medium
A. kHz and
B. kHz and
C. kHz and
D. kHz and
Correct Answer: kHz and
Explanation:
The period is microseconds, so the frequency is microseconds kHz. The duty cycle is .
Incorrect! Try again.
39Two GPIO timing libraries attempt to use the same DMA channel, and waveform output becomes unreliable. What is the most appropriate correction?
Real-time GPIO control using DMA
Medium
A.Assign non-conflicting supported DMA channels or use one timing service
B.Configure all controlled GPIO pins as inputs during waveform playback
C.Increase every waveform delay until the conflict becomes less visible
D.Run both libraries in separate Python functions on the same thread
Correct Answer: Assign non-conflicting supported DMA channels or use one timing service
Explanation:
DMA channels are shared hardware resources. Avoiding channel conflicts, or consolidating waveform generation under one service, prevents competing transfers.
Incorrect! Try again.
40A precomputed DMA waveform remains stable under heavy CPU load, but gaps appear when a continuously streamed waveform runs for several minutes. What is the most likely cause?
Real-time GPIO control using DMA
Medium
A.The operating system disables all DMA transfers after a fixed duration
B.The DMA data buffer is not being refilled before it becomes empty
C.The PWM duty cycle forces the processor clock to stop periodically
D.The GPIO pin automatically changes from output mode to input mode
Correct Answer: The DMA data buffer is not being refilled before it becomes empty
Explanation:
A continuous stream requires new waveform data before the current buffer is exhausted. Late buffer refills cause underruns and visible output gaps.
Incorrect! Try again.
41An LED is physically connected to header pin 11. The code GPIO.setmode(GPIO.BOARD); GPIO.setup(11, GPIO.OUT) controls it correctly. If the program is rewritten as LED(11) using GPIO Zero's default numbering, which pin is addressed?
Python libraries: RPi.GPIO and GPIO Zero
Hard
A.BCM GPIO11, not header pin 11
B.BCM GPIO17, corresponding to header pin 11
C.Header pin 11 through automatic BOARD detection
D.BCM GPIO27, because GPIO Zero remaps output pins
Correct Answer: BCM GPIO11, not header pin 11
Explanation:
GPIO Zero normally interprets integer pin numbers as BCM numbers. Header pin 11 is BCM GPIO17, so LED(11) selects a different physical pin.
Incorrect! Try again.
42A GPIO Zero device is created as LED(17, active_high=False, initial_value=False). What electrical levels are expected immediately after construction and after calling led.on()?
Python libraries: RPi.GPIO and GPIO Zero
Hard
A.Initially HIGH; on() leaves the pin HIGH
B.Initially floating; on() drives the pin LOW
C.Initially LOW; on() drives the pin HIGH
D.Initially HIGH; on() drives the pin LOW
Correct Answer: Initially HIGH; on() drives the pin LOW
Explanation:
initial_value=False selects the inactive state. With active_high=False, inactivity is electrically HIGH and activation is electrically LOW.
Incorrect! Try again.
43A Python program generates a 1 kHz PWM signal using RPi.GPIO.PWM. Under heavy CPU and I/O load, pulse widths occasionally vary. Which modification most directly addresses the timing mechanism causing this problem?
Python libraries: RPi.GPIO and GPIO Zero
Hard
A.Increase the Python callback thread's debounce interval
B.Call GPIO.cleanup() after every PWM duty update
C.Replace BCM numbering with physical BOARD numbering
D.Use a DMA-timed pin factory such as pigpio
Correct Answer: Use a DMA-timed pin factory such as pigpio
Explanation:
RPi.GPIO.PWM is software timed and is vulnerable to scheduler latency. A DMA-timed backend can produce substantially more deterministic edge timing.
Incorrect! Try again.
44A program mixes direct RPi.GPIO calls with GPIO Zero devices on the same pins. It sometimes reports numbering-mode conflicts and leaves outputs active after exceptions. Which design is most robust?
Python libraries: RPi.GPIO and GPIO Zero
Hard
A.Disable warnings and depend on process termination to reset all pins
B.Alternate BCM and BOARD modes before each individual pin operation
C.Create a separate software PWM instance for every library operation
D.Use one abstraction consistently and release devices in finally or context managers
Correct Answer: Use one abstraction consistently and release devices in finally or context managers
Explanation:
A single ownership model avoids numbering and resource conflicts. Deterministic cleanup with finally, close(), or context managers also handles exceptional exits safely.
Incorrect! Try again.
45A flow sensor can produce valid pulses only apart. An RPi.GPIO rising-edge callback is configured with bouncetime=5. What is the most important measurement consequence?
Interrupt-driven GPIO programming
Hard
A.Each physical pulse will generate callbacks on both edges
B.Valid pulses within the suppression window may be discarded
C.The callback timestamps will automatically be averaged
D.The GPIO hardware will stretch every pulse to 5 ms
Correct Answer: Valid pulses within the suppression window may be discarded
Explanation:
Software debounce suppresses subsequent events during its interval. A 5 ms setting can therefore undercount legitimate pulses separated by only 2 ms.
Incorrect! Try again.
46An edge callback parses JSON, writes to a database, and updates a display. At high event rates, edges are lost and callback latency grows. Which redesign best preserves event responsiveness?
Interrupt-driven GPIO programming
Hard
A.Perform all processing inside the callback under one global lock
B.Timestamp and enqueue events quickly, then process them in workers
C.Replace edge detection with repeated calls to GPIO.cleanup()
D.Increase callback computation so several events can be batched
Correct Answer: Timestamp and enqueue events quickly, then process them in workers
Explanation:
Callbacks should perform minimal bounded work. Enqueuing a timestamped event separates edge capture from slow parsing, storage, and display operations.
Incorrect! Try again.
47A main thread reads and resets a pulse counter while an interrupt callback executes count += 1. Why can counts still be lost in CPython, despite the Global Interpreter Lock?
Interrupt-driven GPIO programming
Hard
A.The read-modify-write sequence is not a protected transaction
B.Integer variables are stored directly in GPIO peripheral memory
C.The GIL forces every callback to execute in another process
D.Edge callbacks bypass Python and modify the counter using DMA
Correct Answer: The read-modify-write sequence is not a protected transaction
Explanation:
The GIL does not make a multi-operation read, update, and reset protocol logically atomic. A lock, queue, or carefully designed handoff is required.
Incorrect! Try again.
48A high-speed quadrature encoder changes state faster than Python callbacks can reliably execute. Direction and position must remain correct. Which solution is most appropriate?
Interrupt-driven GPIO programming
Hard
A.Run two unrestricted callbacks that update one shared integer
B.Add a long debounce interval to both encoder channels
C.Capture transitions with hardware counters or DMA sampling
D.Trigger only on channel A and ignore channel B entirely
Correct Answer: Capture transitions with hardware counters or DMA sampling
Explanation:
High-rate quadrature decoding requires deterministic capture of both channels. Hardware counters or DMA sampling avoid scheduler and callback latency limitations.
Incorrect! Try again.
49During an H-bridge direction reversal, the high-side transistor is enabled before the previously conducting low-side transistor has fully turned off. What is the principal hazard?
Motor control using H-bridge and motor driver ICs
Hard
A.Reduced PWM frequency caused by armature inductance
B.Permanent coasting because both motor terminals float
C.Loss of motor torque caused only by back-EMF cancellation
D.Shoot-through current directly across the supply
Correct Answer: Shoot-through current directly across the supply
Explanation:
Overlapping high-side and low-side conduction creates a low-resistance path across the supply. Dead time is inserted during switching to prevent shoot-through.
Incorrect! Try again.
50A brushed DC motor has winding resistance . It is driven from 12 V through an H-bridge whose total conducting voltage drop is 2 V. Ignoring inductance, what approximate stall current must the driver tolerate?
Motor control using H-bridge and motor driver ICs
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
At stall, back EMF is zero, so . Driver selection must consider this current rather than only the no-load current.
Incorrect! Try again.
51A motor is rapidly decelerated using regenerative braking, and the shared DC supply cannot absorb returned energy. Which failure mode is most likely without additional protection?
Motor control using H-bridge and motor driver ICs
Hard
A.The supply rail rises above its safe voltage
B.The logic inputs permanently change their threshold voltage
C.The motor winding resistance falls nearly to zero
D.The H-bridge PWM frequency becomes exactly doubled
Correct Answer: The supply rail rises above its safe voltage
Explanation:
Regenerative braking returns mechanical energy to the DC bus. If the source cannot sink it, bus voltage can rise dangerously unless clamped, stored, or dissipated.
Incorrect! Try again.
52An H-bridge datasheet defines IN1 = IN2 = 0 as coast and IN1 = IN2 = 1 as brake. Why is assuming that equal inputs always mean the same motor state unsafe?
Motor control using H-bridge and motor driver ICs
Hard
A.Equal inputs always reverse the motor at maximum duty cycle
B.Coast and brake truth tables differ among driver architectures
C.Coast and brake become identical whenever PWM exceeds 50%
D.Equal inputs bypass the bridge and power the motor from logic
Correct Answer: Coast and brake truth tables differ among driver architectures
Explanation:
Some drivers use equal inputs for braking, others for coasting, and enable pins can modify the result. The specific device truth table must be followed.
Incorrect! Try again.
53A hobby servo expects pulses from 1.0 ms to 2.0 ms in a 20 ms frame. If PWM is configured at 50 Hz, which nominal duty-cycle range represents those pulse widths?
Servo and stepper motor control with acceleration profiles
Hard
A.20% to 40%
B.10% to 20%
C.5% to 10%
D.2% to 4%
Correct Answer: 5% to 10%
Explanation:
Duty cycle is pulse width divided by frame period: and . Actual endpoint calibration may require a narrower safe range.
Incorrect! Try again.
54A stepper must move 1000 steps from rest and stop at the destination. The acceleration magnitude is , and the requested maximum speed is . Ignoring discrete-step effects, what profile is feasible?
Servo and stepper motor control with acceleration profiles
Hard
A.A trapezoidal profile cruising at
B.A triangular profile peaking near
C.A constant-speed profile operating at
D.A triangular profile peaking near
Correct Answer: A triangular profile peaking near
Explanation:
Reaching 800 steps/s requires 800 acceleration steps and 800 deceleration steps. Since only 1000 are available, .
Incorrect! Try again.
55For a stepper accelerating from rest with constant angular acceleration, how should the interval between successive step pulses change approximately as the step index increases?
Servo and stepper motor control with acceleration profiles
Hard
A.It remains constant until maximum speed is reached
B.It increases approximately in proportion to
C.It decreases linearly in direct proportion to
D.It decreases approximately in proportion to
Correct Answer: It decreases approximately in proportion to
Explanation:
With constant acceleration, position grows as . Step time therefore grows as , making successive pulse intervals decrease approximately as .
Incorrect! Try again.
56A designer changes a stepper from full-step to 16× microstepping and assumes usable positioning accuracy improves exactly 16× under load. Which limitation most directly invalidates that assumption?
Servo and stepper motor control with acceleration profiles
Hard
A.The driver removes all holding torque between microstep positions
B.Microstepping multiplies the motor's physical step angle by 16
C.Incremental microstep torque may not overcome friction and load
D.The rotor completes 16 revolutions for each commanded revolution
Correct Answer: Incremental microstep torque may not overcome friction and load
Explanation:
Microstepping improves command granularity and smoothness, but rotor position may not follow each microstep accurately when incremental torque is smaller than friction or load torque.
Incorrect! Try again.
57Why can a DMA-generated GPIO waveform have substantially lower timing jitter than a Python loop that repeatedly writes GPIO registers?
Real-time GPIO control using DMA
Hard
A.DMA disables interrupts and pauses the operating system permanently
B.DMA converts all GPIO pins into independent hardware PWM channels
C.DMA executes a prearranged transfer schedule without per-edge task scheduling
D.DMA raises Python thread priority before every individual GPIO transition
Correct Answer: DMA executes a prearranged transfer schedule without per-edge task scheduling
Explanation:
Once configured, DMA transfers can be paced by a peripheral clock or request signal. Individual edges no longer depend on Python execution or scheduler wake-up latency.
Incorrect! Try again.
58A DMA waveform engine uses PWM or PCM requests to pace writes to GPIO set and clear registers. What primarily determines the waveform's base time resolution?
Real-time GPIO control using DMA
Hard
A.The number of callbacks registered on unrelated input pins
B.The Python interpreter's recursion and thread-switch limits
C.The configured peripheral clock and DMA request pacing
D.The GPIO input pull-up resistance and output drive strength
Correct Answer: The configured peripheral clock and DMA request pacing
Explanation:
PWM or PCM DREQ signals pace DMA transfers at configured intervals. That pacing establishes the timing grid on which GPIO transitions can be scheduled.
Incorrect! Try again.
59A DMA engine samples an input pin every . An asynchronous pulse can remain HIGH for only . Which statement is correct?
Real-time GPIO control using DMA
Hard
A.DMA automatically stretches each pulse to the sampling period
B.Some pulses can occur entirely between samples and be missed
C.The sampled pulse will always be recorded as two HIGH values
D.Every pulse is guaranteed to appear in at least one sample
Correct Answer: Some pulses can occur entirely between samples and be missed
Explanation:
A pulse shorter than the sample interval may begin and end between two sampling instants. Guaranteed detection requires faster sampling or hardware pulse capture.
Incorrect! Try again.
60A program builds DMA control blocks and data buffers in normal cached memory, then starts DMA immediately. The DMA engine occasionally reads stale descriptors. Which remedy addresses the underlying issue?
Real-time GPIO control using DMA
Hard
A.Use DMA-coherent memory and required synchronization barriers
B.Change all output pins from BCM numbering to BOARD numbering
C.Increase GPIO debounce time before submitting each descriptor
D.Run a second Python thread that repeatedly rewrites the buffers
Correct Answer: Use DMA-coherent memory and required synchronization barriers
Explanation:
The CPU and DMA engine must observe consistent buffer contents. Coherent allocation, cache maintenance where required, and memory barriers ensure descriptors are visible before DMA starts.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →