Using Aref/Dac0 as I/O on MKR1000

I've been looking at the specs for a MKR1000. In my project I have no analog I/O but need plenty of digital.
In order to avoid using an I/O chip, I have been looking at the analog pins.

From the datasheet I can see that these are all PortA pins and as far as the hardware is concerned they may be used as GPIO.

I see from the schematic that Aref has 4u7F cap on it, so probably not good for switching:-) However I do have an input for a mode switch, but the data does make it clear whether these pins are Schmitt triggered, or at least whether they have issues with very slow rise times when configured as Digital inputs.

DAC0 would appear to have no problems from a hardware viewpoint.

But apart from the hardware, are their any issues with firmware or library functions? If configured as Digital I/O in an Arduino sketch can they be used normal enumerated digital pins (for example for use as a CS in a SPI based library).



I have used Arduino analog Pins as digital ones and never got any issue. So, I think you won't have any problem.

Disclaimer: no experience with the MKR family.

According to the SAMD21 datasheet (figure 22-2), the pins go directly to both the analog multiplexer and the digital IO. Further chapter 6.1 states

Each pin is by default controlled by the PORT as a general purpose I/O and alternatively it can be assigned to one of the peripheral functions A, B, C, D, E, F, G or H. To enable a peripheral function on a pin, the Peripheral Multiplexer Enable bit in the Pin Configuration register corresponding to that pin (PINCFGn.PMUXEN, n = 0-31) in the PORT must be written to one. The selection of peripheral function A to H is done by writing to the Peripheral Multiplexing Odd and Even bits in the Peripheral Multiplexing register (PMUXn.PMUXE/O) in the PORT.

So using analog pins as digital IO should not pose a problem.

Note that Aref is not an input or output.