Are those 2 extra pins fully functional or are they multiplexed through other ADC pins? Something I want to do needs 22 IO pins and the 28 pin DIP version has only 20 usable IO pins.
If using A6 and A7 is going to bump into problem, can anyone suggest next AVR that isn't as big as 324/644/1284?
You can use these pins as analog input only. No internal pull up resistors. No digital read. Of course, however, you can always simulate digital read with analog read. These pins are broken out on the Nano and most Mini clones.
Ok thanks. Guess I'll move onto 44 pin TQFP for 164/324/644/1284 since it has more than enough digital pins. My project will end up about 1/2 in by 1/2 in bigger due to larger IC.
Or you could move to 328PB - that one has proper pin drivers on those pins. And IIRC it has 2 more pins too (they replaced a Vcc/Gnd pair), and more features.
I think Minicore supports it, though there are still some complications...
DrAzzy:
Or you could move to 328PB - that one has proper pin drivers on those pins. And IIRC it has 2 more pins too (they replaced a Vcc/Gnd pair), and more features.
I think Minicore supports it, though there are still some complications...
328pb is about 70 cents cheaper on Digikey and if I don't need physical pin 3 or 6 I could leave them connected to VCC and GND as input so my PCB can have either 328p and 328pb
I think you'll be pretty happy using MiniCore with ATmega328PB. There were initially some issues with Arduino's beta version of the AVR toolchain that adds support for the PB chips but things seem to have settled down now. It does add a couple extra steps to the MiniCore installation process but that's just installing another hardware package via Boards Manager so it's easy enough.
Of course I'm also a big fan of ATmega1284P and family but if you only need the two extra pins that might not be the best choice for your application.
And, in desperation, I believe the reset pin can also be used as GPIO pin. However, unless you are doing something in industrial quantities, the effort is not worth it.
Thanks all! Will be using minicore and getting 4 extra pins, A6 and 7 as well as the 2 XTAL pins: internal 8MHz is good enough since I am not using USB or serial communication in final project and it's not time sensitive. I am leaving reset pin alone because I may still need it if I need to do a bug fix and reprogram the chip.
wilykat:
Thanks all! Will be using minicore and getting 4 extra pins, A6 and 7 as well as the 2 XTAL pins: internal 8MHz is good enough since I am not using USB or serial communication in final project and it's not time sensitive. I am leaving reset pin alone because I may still need it if I need to do a bug fix and reprogram the chip.
There is no combination of parts and settings with minicore that will do that.
If you use the 328pb, A6 and A7 become fully functional pins and you get 2 more pins on top of that - plus the xtal pins if you use internal oscillator. (ie, this gets you 6 extra pins, counting the xtal pins)
If you use the 328p, A6 and A7 are analog input only, but you can still get the xtal pins if you use internal oscillator.
I suspect you understand this, but figured I should mention it
I am leaving reset pin alone because I may still need it if I need to do a bug fix and reprogram the chip.
You recover the original function of the reset pin using a high voltage programmer, but this process makes development more cumbersome and is best avoided by moving a to MCU with more pins.
6v6gt:
You recover the original function of the reset pin using a high voltage programmer, but this process makes development more cumbersome and is best avoided by moving a to MCU with more pins.
More work plus I don't have HV programmer to reprogram MCU back to original function. I've used AVR and Arduino for some years and I've managed to not need one, just either generic USB to serial adapter or ISP programmer.