Thank you UKHeliBob. That answers all the questions and solves all the problems but one. Where are the other two digital pins on the NANO?
Digital pins 0-13 is 14 pins and A0 to A5 are 6 pins for a total of 20. The spec lists the NANO as having 22 Digital pins. Where are the other two pins?
CrossRoads:
The crystal pins, not readily accessible on a Nano board.
Need a 328P that brings out all pins and runs on internal oscillator to access them.
Interesting. I would expect the specs for the boards to reflect the capability of the board not the processor. On that note I checked the UNO specs. The digital pin count there seems off too, in comparison to the NANO board. NANO lists 22, but only 20 are available. UNO lists 14 but 20 are available on the headers. the UNO uses the 328P and could be listed as 22, but since they are not on the headers I could see it specifying 20 instead.
Well that was a waste of $20 bucks. Guess back to plan B and use a external I2C I/O. A lot of space for 2 more pins. But it is what it is.
Please note the change I made to my answer: Nano has 2 extra analog input pins. They could be used to read digital inputs, comparing the reading to a low <= 0.9V or >= 3V for example.
Uno has 20 digital IO. A0 to A5 (D14 to D19) are marked on the board and can also do analogRead.
It does not have A6, A7, as the 328P DIP does not bring those pins out.
The 328P does support two extra IO pins if a crystal is not connected, not too many boards do not have a crystal or resonator connected tho. This requires different fuse settings also. (PB6, PB7)
There just seems to be combination of errors and inconsistancy in what pins are counted in the tech specs on the Arduino.cc website for the boards. UNO lists 14 (digital only) and the NANO lists 22 (digital and analog). I would expect the listing to be of the board (either 14 or 20) as that is what Arduino is selling, not of the Atmel chip (22 digital pins) as access to those is not available on the headers.