ADC External Reference
Brief
ADC conversion with External Reference Voltage
Details
This example demonstrates ADC (Analog-to-Digital Converter) conversion functionality with an external reference voltage.
Signal Routing: Analog signal input to ADC pin, External Reference Voltage (VREFHI): 2.5V or 3.3V
Test Cases:
Triggers all 4 sequencers on the ADC instance using software/API
Waits for ADC conversions to complete with a timeout mechanism to prevent indefinite blocking
Reads all SOC (Start of Conversion) results from the ADC and stores them in a local buffer
Validation:
Performs a pass/fail test by checking that all results are valid (not greater than 4095)
Prints conversion results to the console
Peripherals used
ADC
Instance : APP_ADC0
Sequencers : 4
SEQ1 :
SOCs : SOC0 to SOC3 - same channel for all
SEQ2 :
SOCs : SOC4 to SOC7 - same channel for all
SEQ3 :
SOCs : SOC8 to SOC11 - same channel for all
SEQ4 :
SOCs : SOC12 to SOC15 - same channel for all
Interrupts :
INT1 : Disabled
INT2 : Disabled
INT3 : Disabled
INT4 : Disabled
VREF
Reference : External
Mode : Full-scale (2.5V/3.3V)
External connections
Analog signal input and external reference voltage
Connect: BoosterPack header J3 pin 23 to Analog signal from an external source
Connect: BoosterPack header J16 pin 1 to external reference voltage (2.5V or 3.3V)
LED Details: PASS LED (LED5), FAIL LED (LED4)
Connect: HSEC PIN 21 (PA16) to Analog signal from an external source
Connect: HSEC PIN 45 to external reference voltage (2.5V or 3.3V)
Connect: HSEC PIN 43 to GND
LED Details: PASS LED (D4), FAIL LED (D3)