You've probably noticed that when using the Analog to Digital converter, the numbers are NEVER stable. At best, the result will always be bouncing back and forth between two numbers.
While it's extremely annoying, there is a reason for it, and the number of times it bounces between those two numbers is actually indicating the values of more bits of resolution that are not included in the original 10-bit result.
This effect can be exploited to increase the effective number of bits in the result.
By taking a number of consecutive samples and averaging the results with a lower divisor, you can get up to 16-bit accuracy from that poor little 10-bit converter.
http://www.darreltaylor.com/DT_Analog/
An explanation of the Oversampling technique can be found on Wikipedia.
http://en.wikipedia.org/wiki/Oversampling
Re: PBP3 Optimization & Peripheral Control Techniques on PIC16F/18F Devices
Yes, all the time and most times in conjuction with DT-Ints for PBP context save/restore. For periodic/cyclic interrupts using TMR2 (or one of the same type) is nice because you set it up once and...
HenrikOlsson - 22nd May 2025, 15:27