Not applicable
Mar 16, 2015
03:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 16, 2015
03:41 AM
Is there a way to select a number of samples taken from the ADC and than take the average of the samples to get the final result, only using hardware.
So for Example; I only want to get a result from the ADC after he took 10 samples and averaged those.
It must be done with the hardware, so writing 10 result in an array and than taking the average isn't what I'm looking for.
BTW, I am working with the XMC4500
Thanks in advice
So for Example; I only want to get a result from the ADC after he took 10 samples and averaged those.
It must be done with the hardware, so writing 10 result in an array and than taking the average isn't what I'm looking for.
BTW, I am working with the XMC4500
Thanks in advice
8 Replies
Not applicable
Mar 17, 2015
12:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 17, 2015
12:54 AM
Hi,
I'm afraid it is not possible for your case (average 10 samples).
Best regards,
Sophia
I'm afraid it is not possible for your case (average 10 samples).
Best regards,
Sophia
Mar 17, 2015
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 17, 2015
01:51 AM
Just to note, as Sophia says, an average over 10 samples is not possible.
But there is an option to accumulate up to 4 samples.
You can find more details on this in the sub-chapter "Data Modification" of the ADC chapter in the XMC reference manual. As you can see there, apart from the "Data Reduction Mode" that describes the accumulation, it offers also a FIR, IIR and a difference mode.
But there is an option to accumulate up to 4 samples.
You can find more details on this in the sub-chapter "Data Modification" of the ADC chapter in the XMC reference manual. As you can see there, apart from the "Data Reduction Mode" that describes the accumulation, it offers also a FIR, IIR and a difference mode.
Not applicable
Mar 17, 2015
02:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 17, 2015
02:29 AM
Hi Sophia and AndreasG,
Thank for your reply. I used the Data Modification. Is it possible to only output the 4th result and than divide it by 4? Because now it gives me an output like Sample1, Sample1 + 2, sample 1+ 2 + 3, Sample 1 + 2 +3 + 4, sample 1,.. and so on. But I only want to get Sample 1+2+3+4. Do I have the change something in the program for that? Now I only changed kDataModification to 0x03.
Thanks in advice
Thank for your reply. I used the Data Modification. Is it possible to only output the 4th result and than divide it by 4? Because now it gives me an output like Sample1, Sample1 + 2, sample 1+ 2 + 3, Sample 1 + 2 +3 + 4, sample 1,.. and so on. But I only want to get Sample 1+2+3+4. Do I have the change something in the program for that? Now I only changed kDataModification to 0x03.
Thanks in advice
Not applicable
Mar 18, 2015
01:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 18, 2015
01:39 AM
Hi,
Yes, the result event can be generated only if the accumulation is complete. (refer to Chapter 19.8.5 Result Event Generation of "xmc4500_rm_v1.5_2014_07")
You can observe the effect using "ADC002_Example1":
Double-click ADCCH001 App to open the UI Editor --> Select "Accumulate 4 Results" for Data Modification in "Result configuration" tab --> Generate Code then Compile...
Do remember to do "Apps Migration" 1st (if the Apps are not latest) before doing editing of the Apps.
Best regards,
Sophia
Yes, the result event can be generated only if the accumulation is complete. (refer to Chapter 19.8.5 Result Event Generation of "xmc4500_rm_v1.5_2014_07")
You can observe the effect using "ADC002_Example1":
Double-click ADCCH001 App to open the UI Editor --> Select "Accumulate 4 Results" for Data Modification in "Result configuration" tab --> Generate Code then Compile...
Do remember to do "Apps Migration" 1st (if the Apps are not latest) before doing editing of the Apps.
Best regards,
Sophia
Not applicable
Mar 18, 2015
03:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 18, 2015
03:40 AM
Hi Sophia,
Thanks for the reply.This works. But are you sure that this only outputs the accumulating of the 4 results without give first an result of the sum of 1, 2 and 3 samples? Because this is the case in DAVE 4. In Dave3 it's seems that it is only the result of the accumulating of the 4 results (Like I want it) but I'm not 100% sure.
Thanks for your help!
Thanks for the reply.This works. But are you sure that this only outputs the accumulating of the 4 results without give first an result of the sum of 1, 2 and 3 samples? Because this is the case in DAVE 4. In Dave3 it's seems that it is only the result of the accumulating of the 4 results (Like I want it) but I'm not 100% sure.
Thanks for your help!
Not applicable
Mar 20, 2015
03:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 20, 2015
03:18 AM
Hi,
Are you referring to ADC_MEASUREMENT APP in DAVE v4?
Best regards,
Sophia
Are you referring to ADC_MEASUREMENT APP in DAVE v4?
Best regards,
Sophia
Not applicable
Mar 20, 2015
05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 20, 2015
05:33 AM
Yes I am
Thanks in advance
Thanks in advance
Not applicable
Mar 31, 2015
03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 31, 2015
03:33 AM
Hi,
I think you observe this (result of the sum of 1, 2 and 3 samples) in the debug mode? What you have observed is caused by the debugger.
You can use the following code to test (place the breakpoint at i=0). You could find that the result event is triggered at end of every 4th accumulation.
Sophia
I think you observe this (result of the sum of 1, 2 and 3 samples) in the debug mode? What you have observed is caused by the debugger.
You can use the following code to test (place the breakpoint at i=0). You could find that the result event is triggered at end of every 4th accumulation.
void Adc_ResultEvt_Handler(void)Best regards,
{
static uint16_t result[50];
static uint16_t i=0;
result=VADC_G0->RES[4] & VADC_G_RES_RESULT_Msk;
i++;
if(i==50)
{
i=0;
}
}
Sophia