0

Using AREf as an analog input
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using AREf as an analog input

by Daviid4 on Mon May 21, 2018 10:33 am

Hello, i would like to know, is it possible to use the ARf pin on the Adafruit Feather M0 ATWINC1500(ATSAMD21G18) as an analog input like A0-A5 pins? If yes, how can i configure the pin as an analog input?
Thanks for any help
Regards
David

Daviid4
 
Posts: 2
Joined: Mon May 21, 2018 10:29 am

Re: Using AREf as an analog input

by adafruit_support_mike on Mon May 21, 2018 11:49 pm

The pin used for Aref has a multiplexer connection as an ADC input, but the code in the board support package doesn't allow it to be connected that way. You'd have to dig through the low-level code that configures the chip and defines functions like analogRead() and modify it to allow that kind of connection.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Re: Using AREf as an analog input

by Daviid4 on Wed May 23, 2018 4:37 am

Hi!
Thank you a lot for your answer. So i have to change the code in the board support package for the feather, or the low-level code on the chip? Also, do you have any examples for how this is done, or know how to change/modify the code(where to look, what to change, how to change it)?

Daviid4
 
Posts: 2
Joined: Mon May 21, 2018 10:29 am

Re: Using AREf as an analog input

by adafruit_support_mike on Thu May 24, 2018 12:17 am

You'd have to change the board support package.

The main information will be in the file variants/feather_m0/variant.cpp and you'll want to look at cores/ardino/wiring_analog.h and .c for reference on how the pin definitions are used.

adafruit_support_mike
 
Posts: 63059
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.