2 ms·
Think of each pin as a single I/O hose nozzle facing the outside world. Behind that nozzle(pin), inside the micro, there is a wall of function nozzles, each lab
by Workaccount2 2y ago
Think of each pin as a single I/O hose nozzle facing the outside world. Behind that nozzle(pin), inside the micro, there is a wall of function nozzles, each labeled with a different ability/function. This room with one nozzle on one wall, and an array on the other wall is called a "Port", these rooms, ports, are labeled Port A0,A1...B0,B1...etc.
It's on you to tell the micro which function nozzle in which port to connect to the I/O nozzle that goes to the outside world. You also need to tell it whether it needs to use an input or an output hose for the connection.
So you end up needing to write something like "Port C5, Connect ADC nozzle to I/O nozzle, use input hose." And now you can route outside signals into the pin and to the ADC module in the micro.(Note that the Arduino IDE does a lot of this for you, but underneath this is what is happening)
This is probably why you are getting hung up. The pins are multifunctional, and you need to define how they are used before using them.
Hope this helps clear some confusion!