Chapter 2 Flashcards

(38 cards)

1
Q

What is the first step to configure UART in STM32CubeIDE

A

Enable the UART peripheral in the .ioc file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which pins are commonly used for UART communication?

A

TX and RX

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you set the baud rate in STM32CubeIDE

A

Select the desired baud rate in the UART configuration tab.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What function is used to send data via UART using the STM32 HAL?

A

HAL_UART_Transmit()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What must be done before receiving data via UART?

A

Enable the receive interrupt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What function is used to receive data via UART using the STM32 HAL?

A

HAL_UART_Receive()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can UART data transmission be optimized in STM32CubeIDE?

A

By using DMA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of a parity bit in UART communication?

A

To detect single-bit errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does a UART frame error indicate?

A

The stop bit was not detected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you enable UART interrupts in STM32CubeIDE?

A

Enable the UART IRQ in the NVIC settings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the advantage of using Fast Mode (400 kHz) instead of Standard Mode (100 kHz) for I2C?

A

Increases communication speed with I2C devices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is it preferable to disable Clock Stretching (Clock No Stretch Mode = Disabled) in the I2C configuration of the STM32 microcontroller?

A

Prevents blocking if the slave is not
fast enough

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why choose a 7-bit primary address instead of 10-bit for I2C devices?

A

Most I2C devices use 7-bit addresses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is the Tlow/Thigh = 2 duty cycle ratio recommended for Fast Mode (400 kHz) I2C communication?

A

Increases signal stability and reduces communication errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why is it important to select the correct input channels (IN0, IN1, IN2) when configuring ADC1?

A

To avoid interference and ensure that the conversion matches the correct sensor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why divide the PCLK2 clock by 4 for ADC1?

A

To ensure that the sampling frequency
remains within the optimal range recommended by STMicroelectronics

17
Q

Why is the regular conversion set to be software-triggered rather than triggered externally?

A

Because this allows more flexible control over when the conversion happens

18
Q

Why use a 12-bit resolution for the ADC?

A

Because a higher resolution provides greater accuracy in analog signal conversion

19
Q

What is the first step to configure I2C in STM32CubeIDE?

A

Enable the I2C peripheral in .ioc file

20
Q

Which pins are used for I2C communication?

21
Q

What must be configured for an STM32 I2C peripheral to function correctly?

A

Ensure external pull-up resistors are present

22
Q

How do you configure the I2C clock speed in STM32CubeIDE?

A

By setting the I2C clock in the .ioc file

23
Q

What is the default addressing mode for I2C in STM32CubeIDE?

A

7-bit addressing

24
Q

What function is used to send data via I2C in STM32 HAL?

A

HAL_I2C_Master_Transmit()

25
What must be done before reading data from an I2C slave?
Send a START condition
26
What function is used to read data from an I2C slave in STM32 HAL?
HAL_I2C_Master_Receive()
27
What is the role of the ACK bit in I2C communication?
It is used to indicate a successful byte reception
28
How do you configure an STM32 as an I2C slave in STM32CubeIDE?
Set the slave address in the .ioc file
29
What is the resolution of an ADC?
The number of binary bits in ADC output
30
What is the quantization error in an ADC?
The difference between the actual and the closest digital representation
31
What is the function of an ADC sampling rate?
Determines how often an analog signal is converted into digital form
32
What is the advantage of a Successive Approximation Register (SAR) ADC?
Performs conversions quickly with moderate resolution
33
Which factor affects ADC sampling time?
The number of bits in the ADC
34
What is the purpose of the ADC analog watchdog?
Detects if the voltage input is outside predefined limits and generates an interrupt
35
What is the first step to configure an ADC in STM32CubeIDE?
Enable the ADC peripheral in the .ioc file
36
Which pin configuration mode is used for an ADC input in STM32CubeIDE?
Analog mode
37
What function is used to start an ADC conversion in STM32 HAL?
HAL_ADC_Start()
38
What must be configured to use ADC with DMA in STM32CubeIDE?
Enable ADC and DMA in .ioc, and link them