You are here

ADC SAR High Detection Interrupt | Cypress Semiconductor

ADC SAR High Detection Interrupt

Summary: 1 Reply, Latest post by bobgoar on 01 Sep 2016 01:38 PM PDT
Verified Answers: 0
Last post
Log in to post new comments.
dv89_9_1490111's picture
43 posts

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:

    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;
    ADC1_SAR_RANGE_INTR_REG = windowFlag;               // Clear range detect status
    ADC1_SAR_INTR_REG = intr_status;                    // Clear handled interrupt 




user_242978793's picture
975 posts

Why not use a comparator instead.  Set the trigger just over the max voltage you are looking for.  Then it will fire and give you a digital signal.

Log in to post new comments.