1 Reply Latest reply on Sep 1, 2016 1:38 PM by user_242978793

    ADC SAR High Detection Interrupt

    dv89_9_1490111

      Hello guys,

         

      I'm using the ADC SAR Seq on my PSOC 4100 series to detect a high current. I want the interrupt to trigger when the ADC senses a voltage above its limit. I don't want the interrupt to continuously trigger to check the ADC registers(which it's currently doing). Below is the interrupt routine:

         

      CY_ISR(ADC_LIMIT_ISR){
          
          uint32 intr_status;
          intr_status = ADC1_SAR_INTR_MASKED_REG;

         

          windowFlag = ADC1_SAR_RANGE_INTR_MASKED_REG;        // Read range interrupt status and raise the flag (High Limit)  
              
          if (windowFlag){
                  ADCMode = 1;
                  OutputsOFF();
          }
            
          ADC1_SAR_RANGE_INTR_REG = windowFlag;               // Clear range detect status
          ADC1_SAR_INTR_REG = intr_status;                    // Clear handled interrupt 
      }

         

      Thanks,

         

       

         

      Rick