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
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Some thoughts -

   

 

   

1) You have placed an ISR component, rising edge, on eoc output of DelSig ?

   

2) You started the ISR component ?

   

 

   

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

...and additionally:

   

CY_ISR_PROTO(YourHandler);

   

.

   

.

   

CY_ISR(YourHandler)

   

{

   

// Place your code here

   

}

   

 

   

isr_1_StartEx(YourHandler);  // Initialize and start interrupt handling

   

CyGlobalIntEnable; // Is that the correct name?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

According to the ADC_DelSig v2.30 datasheet, it says(bottom of page 3)

   

"The EOC for PSoC 5 is restricted in how it can be connected. The EOC terminal is not routable except to a single DMA component."

   

So, I think connect an interrupt component directly to eoc output is not a option since I'm using PSoC5 board.

0 Likes
Anonymous
Not applicable

 I have another question. Does single sampling mode ADC_DelSig's eoc output becomes HIGH after its conversion?

   

The datasheet says that ADC just 'halts' after conversion at single mode.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Rather difficult to answer PSoC5-related questions. I (and some of us) updatted to Creator 3.0 and the ADC_DelSig is versioned 3.0. I would suggest you to get your processor-module updated to a PSoC5 LP, there is a Cypress exchange program for this. Have a look here: www.cypress.com/

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I see this in the revision notes at end of 3.0 datasheet -

   

 

   

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Odd, in PSOC 5 TRM a discussion of EOC is present, buit not in the 5LP TRM.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Thank you for your replies :). 

   

They were a lot of help to me.

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Did you finally mange to read DelSig ADC value?   
0 Likes