VADC: Problem in converting multiple channels

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

cross mob
User11520
Level 2
Level 2
10 replies posted 10 questions asked 5 replies posted
Dear all,
I want to use the ADC_MEASUREMENT APP for converting 2 signals. I use the APP with these two measurements name: IFI and IFQ.
The code showed at the and of this post works fine. I am converting the two measurements but I am computing the value in Volt only for the first measurement, indeed the code concerning the second measurement:
//result_IFQ_Volt[idx] = (float32_t)(result_IFQ)*3.3/4095.f;
is commented (IFQ is the second measurement).
If I remove the comment, neither "result_IF_Volt" works! It seems that it has effect also on
result_IF = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_IFI_handle);
that in my opinion must remain unchanged.
Analyzing "result_IF_Volt" with Micrium uC/Probe XMC, I notice that, when I un-comment the commented code, the period T of the converted signal seems becoming twice but I don't understand why.
Please help me, I'm going crazy! 😞
Emanuele

XMC_VADC_RESULT_SIZE_t result_IF;
XMC_VADC_RESULT_SIZE_t result_IFQ;
static uint32_t idx = 0;

uint32_t i_temp2 = 0;

// Read out conversion results
result_IF = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_IFI_handle);
result_IFQ = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_IFQ_handle);
// Conversion to the real value
result_IF_Volt[idx] = (float32_t)(result_IF) *3.3/4095.f;
//result_IFQ_Volt[idx] = (float32_t)(result_IFQ)*3.3/4095.f;
0 Likes
0 Replies