cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

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
Esteemed Contributor

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
Expert II

...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
Expert II

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
Esteemed Contributor

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

   

 

   

0 Likes
ETRO_SSN583
Esteemed Contributor

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
Honored Contributor II
        Did you finally mange to read DelSig ADC value?   
0 Likes