ADC Interrupt

Brief

Demonstrate ADC interrupts

Details

This example demonstrates three different interrupt mechanisms of the Analog to Digital Converter (ADC) module.

  • Normal Result Interrupt

    • Basic ADC conversion with result-ready interrupt

  • Early vs. Normal Interrupt Timing

    • Performance comparison between early and normal interrupts

  • Continue-to-Interrupt Mode

    • Continuous interrupt generation without flag clearing

Block diagram

Signal Routing:

  • Analog signal input -> ADC (APP_ADC0) –(3x interrupts)–> CPU

  • Analog signal input -> ADC (APP_ADC1) –(1x interrupt)–> CPU

Test Cases and Validation:

Section 1: Normal Result Interrupt

Demonstrates basic ADC interrupt functionality when a conversion completes:

  • The example triggers APP_ADC0 sequencer to force a conversion

  • Waits for a normal interrupt indicating conversion completion

  • Reads and logs the final ADC result

  • Uses interrupt handler to capture results

Section 2: Early vs. Normal Interrupt Timing Comparison

Measures and compares the latency between early interrupt generation and normal interrupt generation:

  • One ADC (APP_ADC1) generates an early interrupt before conversion completes

  • Other ADC (APP_ADC0) generates a normal interrupt after conversion completes

  • Measures cycle counts using timestamp counters to verify that the early interrupt arrives before the normal interrupt

  • Validates proper interrupt sequencing

Section 3: Continue-to-Interrupt Mode

Demonstrates continuous interrupt generation where the interrupt flag is NOT cleared:

  • Triggers sequential conversions

  • Counts interrupts

  • Verifies that all continue-interrupts are received

Peripherals used

ADC
  Instance  : APP_ADC0
     Sequencers  : 2
     SEQ1        :
       SOCs      : SOC0 - same channel as SOC1
     SEQ2        :
       SOCs      : SOC1 - same channel as SOC0
     Interrupts  :
       INT1      : Enabled
       INT2      : Enabled
       INT3      : Enabled. With Continuous mode

   Instance  : APP_ADC1
     Sequencers  : 1
     SEQ1        :
       SOCs      : SOC0 - different channel from APP_ADC0
     Interrupts  :
       Offset    : 2 (early interrupt)
       INT1      : Enabled
VREF
    Reference   : Internal
       Mode      : 3.3V range
SoC
    SYSCTL
       TBCLK     : Disabled. To be enabled in app

     INTERRUPTS
       Instance  : APP_ADC0_INT1_INT
         Source  : ADC0 INT1
         Handler : APP_ADC0_INT1_INT_Handler

       Instance  : APP_ADC0_INT2_INT
         Source  : ADC0 INT2
         Handler : APP_ADC0_INT2_INT_Handler

       Instance  : APP_ADC0_INT3_INT
         Source  : ADC0 INT3
         Handler : APP_ADC0_INT3_INT_Handler

       Instance  : APP_ADC1_INT1_INT
         Source  : ADC1 INT1
         Handler : APP_ADC1_INT1_INT_Handler

External connections

Analog signal input to ADC pin

  • Connect: BoosterPack header J3 pin 23 to Analog signal from an external source

LED Details: PASS LED (LED5), FAIL LED (LED4)