- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using PSOC4 SAR ADC sequencer block and I don't understand how the two averaging modes (accumulate vs fixed resolution) work.
What I'm trying to do is to oversample a channel 16x and increase the effective number of bits by 2 (from 12-bit to 14-bit). I understand there are assumptions about the white noise distribution but let's assume all those things for this discussion. What I have discovered is that if I use the fixed resolution averaging mode, the result after oversampling 16x is still a 12-bit number. What I would like is to get a 14-bit number to work with after all the accumulate and decimate actions in the ADC block.
I know I can write an ISR to do the accumulate and bit shifting in software but that will oversample all channels.
Is there an elegant solution to what I'm trying to achieve here using the built-in ADC block? I noticed that the averaging mode has an accumulate option. What should I expect from this option? Is the end result already averaged or simply accumulated? What software processing is required to convert the result under accumulate option to the 14-bit number I want?
Thanks in advance,
John
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Tags:
- adc sar seq
- psoc4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For people reading this in the future, there are basically two ways.
If you want to use the fixed resolution method, you need to change the AVG_SHIFT value in the ADC header file. By default, this bit is going to give you a fixed resolution value at the end. You can tweak this value manually so as to achieve higher number of bits on the output.
Another way is to use the accumulate averaging method. In this mode, the bits are simply accumulated. In the counts_to_mV/uV() function, the total count is divided by the number of times you accumulated. Again, you can change this number or a better way is to have your own implementation of this function in your source file to achieve the desired functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
About the different of accumulate vs fixed average mode, you can refer below figure. You can try to try to use 256 Fixed avg mode to get a 16-bit result and then only take the MSB 14 bits as final result. Over sample can get a higher resolution but i don't think its performance is very good, just LIKE A REAL 14 bit ADC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For people reading this in the future, there are basically two ways.
If you want to use the fixed resolution method, you need to change the AVG_SHIFT value in the ADC header file. By default, this bit is going to give you a fixed resolution value at the end. You can tweak this value manually so as to achieve higher number of bits on the output.
Another way is to use the accumulate averaging method. In this mode, the bits are simply accumulated. In the counts_to_mV/uV() function, the total count is divided by the number of times you accumulated. Again, you can change this number or a better way is to have your own implementation of this function in your source file to achieve the desired functionality.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for sharing the good experience.