XMC4500 ADC Result Variable

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

cross mob
Not applicable
I am new to Dave and Micro controllers, so forgive me if this is a dumb question. I am working with Dave3 (I know its not up to date but it is necessary for my project) and I am attempting to store an ADC value converted from an external
potentiometer into a variable such as "ADC_Result" in the MCU's C code. I have been working with the examples written by infineon, however they all seem to store the results in a variable that can only be accessed via the debug mode, and I need my variable to be accessible dynamically within the code, such that it may be used to change the frequency of an LED for example.

Let me know if you need screenshots of the code or APPs setup.

Thanks
0 Likes
1 Reply
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

It's never a dumb question here... everyone is learning n teaching one another.

First of all can you please upgrade your DAVE3 to DAVE4. Then use the below low level example as a start to understand the VADC.

http://www.infineonforums.com/threads/3373-XMC4000_HOT-How-to-do-VADC-Queue-source-synchronous-conve...

" however they all seem to store the results in a variable that can only be accessed via the debug mode, and I need my variable to be accessible dynamically within the code, such that it may be used to change the frequency of an LED for example."


The debugger is meant for you to monitor the variables and trace your software logic. You can make use of the VADC_Result variable to change the frequency of LED.

This is just an example:


if (Previous < VADC_Result)
{
// Increase LED Freq

}
else if (Previous > VADC_Result)
{
// Decrease LED Freq
}
Previous = VADC_Result;
0 Likes