Digital Output on Analog Pins with DAC enabled

I'm working on a board based on the atmega328 and need access to >14 digital outputs +4 analog inputs. I know that the analog inputs can be used as GPIO if the DAC is not enabled: would this work if I am using analog inputs? Thanks in advance for your help!

There are in total 20 (8 of Port-D, 6 of Port-C and 6 of Port-B) IO lines of which DPin-0 and DPin-1 are reserved for UART, A0 - A3 are reserved for you as analog lines. Now, there are 14 left which you may use as GPIO lines. If you want more IO lines, you may use port extender.

I am not sure which part you have but none of the ones I have contain a DAC (Digital Analog Converter), they contain an A/D converter. A port expander, shift register etc will do what you need. The best advice I can give is Get the Arduino cookbook by Michael Margolis and read it. You will find on line many videos etc showing the Arduino and how to do use it some of it may be what you want. This additional information will go a long way in getting your problem solved. There are also many videos showing how to read a data sheet. Once you get past this you then need to select your sensors and actuators. At that point you start on the hardware design and write your software.

usussman:
I'm working on a board based on the atmega328 and need access to >14 digital outputs +4 analog inputs. I know that the analog inputs can be used as GPIO if the DAC is not enabled: would this work if I am using analog inputs? Thanks in advance for your help!

There are 20 pins on the Uno, D0..D13, A0..A5. Two of those (D0, D1) are for serial I/O and problematical
for other uses, leaving 18 pins.

The surface-mount version of the 328 has two extra analog-only input pins, A6,A7.

The ADC is always available, and can only be reading a single pin at a time, from the set A0..A7.

Pins A0..A5 can be used for digital uses at any time, whether or not they are connected to the ADC from
the last call to analogRead().

The 328 has no DAC.

If running out of pins I'd first be looking into a digital output port expander - depending on your requirements options include I2C port expanders such as the PCF8574/5, MCP23008/17, and shift registers such as the 75HC595.

I2C is A4/A5, so that leaves you with six analog inputs (A0-A3, A6, A7). If you use a shift register you can use other digital pins, and you have 8 analog inputs available.