user71398: 32-bit ARM-Based microcontroller SAM D21E / SAM D21G /SAM D21J
I have a Seeeduino XIAO PDF to schematic which uses a ATSAMD21G18-QFN48 chip. Pin D1 on the Seeeduino is pin 9 on the chip; which is labeled as PA4/EIC/REF/AIN4/SCOM0PAD0/TC0.

What would the REF pin be used for; and how would the pin be addressed in the code?
Based on this post is sound like it is ADC related.
There is no indication about this on the https://wiki.seeedstudio.com/Seeeduino-XIAO/ website. Only this image:


user31668: PA04 pin can be a normal GPIO or a voltage reference pin (similar to VDDANA). So, the ADC input will be compared to this VREF pin in the application if needed. If you have configured it as GPIO, then it will behave as a normal IO pin. It depends on how you configure it.




71398: <p>32-bit ARM-Based microcontroller SAM D21E / SAM D21G /SAM D21J</p>
<p>I have a Seeeduino XIAO <a href="https://files.seeedstudio.com/wiki/Seeeduino-XIAO/res/Seeeduino-XIAO-v1.0-SCH-191112.pdf" rel="nofollow noreferrer">PDF to schematic</a> which uses a <a href="http://ww1.microchip.com/downloads/en/devicedoc/40001884a.pdf" rel="nofollow noreferrer">ATSAMD21G18-QFN48</a> chip. Pin D1 on the Seeeduino is pin 9 on the chip; which is labeled as <code>PA4/EIC/REF/AIN4/SCOM0PAD0/TC0</code>.</p>
<p><a href="https://i.stack.imgur.com/iBtpy.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iBtpy.gif" alt="screenshot with highlighted pin in question" /></a></p>
<p>What would the <code>REF</code> pin be used for; and how would the pin be addressed in the code?</p>
<p>Based on <a href="https://arduino.stackexchange.com/a/24529/71398">this post</a> is sound like it is ADC related.</p>
<p>There is no indication about this on the <a href="https://wiki.seeedstudio.com/Seeeduino-XIAO/" rel="nofollow noreferrer">https://wiki.seeedstudio.com/Seeeduino-XIAO/</a> website. Only this image:
<a href="https://i.stack.imgur.com/yeuXO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yeuXO.jpg" alt="Seeeduino XIAO pin layout" /></a></p>
 31668: <p>PA04 pin can be a normal GPIO or a voltage reference pin (similar to VDDANA). So, the ADC input will be compared to this VREF pin in the application if needed. If you have configured it as GPIO, then it will behave as a normal IO pin. It depends on how you configure it.
<a href="https://i.stack.imgur.com/RyOkB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RyOkB.png" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/wuIvg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wuIvg.png" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/BKDiO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BKDiO.png" alt="enter image description here" /></a></p>
