Go Down

Topic: Arduino nano V3 pins messed up (Read 9930 times) previous topic - next topic


Hi, I've bought an Arduino Nano V3 on ebay (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=281041059063&ssPageName=ADME:X:RTQ:US:1123)
and started to play with it - it works, but not as I expected.
Thing is, that I've connected led to A0 that according to this image should be pin 19:

and set it to high, but it would not light up, so I changed pin number in code until I've got led to light up - it was on pin 14. Also I've tried pin D10 -which should be pin 13. As long as pin 13 is connected to led on Arduino board, I was expecting to light up two leds - led on board and my connected led outside, but only led on board was shining.

So question is - is it possible, that there is some kind of alternative Arduino nano pinout and the Arduino board I've bought uses it did I something messed up/understand not correctly?


I believe the problem is only that you are confusing the physical pin number on the chip (19) with the assigned digitalWrite logical pin number for A0, which is correctly 14.



So is there any simple rule/diagram how to map logical pin to physical pin?


The pin assignment diagrams here are helpful:


You already worked out the only hard part, though: on a '328p arduino, the analog pin X is digital pin 14+X.



Actually there is a lot of room to get confused with on pin numbers/names.

There are the official arduino shield pin names, D0-D13, A0-A5 (D14-D19 also works) that you use
in your sketch code, no matter what kind of avr 328P based board you are using.

There are the Atmel AVR 328p chip physical pin numbers which are different depending on if you are talking
about the DIP package or one of the SMD packages.

Then there is the physical 30 pin package pin numbers that the Nano uses, which is different then any
of the other arduino 328P based boards. You don't use these nano package pin numbers directly in your sketch code,
you must use the standard Uno shield pin numbers/name, which are printed in white with the official arduino shield pin number/names.

By the way if you haven't seen this yet the Asians have come up with a nice 'mother board' for the nano package
the allows more ways to connect to pins and uses proper shield pin numbers/names on the silk-screening.



Go Up