B. UART_SetBaudRate() should be called before UART_Init()
C. UART_Init() and UART_SetBaudRate() cannot be used together
D. No error, code is correct
Solution
Step 1: Check UART_Init() function usage
Typically, UART_Init() requires the baud rate as a parameter to configure communication speed.
Step 2: Analyze function calls order and necessity
Calling UART_SetBaudRate() separately is redundant if UART_Init() already sets baud rate; missing parameter causes error.
Final Answer:
UART_Init() needs baud rate parameter -> Option A
Quick Check:
UART_Init(baud) required [OK]
Hint: UART_Init usually needs baud rate parameter [OK]
Common Mistakes:
Calling UART_Init without parameters
Assuming baud rate can be set after init
Thinking both functions are always needed
5. You want to connect a sensor with only 3 pins to a microcontroller over a long distance. Why is serial communication preferred over parallel communication in this case?
hard
A. Because parallel communication is faster and better for long distances
B. Because serial communication uses fewer wires, reducing complexity and noise over long cables
C. Because serial communication requires more wires, which improves reliability
D. Because parallel communication can only send data bit by bit
Solution
Step 1: Consider wiring complexity for long distance
Long cables are prone to noise; fewer wires mean less interference and simpler connections.
Step 2: Compare serial and parallel communication
Serial sends data bit by bit using fewer wires, making it better for long distances and limited pins.
Step 3: Eliminate incorrect options
Parallel communication uses many wires and is not ideal for long distances; serial communication does not require more wires.
Final Answer:
Because serial communication uses fewer wires, reducing complexity and noise over long cables -> Option B
Quick Check:
Fewer wires = better for long distance [OK]
Hint: Fewer wires means less noise and simpler long-distance wiring [OK]
Common Mistakes:
Thinking parallel is better for long distances
Assuming serial needs more wires
Confusing bit by bit sending with parallel
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.