SAR ADC Averaging Mode: Possible to create higher resolution results?

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

cross mob
JoZh_4299466
Level 1
Level 1

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

0 Likes
1 Solution
JoZh_4299466
Level 1
Level 1

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.

View solution in original post

0 Likes
4 Replies
Roy_Liu
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 10 questions asked

VisonZ_71

Roy Liu
0 Likes
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

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

1.JPG

2.JPG

0 Likes
JoZh_4299466
Level 1
Level 1

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.

0 Likes
Roy_Liu
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 10 questions asked

Thanks for sharing the good experience.

Roy Liu
0 Likes