Not applicable
Feb 12, 2014
11:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 12, 2014
11:20 PM
Hi, can anyone advise how to map a potential value using XMC1300 dave apps.
For example 5V. I would like to map it to value 0 to 100.
If my potential volue is 2.5V, my output value should gives 50.
I'm not sure do i need to use ADC?
Can i read my voltage value using IO001 [1.0.12] with the coding below?:
#include
int main(void)
{
bool Value = 0;
DAVE_Init(); // IO001_Init() is called within DAVE_Init()
Value = IO001_ReadPin(IO001_Handle0);
return 0;
}
I could not get any value with the coding above
For example 5V. I would like to map it to value 0 to 100.
If my potential volue is 2.5V, my output value should gives 50.
I'm not sure do i need to use ADC?
Can i read my voltage value using IO001 [1.0.12] with the coding below?:
#include
int main(void)
{
bool Value = 0;
DAVE_Init(); // IO001_Init() is called within DAVE_Init()
Value = IO001_ReadPin(IO001_Handle0);
return 0;
}
I could not get any value with the coding above
- Tags:
- IFX
3 Replies
Not applicable
Feb 13, 2014
12:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 13, 2014
12:41 AM
Hi,
You should use ADC00x Apps for your case. IO001 App is used by a top level App (eg. ADC00x) to configure a pin in Analog mode only. IO001_ReadPin() API just gives you a logic value.
BR,
Zain
You should use ADC00x Apps for your case. IO001 App is used by a top level App (eg. ADC00x) to configure a pin in Analog mode only. IO001_ReadPin() API just gives you a logic value.
BR,
Zain
Not applicable
Feb 13, 2014
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 13, 2014
01:51 AM
Hi Zain,
Yes you are correct. I can't use IO001_ReadPin().
However, i still couldn't get the output using ADC001.
Both the code below does not gives me result.
*****
int main(void)
{
status_t Status;
ADC001_ResultHandleType Result;
DAVE_Init();//ADC001_Init is called within DAVE_Init
//Get the result
Status =
ADC001_GetResult(
(ADC001_HandleType*)&ADC001_Handle0, &Result);
while(1);
return 0;
}
*****
int main(void)
{
uint32_t AdcResult;
DAVE_Init();//ADC001_Init is called within DAVE_Init
//Get the result
AdcResult = ADC001_GetFastResult((ADC001_HandleType*)&ADC001_Handle0);
while(1);
return 0;
}
Yes you are correct. I can't use IO001_ReadPin().
However, i still couldn't get the output using ADC001.
Both the code below does not gives me result.
*****
int main(void)
{
status_t Status;
ADC001_ResultHandleType Result;
DAVE_Init();//ADC001_Init is called within DAVE_Init
//Get the result
Status =
ADC001_GetResult(
(ADC001_HandleType*)&ADC001_Handle0, &Result);
while(1);
return 0;
}
*****
int main(void)
{
uint32_t AdcResult;
DAVE_Init();//ADC001_Init is called within DAVE_Init
//Get the result
AdcResult = ADC001_GetFastResult((ADC001_HandleType*)&ADC001_Handle0);
while(1);
return 0;
}
Not applicable
Feb 14, 2014
01:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 14, 2014
01:10 AM
Hi,
You may want to take a look at "ADC001_Example1_XMC13"?!
If you are not sure how to get this example project, you can refer to "DAVE TIP of the day: Where to get DAVE Example Projects".
BR,
Zain
You may want to take a look at "ADC001_Example1_XMC13"?!
If you are not sure how to get this example project, you can refer to "DAVE TIP of the day: Where to get DAVE Example Projects".
BR,
Zain