Pages: [1]   Go Down
Author Topic: The Arduino has 14 Input/Output pins but how many are used by the board?  (Read 1955 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can't remember anymore, but i think pin 0 and 1 HAVE to be use only for for TX and RX. Are there any more pins that are restricted in some way like this? Or is there actually only 12 GPIO (plust the 6 Analogs) that i can use.


I am also only talking about the regular Arduino UNO (and possibly the arduino Pro)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino has D0-D13, and A0-A5 which are also D14-D19.
D0 & D1 can be used as regular data pins if you do not need UART/serial comms.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 19
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let me get this straight. You are saying that as long as i am not using D0 and D1 to communicated with the computer I can used them for other stuff?

Like Serial Prn?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
Serial.print goes out the Tx line (which is D0 or D1, I'd have to look).  You want to send serial data to something else?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50881
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Other pins have specific purposes. Pins 3, 5, 6, 9, 10, and 11 are PWM pins. There are several timers associated with those pins. Depending on what those timers are also doing, like driving servos, some of the pins may not be available for PWM purposes.

Pin 13 has a LED and resistor associated with that. Sometimes that resistor gets in the way of using that pin as an input pin. Pins 0 and 1 also have resistors associated with them that can cause problems using them for input when they are not being used for serial.

Pins 2 and 3 are the external interrupt pins. If you have hardware generating interrupts that the Arduino needs to process, one (or both) of those pins needs to be used,

Pins 10 through 13 are the SPI pins. They are used for communication with certain external hardware, such as the ethernet shield and SD card.

Analog pins 4 and 5 are the I2C pins. Again, used for communication with some external hardware, such as RTCs.

So, you can see that there are a lot of pins that serve more than one purpose. Choosing which pins to use for what purposes is not necessarily an easy task, if the Arduino needs to communicate with specific devices.
Logged

Pages: [1]   Go Up
Jump to: