why are some of the Digital and analogue I/O pins labeled for specific uses?
-
- Posts:6
- Joined:Thu Sep 03, 2015 4:51 am
i was under the impression that these pins with black plugs were all for general use. why, for instance, do we have SLC, SDA, tx, rx and so on? i dont understand their function. just a beginner here.
-
- Freetronics Staff
- Posts:853
- Joined:Tue Apr 09, 2013 11:19 pm
- Location:Melbourne, Australia
- Contact:
Re: why are some of the Digital and analogue I/O pins labeled for specific uses?
Hi,
The pins on the Arduino-compatible boards can have multiple uses at once.
- All of the pins can be used as digital I/O (to blink LEDs, read switches, etc.)
- The "analog" pins can also be used to read an analog voltage, 0-5V to 0-1023.
- Some other pins can be used for special functions as well. This is optional, you can use them as simple I/O instead. The special functions are just on those particular pins (for example [url=https://www.arduino.cc/en/Reference/SerialTX/RX are Hardware Serial], [url=https://www.arduino.cc/en/Reference/Wire SDA/SCL are i2c], etc.)
If you just want plain I/O then you can use any pin you like, but if you want to use one of those specific interfaces then you need to use the specific pin.
There is also "software" implementations of some digital protocols, where you can do i2c or Serial in "software" by just toggling the regular digital I/O pins, so you can use other pins. But the software implementations are usually slower and use more resources than the hardware ones.
Angus
The pins on the Arduino-compatible boards can have multiple uses at once.
- All of the pins can be used as digital I/O (to blink LEDs, read switches, etc.)
- The "analog" pins can also be used to read an analog voltage, 0-5V to 0-1023.
- Some other pins can be used for special functions as well. This is optional, you can use them as simple I/O instead. The special functions are just on those particular pins (for example [url=https://www.arduino.cc/en/Reference/SerialTX/RX are Hardware Serial], [url=https://www.arduino.cc/en/Reference/Wire SDA/SCL are i2c], etc.)
If you just want plain I/O then you can use any pin you like, but if you want to use one of those specific interfaces then you need to use the specific pin.
There is also "software" implementations of some digital protocols, where you can do i2c or Serial in "software" by just toggling the regular digital I/O pins, so you can use other pins. But the software implementations are usually slower and use more resources than the hardware ones.
Angus