1/49
Some conceptual questions from the lectures and homewworks
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Convert 2151 to hexadecimal
Divid by 16 repeatable: → 0×867
Convert 2151 to binary
Divide by 2 repeatedly → 0b100001100111
Why are hexadecimal numbers commonly used in embedded systems?
They compactly represent binary data and are easier to read than long binary strings
When comparing microcontrollers, what features should you consider?
Clock speed, memory, peripherals, power consumption, and instruction set
What is the largest decimal number a 16-bit binary number can represent?
2^16 - 1 = 65,535
Why should you avoid sleep_ms() in real-time systems?
Because it halts the CPU entirely-use timers/interrupts to multitask (e.g., reading sensors while blinking)
What is a voltage divider, and why is it used with microcontrollers?
A circuit that scales down voltage using two resisters. It lets microcontrollers safely read high voltages without potentially damaging components.
What does adc_read() return, and what does it represent?
It returns a number, representing the input voltage’s proportion to the reference voltage
What is PWM, and why is it used for motor control?
Pulse Width Modulation-It mimics analog voltage by pulsing signals. Motors respond to average pulse width (duty cycle).
What is the DIV register in PWM?
Divides the clock speed to set the timer’s base speed.
What is the TOP register in PWM?
Sets the maximum count value, defining the PWM period.
How does the CC register control PWM pulse width?
(Compare Capture) Sets when the purpose turns off during each TOP cycle, changing the duty cycle.
Why would you choose a higher DIV value for PWM?
To slow down the timer, allowing longer pulses (also reduces resolution).
What is ADC resolution?
The smallest voltage change an ADC can detect (e.g., 3.3V/4095 ~= 0.8mV for 12-bit).
Why use a voltage divider instead of connecting a sensor directly to a microcontroller?
To avoid damaging the MCU’s ADC with voltages higher than its reference.
What is the trade-off between PWM frequency and resolution?
Higher frequency (faster pulses) = Smoother motor control, but lower resolution (coarser speed steps).
How is PWM like a light dimmer switch?
Both rapidly turn power on/off - the longer “on” time per cycle, the brighter the light (or faster the motor).
What is I²C, and why is it used in mechatronics?
A 2-wire serial protocol for connecting microcontrollers to sensors/ ICs (SCL clock + SDA data).
What is SCL in I²C?
Clock signal, controls timing.
What is SDA in I²C?
Bidirectional data line (transmits addresses/commands).
Why does SDA go high for a cycle after each byte in I²C?
its the ACK/NACK (Acknoledge) bit, High = NACK (No acknowledgment), Low=ACK.
What is I²C write and read command?
Write: Microcontrollers sends data to a device
Read: Microcontroller requests data from a device.
What does the DAC do for the MCP4725, and why is it useful?
Converts digital numbers (from the I²C) to analog voltages (e.g., for motor control/audio).
How does a DAC’s resolution (e.g., 12-bit) affect its output?
A higher resolution = smoother voltage steps (e.g., 12-bit = 4096 steps between 0V-5V).
How is I²C like a classroom Q&A session?
Teacher (MCU): Controls “clock” (SCL) and asks questions (SDA)
Student (Devices): Respond only when their “address” is called.
What is UART, and why is it used in mechatronics?
A simple serial protocol for device-to-device communication (e.g., MCU to sensors) using TX (transmit) and RX (receive) wires.
What does “8N1” mean in UART?
8: 8 data bits per packet
N: No parity bit (error checking)
1: 1 stop bit (marks end of packet).
How do you identify the start/end of a UART packet?
Start bit: Always low (0)
End Bit: Always high (1)
What is the baud rate, and why does it matter?
It is the speed of communication (bits per second). Mismatched baud rates cause garbage data.
What is a parity bit, and how does “even parity” work?
It is an extra bit for error detection. Even parity = parity bit ensures total 1 s in data + parity is even.
How can you tell if a UART packet is corrupted?
If the parity bit doesn’t match the expected parity.
What is a common cause of UART corruption?
Electrical noise, incorrect baud rate, or loose connections.
How is UART like a walkie-talkie conversation?
TX/RX: Like “over” and “copy” (devices take turns speaking).
Baud rates: how fast you talk, too fast = misunderstood words.
When would you use UART vs I²C?
UART: Simple, long-distance
I²C: Faster, multi-device but shorter distance.
What is PID control, and why is it used in mechatronics?
It is a feedback loop system (Proportional, Integral, Derivative) to maintain precise control.
What does each PID term do>
P (Proportional): Reacts to current error
I (Integral): Fixes small, persistent errors (e.g., steady-state drift)
D (Derivative): Predicts future error (damps oscillation).
How does increases K,p affect a system?
Faster response but can cause overshoot/oscillations.
What happens if K,i is too high?
Eliminates steady-state error but may cause “windup” (slow recovery).
Why is K,d useful?
Reduces overshoot by “slowing down” the system near the target.
Why should you avoid extreme PID values?
High gains can destabilize the system (e.g., motor vibrates uncontrollably).
What is a band pass filter, and why is it used in audio applications?
It is a circuit that allows frequencies within a specific range to pass while blocking others. Used to isolate voice/signals in audio processing.
What are the key parameters of a band pass filter?
Center frequency (f,0): Midpoint of the pass and
Bandwidth (BW): Range of the passed frequencies.
What is the trade-off between filter sharpness and signal strength?
Sharper filters (narrow bandwidth) attenuate desired signals more; wider bands allow noise.
What is the difference between N-type and P-type semiconductors?
N-type: Doped with 5-valance atoms, has free electrons
P-type: Doped with 3-valance atoms, has holes (electron vacancies).
What is a depletion region in a diode?
The zone where free electronics and holes recombine, creating a barrier that prevents current flow unless forward biased.
What are the three regions of a BJT, and how are they doped?
Emitter (N-type): Supplies electrons
Base (P-type): Thin, controls electron flow
Collector (N-type): Controls electrons.
How is a diode like a one-way valve?
Allows current in one direction but blocks the reverse.
What are the three core components of any mechatronics system, and how do they interact?
Sensors → Collect Data
Microcontrollers → Process data + make decisions
Actuators → Execute actions.
When would you use UART vs I²C vs PWM?
UART → Simple, long distance. Trade-off: No built in error checking
I²C → Multi-device, moderate speed. Trade-off: Needs pull-up resistors
PWM: Analog-like control. Trade-off: Frequency vs. resolution balance.
Why is feedback essential in mechatronics, and how does PID implement it?
Been back lets a system self-correct;
P (Present Error) → How bad is it now?
I (Past Error) → What’s the long-term drift?
D (Future Error) → How fast is it changing?