Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
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:

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
0 Likes
2 Replies
Not applicable
Sorry,

It's working now. My mistake.
Thanks
0 Likes
User22557
Level 1
Level 1
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.
0 Likes