Not applicable
Nov 05, 2013
12:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 05, 2013
12:18 AM
Hello,
i am new at uC programming. I get running blinking LEDs and PWM fast by watching the tutorials and the examples. But I don`t get a running program to read the Value of a NTC Sensor. I am using the XMC4500 Relax Lite Kit.
How can i convert the analog signal of a NTC Sensor at one input by a Button request?
I would like to:
1. Press a Button.
2. Start the first conversion and delete the result.
3. Start 3 conversions and store the values to get the median.
The follow Button-Interrupt is running:
-Which ADC-APP should i use?
-Which other Apps (ADC Result Interrupt) should I use?
-What is to be in the ERU_Handler (/Result_Handler)?
i am new at uC programming. I get running blinking LEDs and PWM fast by watching the tutorials and the examples. But I don`t get a running program to read the Value of a NTC Sensor. I am using the XMC4500 Relax Lite Kit.
How can i convert the analog signal of a NTC Sensor at one input by a Button request?
I would like to:
1. Press a Button.
2. Start the first conversion and delete the result.
3. Start 3 conversions and store the values to get the median.
The follow Button-Interrupt is running:
#include//Declarations from DAVE3 Code Generation (includes SFR declaration)
void ERU_Handler (void)
{
IO004_TogglePin(IO004_Handle0);
/*
* if (IO004_ReadPin(IO004_Handle0)) // manuelles Toggeln
* IO004_ResetPin(IO004_Handle0);
* else
* IO004_SetPin(IO004_Handle0);
*/
}
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
while(1)
{
}
return 0;
}
-Which ADC-APP should i use?
-Which other Apps (ADC Result Interrupt) should I use?
-What is to be in the ERU_Handler (/Result_Handler)?
6 Replies
Not applicable
Nov 06, 2013
01:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 06, 2013
01:22 AM
Hi Leif,
For ADC, you can use ADC002 and interrupt, use NVIC002.
rgds,
Rou
For ADC, you can use ADC002 and interrupt, use NVIC002.
rgds,
Rou
Not applicable
Nov 06, 2013
04:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 06, 2013
04:21 AM
Rou wrote:
Hi Leif,
For ADC, you can use ADC002 and interrupt, use NVIC002.
rgds,
Rou
I had already tried, but it wasn`t running.
I need a "step by step" instruction, what i have to add and how to connect.
Nov 06, 2013
09:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 06, 2013
09:50 PM
Hi Leif,
You can download the ADC example which will give you a better hint of what is happening. Beside this, you need to ensure you hook up your sensor to the correct port pins which you can check on the apps pins assignments.
G@@d Luck
Travis
You can download the ADC example which will give you a better hint of what is happening. Beside this, you need to ensure you hook up your sensor to the correct port pins which you can check on the apps pins assignments.
G@@d Luck
Travis
Not applicable
Nov 06, 2013
09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 06, 2013
09:57 PM
Leif wrote:
I had already tried, but it wasn`t running.
I need a "step by step" instruction, what i have to add and how to connect.
What is not running? The ADC not converting or the interrupt is not triggering?
Maybe you can be more specify on your issue.
rgds,
Rou
Not applicable
Nov 07, 2013
12:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 07, 2013
12:30 AM
Travis wrote:
Hi Leif,
You can download the ADC example which will give you a better hint of what is happening. Beside this, you need to ensure you hook up your sensor to the correct port pins which you can check on the apps pins assignments.
G@@d Luck
Travis
I had done. I was using pin 14.0 for the NTC.
What is not running? The ADC not converting or the interrupt is not triggering?
Maybe you can be more specify on your issue.
rgds,
Rou
I think the ADC wasn`t running succesful. Which ADC-App should i use for a single convert without background scanning?
My Main-File, the H/W Connection and the manuel pin assignment:
#include//Declarations from DAVE3 Code Generation (includes SFR declaration)
uint16_t Result = 0;
void BUTTON2_Handler (void);
void Result_Handler (void);
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
while(1)
{
}
return 0;
}
void BUTTON2_Handler (void)
{
ADC002_InitializeQueue(&ADC002_Handle0); // Start the conversion???
}
void Result_Handler (void)
{
ADCCH001_GetResult(&ADCCH001_Handle0, &Result);
ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
}
Not applicable
Nov 11, 2013
11:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 11, 2013
11:27 PM
This thread can be close and delete, i am getting self a running single adc...it`s pity, that the replies wasn`t helpful!