Embedded Systems and RTOS: Key Concepts and Components

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/96

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

97 Terms

1
New cards

What is the key difference between an Interrupt Service Routine (ISR) and an Interrupt Handler in the context of this course?

An ISR is the very short code that runs immediately upon an interrupt, while the Interrupt Handler is the main loop function that responds to a flag set by the ISR.

2
New cards

The actor design pattern, as implemented in the course, uses file-static _____ to act as mailboxes for inter-task communication.

FIFOs

3
New cards

In the actor design pattern, what is the role of the `_run()` function for a task?

It checks its queue for work, processes one item if available, and returns true if work was done, false otherwise.

4
New cards

What is a significant limitation of the `if-else if` scheduler used in the actor model, especially as the number of tasks increases?

It is not very scalable or robust, becoming unwieldy with many tasks and enforcing a strict priority order.

5
New cards

What core capability does an RTOS scheduler have that the simple `if-else if` scheduler lacks, allowing it to handle long-running tasks without blocking lower-priority ones?

Preemption, the ability to pause a task, switch to another, and then return to the original task where it left off.

6
New cards

What is the primary design goal of a Real-Time Operating System (RTOS) compared to a typical desktop OS?

An RTOS aims to complete specific tasks within a specific time period predictably, whereas a desktop OS aims to complete all tasks collectively as quickly as possible.

7
New cards

What is FreeRTOS?

A popular, free, open-source, lightweight Real-Time Operating System (RTOS) for microcontrollers and embedded systems.

8
New cards

Which file is required by FreeRTOS and contains all the settings for the RTOS as `#defines`?

FreeRTOSConfig.h

9
New cards

What is the term for the RTOS mechanism where the scheduler periodically rotates through different tasks, creating the appearance of simultaneous execution?

Time Slicing

10
New cards

What hardware timer on an MCU determines how often the RTOS scheduler switches tasks?

The System Tick Timer (SysTick timer).

11
New cards

In FreeRTOS, what must every task have for storing local variables when the task is switched out by the scheduler?

Its own stack.

12
New cards

What is the term for the current running function and its associated variable/register values that are saved to a task's stack during a context switch?

Context

13
New cards

What FreeRTOS function is called to create a new task?

xTaskCreate()

14
New cards

After creating all necessary tasks, which FreeRTOS function must be called to start the RTOS scheduler?

vTaskStartScheduler()

15
New cards

In FreeRTOS, what is the state of a task that is waiting for a signal or data to continue execution?

Blocked

16
New cards

A key benefit of RTOS is that a task in the Blocked state uses how much CPU power?

It uses no CPU power.

17
New cards

What is it called when a newly unblocked task has a higher priority than the currently running task, causing the RTOS to switch to the new task immediately?

Preemption

18
New cards

What FreeRTOS communication primitive is used to send signals between tasks, indicating it is okay to proceed?

Semaphores

19
New cards

What FreeRTOS primitive allows only one task or interrupt to access a shared resource at a time, preventing race conditions?

Mutex (Mutual Exclusion)

20
New cards

A section of code that cannot be interrupted by the scheduler or other interrupts can be marked as a _____, enclosed by `taskENTER_CRITICAL()` and `taskEXIT_CRITICAL()`.

Critical Section

21
New cards

When converting an actor-based project to FreeRTOS, what are the FIFOs typically replaced with?

FreeRTOS queues.

22
New cards

In a FreeRTOS-aware HAL, what mechanism would you use to protect a shared peripheral like a stdio UART from being accessed by two tasks simultaneously?

A mutex.

23
New cards

What is a 'binary semaphore' in FreeRTOS and how does it differ from a mutex?

It's like a single-element queue that starts empty for signaling, but unlike a mutex, it does not support priority inheritance.

24
New cards

In a Data Flow Diagram (DFD) for an embedded system, what do rounded rectangles typically represent?

Actions or tasks that process data.

25
New cards

In a Data Flow Diagram (DFD) for an embedded system, what do square-cornered rectangles typically represent?

Objects, such as queues, that store data.

26
New cards

In the context of state machine diagrams, what are the three components of a transition label?

TRIGGER [CONDITION] / ACTIONS

27
New cards

What is the purpose of an 'exponential backoff' algorithm in a communications protocol?

To wait a random, exponentially increasing amount of time before retransmitting after a failure, reducing network collisions.

28
New cards

What is the primary purpose of a design process, involving tools like DFDs and state machine diagrams, before starting to code?

To create a 'map' or plan for what you should be doing, which helps manage complexity and reduce errors.

29
New cards

In embedded systems, tasks are often _____, meaning their response to an event changes depending on their current condition.

State Machines

30
New cards

Why is it important to select a resistor from an E-series (e.g., E12, E24) instead of just any calculated value?

Resistors are only manufactured at these standard E-series values, which are based on tolerance.

31
New cards

A resistor's ability to dissipate heat without being damaged is specified by its _____ rating.

power

32
New cards

In the non-ideal model of a capacitor, what does ESL stand for?

Equivalent Series Inductance.

33
New cards

In the non-ideal model of a capacitor, what does ESR stand for?

Equivalent Series Resistance.

34
New cards

What is the practical effect of a capacitor's Equivalent Series Inductance (ESL) at high frequencies?

It causes the capacitor to behave like an inductor, reducing its effectiveness as a capacitor.

35
New cards

Which type of capacitor, aluminum electrolytic or ceramic, typically has higher capacitance values and is used for 'bulk' storage?

Aluminum electrolytic.

36
New cards

Which type of capacitor, aluminum electrolytic or ceramic, has lower ESL and is better suited for high-frequency 'decoupling' applications?

Ceramic

37
New cards

Why must decoupling capacitors be placed physically close to the IC pins they are serving?

To minimize the parasitic inductance of the PCB traces, ensuring they can supply quick bursts of current effectively.

38
New cards

Which type of diode is specifically designed to be used in reverse bias to provide a stable reference voltage?

Zener diode.

39
New cards

Which type of diode is preferred for applications requiring fast switching and a low forward voltage drop?

Schottky diode.

40
New cards

When a MOSFET is used as a closed switch, it acts like a tiny resistor with a resistance value of _____.

RDS(on)​

41
New cards

The gate voltage required to just begin turning on a MOSFET is called the Gate Threshold Voltage, or _____.

VGS(th)​

42
New cards

When a BJT is used as a closed switch, it is operated in its _____ region.

Saturation

43
New cards

What is a 'Darlington Pair' configuration used for with BJTs?

It uses two BJTs together to achieve a much higher current gain, allowing a small base current to switch a large collector current.

44
New cards

What is the primary disadvantage of using a 'low-side switch' to power a component like a Raspberry Pi?

The voltage drop across the switch (RDS(on)​) raises the component's ground potential above the circuit's true ground, which can cause communication issues.

45
New cards

To control a high-side P-channel MOSFET switch with a lower voltage MCU pin (e.g., 3.3V control for a 5V circuit), what additional component is typically used as a driver?

A low-side N-channel MOSFET or NPN BJT.

46
New cards

What is the 'dropout voltage' of a linear regulator?

It is the minimum required voltage difference between the input and output for the regulator to maintain its specified output voltage.

47
New cards

How does a Low-Dropout (LDO) regulator achieve a much lower dropout voltage compared to a traditional linear regulator?

It uses a P-channel MOSFET (or PNP BJT) as a high-side pass element, which does not require a large gate-source voltage drop to turn on.

48
New cards

What is the main advantage of using differential signaling for data lines like USB's D+ and D-?

It provides noise immunity, as interference affects both lines equally and can be cancelled out by taking the voltage difference.

49
New cards

What is the specified differential characteristic impedance for USB 2.0 data lines?

90Ω

50
New cards

In the RP2040 hardware design guide, what value of series termination resistors are required on the USB_DP and USB_DM lines?

27Ω

51
New cards

When designing a PCB for high-speed signals like USB, what physical parameters of the traces determine their impedance?

The trace width, the spacing between traces, and the distance to the reference ground plane.

52
New cards

In KiCad, what feature is used to group the D+ and D- nets of a USB connection so they can be routed together with specific width and spacing rules?

A Net Class.

53
New cards

On a USB-C receptacle used for a USB 2.0 device, what components must be connected to the CC1 and CC2 pins?

Each pin must be connected to its own 5.1kΩ resistor to ground.

54
New cards

What is the primary function of the internal voltage regulator on the RP2040 microcontroller?

It generates the 1.1V for the digital core from the 3.3V I/O supply.

55
New cards

According to the RP2040 hardware design guide, what value decoupling capacitors must be placed close to the VREG_IN and VREG_OUT pins of the internal regulator?

1μF

56
New cards

The RP2040 microcontroller requires what type of external flash memory to store and execute program code?

Quad SPI (QSPI) flash memory.

57
New cards

On the RP2040, what is the function of pulling the QSPI_SS pin low during the boot sequence?

It forces the RP2040 into BOOTSEL mode, where it appears as a USB mass storage device for programming.

58
New cards

What is the recommended external crystal frequency for the RP2040 to ensure stable operation of peripherals like USB?

12MHz

59
New cards

What is the three-step general process for designing a PCB, regardless of the software used?

1. Schematic Capture, 2. Footprint Selection, 3. PCB Layout.

60
New cards

In KiCad, what tool is used to check for common schematic mistakes, such as an input power pin not being driven?

The Electrical Rules Checker (ERC).

61
New cards

What is the purpose of the 'PWR_FLAG' symbol in a KiCad schematic?

It explicitly tells the Electrical Rules Checker (ERC) that a specific net is a source of power.

62
New cards

In the RP2040 minimal design example, why is a 2-layer board less ideal for impedance control compared to a 4-layer board?

The greater distance to the ground plane on a 2-layer board requires much wider traces, which takes up more space and may not achieve the target impedance perfectly.

63
New cards

When designing a VGA output using a resistor DAC, the resistors are weighted to give different significance to each bit, typically in a ratio of _____.

1:2:4:8:16

64
New cards

What is the purpose of adding a ground plane to a 4-layer PCB design?

It improves power supply decoupling and provides low-impedance return paths for signals, reducing noise and electromagnetic emissions.

65
New cards

In the context of the Adafruit Feather RP2040's power path, what component prevents the USB VBUS from back-powering the battery?

A Schottky diode (D4) or the body diode of the P-channel MOSFET (Q3).

66
New cards

Term: Layered Design

An application design approach that uses progressively easier-to-use software modules built on top of each other to abstract hardware details.

67
New cards

What is a major benefit of modular design in embedded systems?

It massively reduces bugs and allows for code reuse by isolating modules from each other.

68
New cards

Term: Symmetric Multiprocessing (SMP)

An OS feature where the scheduler can start and stop tasks on multiple identical cores without special application code.

69
New cards

What happens if you reverse bias an aluminum electrolytic capacitor?

Internal chemistry produces gasses, which can lead to a 'pressure cooker' explosion.

70
New cards

In the KiCad calculator, what type of transmission line is used for two parallel traces on an outer layer over a ground plane?

Coupled Microstrip Line.

71
New cards

For a crystal to oscillate at its specified frequency, it requires a certain _____, which is achieved by placing capacitors on each side of it to ground.

load capacitance

72
New cards

What is the difference between a Cortex-M0+ and a Cortex-M7 MCU core?

The Cortex-M7 has more instructions (opcodes) for specialized tasks, such as digital signal processing, compared to the M0+

73
New cards

What are Open-Drain or Open-Collector outputs primarily used for, and what extra components do they require?

They are used to allow multiple devices to share a single line (bus). They connect the output to GND or leave it floating. Because they cannot actively pull the line high, they require pull-up resistors to VDD​ to set the logical high level (as seen in I2C and LiPo chargers)

74
New cards

What is the key feature of a Tri-State output?

A Tri-State output can connect to VDD​, GND, or enter a disconnected, High Impedance (High-Z) state, effectively functioning as an input when disconnected

75
New cards

What is the function of a Push-Pull output, and can it provide a logic HIGH?

A Push-Pull output can connect its pin to either VDD​ (logical high, sourcing current) or GND (logical low, sinking current)

76
New cards

Which communication protocol does NOT support multiple peripherals connected to the same bus (wires)?

UART (Universal Asynchronous Reception and Transmission), which is a simple one-to-one connection requiring two wires (TX/RX)

77
New cards

In Power Path design (using battery OR USB), how does a P-Channel MOSFET provide a low-loss connection when the battery is the sole power source?

When the battery is first attached, the MOSFET's internal body diode allows current flow, causing the source voltage to rise,,. This rise creates a negative VGS​ (since the gate is held at 0 V), which quickly drives the MOSFET past VGS(ON)​ to fully close the switch, resulting in current flowing through its low RDS(ON)​ with near-zero voltage drop

78
New cards

What is required if a system uses a Li-Ion battery but lacks a Battery Management IC?

The system must use a protected battery, which has built-in Integrated Circuits (ICs) to prevent over-charge, under-charge, and over-current faults,.

79
New cards

What are the key voltage limits for a single Li-Ion cell?

You must NEVER CHARGE MORE THAN 4.2 V and NEVER DISCHARGE BELOW 3.0 V.

80
New cards

What is the critical charging scheme required for Li-Ion batteries?

Li-Ion batteries must be charged using a two-stage process: constant current followed by constant voltage

81
New cards

What determines the output voltage of a switching power supply (DC-DC converter)?

The output voltage (VOUT​) is controlled by the switch's duty cycle (D), which dictates the ratio of time the switch is closed versus open

82
New cards

How do LDO (Low Dropout) regulators solve the high dropout problem?

LDOs use a high-side switch (like a P-Channel MOSFET) as the pass element. This switch style allows the regulator to achieve a very low dropout (e.g., 0.2V), leading to high efficiency (up to 94% for a 3.3V output)

83
New cards

Why do traditional linear regulators have a high dropout voltage?

Traditional linear regulators often rely on a pass element (like an NPN transistor or N-channel MOSFET) whose control voltage is limited by Vbatt​. This means that Vout​ must always be less than Vin​−VGS(on)​ (where VGS(on)​ is typically high, around 2 V), limiting efficiency when Vin​ and Vout​ are close,.

84
New cards

Define Dropout Voltage.

Dropout voltage is the minimum difference between the input voltage (Vin​) and the desired output voltage (Vout​) required for a voltage regulator to maintain regulation,.

85
New cards

Why is a two-transistor (BJT driving PMOS) driver circuit required when using a 3.3V microcontroller pin to control a 5V high-side switch?

A simple P-Channel MOSFET switch cannot be reliably turned completely OFF by a 3.3V control signal when operating from a 5V supply, because the Gate Threshold Voltage (VGS(th)​) specification indicates that VGS​ = 3.3V−5V=−1.7V might not be positive enough (less negative) to fully open the switch,,,. The BJT solves this by pulling the PMOS gate completely to ground (0V) to ensure VGS​=−5V, which guarantees the switch is closed

86
New cards

What is the critical reason for choosing High-Side Switching (connecting the switch to the positive power rail)?

High-side switching is necessary when the load component (like a Raspberry Pi) needs to be attached directly to ground (0 V) to ensure proper communication and function,,.

87
New cards

What is a Darlington Pair and when is it necessary?

A Darlington Pair consists of two BJTs connected in sequence to act as an internal amplifier, making the overall switch require much less base current (e.g., IB​>IC​/100 to IC​/1000). This is necessary when a microcontroller cannot supply the large IB​ required to saturate a single BJT for a given collector current

88
New cards

How does a designer confirm a BJT switch is fully ON (saturated)?

The Base Current (IB​) must be greater than the Collector Current (IC​) divided by 10 (typically): IB​>IC​/10

89
New cards

How does a designer confirm a MOSFET switch is fully ON (closed)?

The Gate-Source Voltage (VGS​) must be greater than the turn-on voltage (VGS(ON)​),,. When closed, the drain to source acts like a small resistor, RDS(ON)​

90
New cards

What type of diode is used to create a reference voltage?

Zener diodes are used in reverse bias where they get "stuck" at their breakdown voltage (VZ​), providing a fixed, predictable voltage reference

91
New cards

What type of diode is chosen when low forward voltage drops are required?

Schottky diodes are chosen because they have a smaller forward voltage drop (typically ~0.4 V) and are useful for fast switching and efficient power applications

92
New cards

Where must decoupling capacitors be placed on a PCB?

They must be placed immediately next to the pin that requires it

93
New cards

What property is crucial for a decoupling capacitor used to filter out very high frequencies?

It must have a low equivalent series inductance (ESL)

94
New cards

Why is a capacitor's value often not static (e.g., noted as "1 uF")?

The capacitance value changes with frequency and temperature

95
New cards

What are the key trade-offs between Ceramic and Aluminum Electrolytic capacitors?

Aluminum electrolytic capacitors typically have larger capacitance values, but also exhibit higher ESL (Equivalent Series Inductor) and ESR (Equivalent Series Resistor),,,. Ceramic capacitors have lower values but much lower ESL and ESR

96
New cards

Why would a designer choose a higher E-series resistor (e.g., E24)?

A higher E-series is chosen when the system specifically requires values resistors to achieve design performance

97
New cards

What are E-Series values and why are they used for resistors?

E-series values are standardized resistor, capacitor, and inductor values defined logarithmically to ensure that the percentage error is guaranteed to be within a specific tolerance, balancing tolerance and cost