Page 1 of 1

ADC "input scan" - adjacent pins only?

Posted: Tue Nov 08, 2016 8:42 pm
by riz-calliope
Our product is based around the ATSAMW25, which has a SAMD21G core, and we've been successfully using PA04 configured as AIN[4] to read the voltage of our battery. Now we're realizing we'd like to be checking the internal temperature sensor (ADC_POSITIVE_INPUT_TEMP) as well. Looking at the documentation for the input scan mode for the ADC, it seems like we can only scan multiple _adjacent_ inputs; According to the datasheet, for MUXPOS, AIN[4] is 0x04 and TEMP is 0x18, so it seems like I can't use the input scan (at least not easily).

Is my best bet here to completely reconfigure the ADC every time I want to read from our battery vs. the internal temp sensor? Am I missing something obvious? We're mostly using ASF, though I'm in the process of slowly moving off ASF to direct register-twiddling for some stuff for code space and speed reasons.

A whack with the cluebat would be appreciated!