Porting some code to Giga, discovered a subtle issue with the Arduino PIN numbers on the analog inputs. The previous code that I inherited from a Uno used PIN numbers instead of name for the analog inputs, like 14 for A0, 15 for A1, etc.
This does not work on the Giga. Those PIN numbers identify additional serial port pins on the Giga, and if you try to perform an analogRead() on those pins, it crashes the board. Changing to the more standard A0, A1, etc., fixes the problem.
By the way, don't be confused by the Giga cheat sheet page, which claims there is an extra argument value to analogRead() only(?) for the Giga:
value = analogRead(pin, value);
This seems to be a typo. Also, you might be better off if you force the ADC resolution. Confusingly, the documents state that the default resolution on the Giga is 10 bits, but if you examine the preprocessor variable ADC_RESOLUTION you see 12 bits. I didn't take the time to test which is true, and just forced it to 16 bits thus removing the ambiguity.
// default ADC_RESOLUTION, 12 bits, is predefined by Arduino
// but Giga has ADCs that are 16-bit capable, needs to be set
#undef ADC_RESOLUTION
#define ADC_RESOLUTION (16)
static constexpr uint32_t ADC_MAX_COUNTS = (1 << ADC_RESOLUTION) - 1;
// configure the ADC for full 16-bit operation
analogReadResolution(ADC_RESOLUTION);
Serial.println(
"ADC nbits="+String(ADC_RESOLUTION) +
", max counts="+String(ADC_MAX_COUNTS) );


