Aug 13, 2021
07:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13, 2021
07:51 AM
Hi I am new to XMC microcontrollers. I have a problem in converting the analog signals using ADC app in XMC µc using DAVE IDE. I was able to convert for 1 input. But for multiple inputs it gives me wrong answer.
This is my program:
#include "DAVE.h" //Declarations from DAVE Code Generation (includes SFR declaration)
XMC_VADC_RESULT_SIZE_t result[2];
uint8_t cnt=0;
void Adc_Measurement_Handler()
{
result[cnt] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_0);
cnt = cnt+1;
if(cnt == 2)
{
cnt = 0;
}
}
int main(void)
{
DAVE_Init(); //(DAVE_STATUS_t)DIGITAL_IO_Init(&DIGITAL_IO_0) is called within DAVE_Init()
ADC_MEASUREMENT_StartConversion(&ADC_MEASUREMENT_0);
return (1);
}
when i read multiple signals, my output tends to get collapsed like the output for channel 1 is stored in result[1] instead of result[0] and likewise for the rest too. Kindly help me. I don't where my problem is
This is my program:
#include "DAVE.h" //Declarations from DAVE Code Generation (includes SFR declaration)
XMC_VADC_RESULT_SIZE_t result[2];
uint8_t cnt=0;
void Adc_Measurement_Handler()
{
result[cnt] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_0);
cnt = cnt+1;
if(cnt == 2)
{
cnt = 0;
}
}
int main(void)
{
DAVE_Init(); //(DAVE_STATUS_t)DIGITAL_IO_Init(&DIGITAL_IO_0) is called within DAVE_Init()
ADC_MEASUREMENT_StartConversion(&ADC_MEASUREMENT_0);
return (1);
}
when i read multiple signals, my output tends to get collapsed like the output for channel 1 is stored in result[1] instead of result[0] and likewise for the rest too. Kindly help me. I don't where my problem is
Solved! Go to Solution.
Labels
- Labels:
-
Technical Center
- Tags:
- IFX
1 Solution
Attachments are accessible only for community members.
May 26, 2022
12:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 26, 2022
12:42 PM
Hello Arunprasath_95
The XMC1100 only has a single ADC value return register. With each reading, it changes the channel you added in the dave App
I made an example for you to test in your Bootkit.
Use the Help APP there you will find a lot of information regarding the Peripheral you want to use.
1 Reply
Attachments are accessible only for community members.
May 26, 2022
12:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 26, 2022
12:42 PM
Hello Arunprasath_95
The XMC1100 only has a single ADC value return register. With each reading, it changes the channel you added in the dave App
I made an example for you to test in your Bootkit.
Use the Help APP there you will find a lot of information regarding the Peripheral you want to use.