- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
After Init, at some point I need to change the 'Samples Averaged' of the ADC_SAR_Seq.
What is the correct flow to do that?
This is how the component initialized in PSOC creator:
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
SAR_SAMPLE_CTRL register in the ADC related registers has bitfield SAR_AVG_CNT which takes care of the average sampling.Averaging Count for channels that have over sampling enabled (AVG_EN). A channel will be sampled back to back (1<<(AVG_CNT+1)) = [2..256] times before the result is stored and the next enabled channel is sampled (1st order accumulate and dump filter). If shifting is not enabled (AVG_SHIFT=0) then the result is forced to shift right so that is fits in 16 bits, so right shift is done by max(0,AVG_CNT-3). SAR_AVG_SHIFT is then used to make sure whether the bits are shifted to fit the resolution. SAR_CHAN_CONFIG bit for each channel will have a SAR_AVG_EN bit before initializing the channel. Ideally these needs be enabled and before re-enabling the ADC and starting the conversion.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
SAR_SAMPLE_CTRL register in the ADC related registers has bitfield SAR_AVG_CNT which takes care of the average sampling.Averaging Count for channels that have over sampling enabled (AVG_EN). A channel will be sampled back to back (1<<(AVG_CNT+1)) = [2..256] times before the result is stored and the next enabled channel is sampled (1st order accumulate and dump filter). If shifting is not enabled (AVG_SHIFT=0) then the result is forced to shift right so that is fits in 16 bits, so right shift is done by max(0,AVG_CNT-3). SAR_AVG_SHIFT is then used to make sure whether the bits are shifted to fit the resolution. SAR_CHAN_CONFIG bit for each channel will have a SAR_AVG_EN bit before initializing the channel. Ideally these needs be enabled and before re-enabling the ADC and starting the conversion.
Best Regards,
Vasanth