Difficulty: Easy
Correct Answer: all of the above
Explanation:
Introduction / Context:
Microcontrollers and peripheral interfaces expose ports that connect the digital world to sensors, actuators, and other chips. The direction of data flow at a port pin depends on the hardware design and configuration registers controlled by software.
Given Data / Assumptions:
Concept / Approach:
Because real systems include all three port types (input-only, output-only, and bidirectional), the most complete answer is that a port can be any of these depending on device and configuration. Configuration registers (for example, DDR/ TRIS/ DIR) often control direction on a per-bit basis in microcontrollers.
Step-by-Step Solution:
Verification / Alternative check:
Datasheets for GPIO modules document input, output, and bidirectional settings, including pull-ups, pull-downs, and open-drain or push-pull modes.
Why Other Options Are Wrong:
Each single-direction option is incomplete; real devices support multiple configurations across different ports or pins.
Common Pitfalls:
Assuming all ports are symmetrical; some pins have alternate functions or electrical limits that restrict direction or drive strength.
Final Answer:
all of the above
Discussion & Comments