How can I use interrupt of ADC_DelSig at single sampling mode?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi Guys. I want to use ADC at single sampling mode(triggered by hardware soc input) and get the converted data by catching interrupt from ADC.

   

The datasheet tells me internal interrupt exists in ADC_DelSig, but I cannot get any converted result with the code as below.

   

Any help will be appreciated.

   

------------------------------------

   

#include <device.h>

   

#include <stdio.h>

   

 

   

uint16 result=0;

   

uint8 dataready=0;

   

 

   

CY_ISR(ADC_SAR_1_ISR)

   

{

   

        result = ADC_DelSig_1_GetResult16();

   

        result = ADC_DelSig_1_CountsTo_mVolts(result);

   

        dataready = 1u;

   

}

   

void main()

   

{

   

    CyGlobalIntEnable;

   

    LCD_Char_1_Start();

   

    ADC_DelSig_1_Start();

   

    ADC_DelSig_1_IRQ_Enable();       

   

    for(;;)

   

    {

   

        if(dataready!=0){

   

           dataready=0;

   

            LCD_Char_1_Position(1,0);       

   

            LCD_Char_1_PrintNumber(result);   

   

        }

   

    }

   

}

   
        
0 Likes
9 Replies