I'm looking a way extend the pin's ATMEGA328P-AU chip without using any other component like shift register (this will be my last solution).
My project will use the 23 IO pins available (in green) and i need at least 3 extra IO pins, So I have ADC7, AREF, ADC6, AVCC.
Where did you seen 32 "green" pins on the diagram?
This IC has 32 pins in total, including some pins, not available for using as GPIO: power(more than one), GND(also more than one), RESET, aref etc ATMEGA328 has 23 GPIO only
Hmm thanks for the clarification. @b707 this is a old project I have to go to the details in order better describe it... I will check later if I can optimize it. I know I use piezo buzzer, LDR, few sensor, motor, few led that need to be controlled individually.
If you use an ATmega328PB, you can get up to 27 IO lines.
A6 and A7 become fully usable as GPIO.
a pair of power pins become GPIO (compared to the non-B version.)
the XTAL pins can become GPIO if you use the internal oscillator.
RESET can become GPIO (not recommended!)
AREF is not repurposable on those chips.
You might want to look at ATmega4809 (as used in Nano Every) and the new AVRnnDy48 chips (which AFAICT have all the functionality of a 1284, but are much cheaper.
This is perfect. I don't think I will need more than 4 extra pin, but if needed I can try the multiplex technique in order to use multiple input from one pin like suggested LarryD.
Thanks!