Not applicable
Jul 10, 2016
11:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 10, 2016
11:55 PM
Hi, I'm new to XMC microcontroller.
I have a project and I need to read the data from 4 ADC-channels using XMC1100.
I use DAVE-app to create an ADC_MEASUREMENT_0, however when reading the data, the values seem to be wrong.
My code is as follow:
How can I read the correct data from the 4 ADC-Channels?
Thanks
Bien
I have a project and I need to read the data from 4 ADC-channels using XMC1100.
I use DAVE-app to create an ADC_MEASUREMENT_0, however when reading the data, the values seem to be wrong.
My code is as follow:
XMC_VADC_RESULT_SIZE_t result[4];
uint8_t cnt = 0;
void Adc_Measurement_Handler()
{
result[cnt] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_0);
cnt = cnt + 1;
if(cnt == 4){
cnt = 0;
}
}
int main(void)
{
DAVE_STATUS_t status;
status = DAVE_Init(); /* Initialization of DAVE Apps */
if(status == DAVE_STATUS_FAILURE)
{
XMC_DEBUG(("DAVE Apps initialization failed with status %d\n", status));
while(1U)
{
}
}
ADC_MEASUREMENT_StartConversion(&ADC_MEASUREMENT_0);
while(1U);
return 1;
}
How can I read the correct data from the 4 ADC-Channels?
Thanks
Bien
2 Replies
Not applicable
Jul 11, 2016
02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 11, 2016
02:47 AM
Sorry,
It's working now. My mistake.
Thanks
It's working now. My mistake.
Thanks
Sep 15, 2021
04:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 15, 2021
04:57 AM
bienle wrote:
Sorry,
It's working now. My mistake.
Thanks
Can you please explain me what was the problem?
I am not being able to do it as well.