Jul 29, 2016
03:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 29, 2016
03:36 AM
Hi everyone,
on my XMC4400, I have added an instance of the ADC_MEASUREMENT (v 4.1.20) app with 10 measurements. I selected the 10 bit fast conversion mode with 67ns sample time, I enabled continuous conversion and I chose to start the conversions after initialization.
The app initializes fine, returning success, but when I try to ask for a result (here for a DC current) by either calling
uint32_t result = ADC_MEASUREMENT_GetDetailedResult(&ADC_MEASUREMENT_I_DC_handle) & VADC_G_RES_RESULT_Msk;
or by calling
uint32_t result = (uint32_t)ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_I_DC_handle);
both routines will give me just a zero. For every of my 10 channels. Of course the actual voltage to be measured is NOT zero and of course I have assigned the right pins to the 10 channels.
When I change the app configuration parameter to 10-bit normal conversion mode instead, everything works just fine!!! Is there a bug in the app in the fast 10-bit mode, maybe something with the continuous conversion or the start after initialization?
It would be great to get some help! Thank you and kind regards
Niklas
on my XMC4400, I have added an instance of the ADC_MEASUREMENT (v 4.1.20) app with 10 measurements. I selected the 10 bit fast conversion mode with 67ns sample time, I enabled continuous conversion and I chose to start the conversions after initialization.
The app initializes fine, returning success, but when I try to ask for a result (here for a DC current) by either calling
uint32_t result = ADC_MEASUREMENT_GetDetailedResult(&ADC_MEASUREMENT_I_DC_handle) & VADC_G_RES_RESULT_Msk;
or by calling
uint32_t result = (uint32_t)ADC_MEASUREMENT_GetResult(&ADC_MEASUREMENT_I_DC_handle);
both routines will give me just a zero. For every of my 10 channels. Of course the actual voltage to be measured is NOT zero and of course I have assigned the right pins to the 10 channels.
When I change the app configuration parameter to 10-bit normal conversion mode instead, everything works just fine!!! Is there a bug in the app in the fast 10-bit mode, maybe something with the continuous conversion or the start after initialization?
It would be great to get some help! Thank you and kind regards
Niklas
2 Replies
Aug 02, 2016
04:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 02, 2016
04:15 AM
I really need some help regarding this issue... 😉
Not applicable
Aug 05, 2016
09:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 05, 2016
09:48 AM
Hi Niklas,
Fast conversion mode is only going to provide you with a flag in the result register - FCR. FCR stands for Fast Compare Result, and all it tells you is whether the sampled signal is above or below some selected bound. You can find more on how to choose a bound and how to define the hysteresis range in the reference manual. The bottom line of this is that Fast Compare mode does not provide a conversion result - instead it provides a comparison between the signal that the ADC pin sees and some reference value. The only way to get the conversion results is to enable normal conversion mode.
Hope that helps,
Andrey
Fast conversion mode is only going to provide you with a flag in the result register - FCR. FCR stands for Fast Compare Result, and all it tells you is whether the sampled signal is above or below some selected bound. You can find more on how to choose a bound and how to define the hysteresis range in the reference manual. The bottom line of this is that Fast Compare mode does not provide a conversion result - instead it provides a comparison between the signal that the ADC pin sees and some reference value. The only way to get the conversion results is to enable normal conversion mode.
Hope that helps,
Andrey