questions/problems to analog conversion with app from Dave 4

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

cross mob
Not applicable
1580.attach1581.attach1582.attach

i have a question relatetd to the analog app in dave 4.
I have 3 analog inputs. But to read out the result I have to call in the main 3 times the same function.

I'm not able to select directly the chanel of my analog inputs.

Can you give me an feedback??

thanks a lot
0 Likes
5 Replies
Not applicable
Hi Thomas,

maybe you try:
ResultA = // Get result from ADC Channel A
XMC_VADC_GROUP_GetResult
(ADC_MEASUREMENT_Channel_A.group_handle,
ADC_MEASUREMENT_Channel_A.ch_handle->result_reg_number);

ResultB = // Get result from ADC Channel B
XMC_VADC_GROUP_GetResult
(ADC_MEASUREMENT_Channel_B.group_handle,
ADC_MEASUREMENT_Channel_B.ch_handle->result_reg_number);
Same for channel C.

Make sure that your conversion has been completed:

Kind regards
Kurt
0 Likes
Not applicable
HI,

In the ADC_MEASUREMENT APP, the measurement names for the analog inputs are Poti1, Poti2, Poti3.

You should be able to read results through the APIs.
result_potentiometer1 = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_Poti1);
result_potentiometer2 = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_Poti2);
result_potentiometer3 = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_Poti3);

Regards,
Daryl
0 Likes
Not applicable
i tried your solution. But this isn't working.

the name of my analog app is: "AnalaogInputs"
the name of the 3 channels are actually : CurrentOutput0, CurrentOutput1 and CurrentOutput1

when I use your solution like this: "CurrentOutputsHV[0] = ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT.CurrentOutput0);"
I can compile but I get an warning and it's now working on the target.
You can see the error message in the attachment.

hopefully you have a final solution for me ? Or I'm to stupid to understand you soltion?
I prefor your soltion in comparison of the answer from Kurt. Because I would like to use the app solution.


thanks a lot

Best Regards Thomas
0 Likes
Not applicable
can you also help me with this problem please??

which forum is the best for this issue? You moved also my other problem.

thanks
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
HI,

Since this is an DAVE APP related issue, I shifted this here to the DAVE Forum.

The analog-to-digital converter (ADC) in XMC1100 series provides a subset of functions compared to the feature-rich VADC (versatile analog-to-digital converter) which is
implemented in XMC1200 and XMC1300 series. The XMC1100 provides a series of analog input channels combined into two groups. Therefore, the solution I provided above cannot be easily used for XMC1100.

For this, we need to use the API: ADC_MEASUREMENT_GetDetailedResult(&ADC_MEASUREMENT_0). An example for how they can be used is provided in the example project attached. Let me know if it works for you.

Regards,
Daryl 🙂
0 Likes