Help ADC

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

cross mob
Not applicable
hello..
can anyone kindly teach me step by step how to read the value ADC from a LDR?
I am very new to this, so I hope anyone can teach me step by step.. I am using MicroController XMC2GO
thanks alot!
0 Likes
4 Replies
Not applicable
Hi Squall,

I dont really get what you mean by 'LDR' but to read the ADC value, all you need to do is read the value from the result register, GLOBRES.RESULT
0 Likes
Not applicable
Hi Jackson.

Thanks for the reply Jackson. I appreciate it..

What i mean by LDR is Light Dependent Resistors, but it does not matter actually, the point is how to read adc value.

hmm.. where can i find the result register, GLOBRES.RESULT?

thanks before for ur explanation!

1123.attach
0 Likes
Eric1
Employee
Employee
Hi Squall,

you can use the App API (if you are using APPs), or direct register access:

uint16_t result=0;
result = VADC->GLOBRES & VADC_GLOBRES_RESULT_Msk;

In the debugger you can find it in the upper right.
select for Group: VADC

Then VADC.GLOBRES. Right bottom you will find RESULT: ...


Regards
Eric
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

You can find more information on how to use the ADC from here ..

http://www.infineonforums.com/threads/1812-XMC_HOT-XMC4500-How-to-do-ADC-Queue-source-conversion


1139.attach


1140.attach
0 Likes