Hi all, I'm reading the datasheet for atmega164PA and I can't 100% figure out which pin is digital I/O. Any specific phrase indicating it? Sorry I can't upload the datasheet due to the file size.
All the ones with the blue numbers next to them - that's the digital pin number, aka, arduino pin number, the one you'd pass to digitalRead() and the like.
The ones with a blue number and an An name (where n is a number, ex A0, A1, etc) ALSO can be used with analogRead(), as they are connected to one of the ADC inputs. (all analog inputs can also do all the usual digital I/O stuff - except for A6 and A7, which are available only on the surface mount version of the atmega328/328p.
The port and bit within that port are shown in green, for example PA0, PC3, PD2 - respectively are PORTA, bit 0, PORTC, bit 3, and PORTD, bit 2. That's how they're organized internally - Arduino provides a friendlier interface than the native one that is used to control the pins "under the hood" - however I just checked and the current version of MCUDude's cores have picked up on the convention I've been pushing of having PIN_Pxn defined as the arduino pin number for that pin - on the chart, PC3 is pin 19. PIN_PC3 is thus defined to 19, so you can do digitalRead(PIN_PC3) and it will work just like digitalRead(19) - It's particularly useful when you're using some part that several people have made cores for, and each thought their way of numbering pins was the right way, or when you're using resources like the datasheet that use PORT pin numbers rather than Arduino pin numbers, or when people on the forums are mixing together physical pin numbers (the little black numbers right next to the chip, referring to the physical location of the pin, not what it does) and Arduino pin numbers, leading to nobody knowing which pin others are talking about...
I think those are the only two analog pins in Atmel/Microchip's entire AVR product line that can't do digital I/O too (it's a historical happenstance that led to it - it was initially in DIP-28 - eventually their customers demanded SMD packages, so they released in TQFP-32. Meaning they had two extra pins; at that point for whatever reason, they also happened to have extra channels available on the ADC mux (likely from a die-shrink or silicon revision after the initial release - so while they couldn't add output drivers, it was essentially zero cost for them to connect a pair of the new pins to those unused ADC channels. but it sure does make it confusing trying to explain to new arduino people - who always get confused by how Arduino material presents the "analog pins", when the most popular processor also happens to have the only two wacky analog-only pins
Thanks alot for the reply! I'll digest it. =)
Look at the MightyCore addition for the IDE as well
to support all the features of the '164.