- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
}
}
}
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some thoughts -
1) You have placed an ISR component, rising edge, on eoc output of DelSig ?
2) You started the ISR component ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see this in the revision notes at end of 3.0 datasheet -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Odd, in PSOC 5 TRM a discussion of EOC is present, buit not in the 5LP TRM.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your replies :).
They were a lot of help to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content