Hi Jerson,
Thanks for the quick reply.
I did the maths again for a 25.0 C reading and all looked good. The ADC result for a temperature of 25.0C is 50 and after summing 1000 measurements the result is less that 65535.
That's when it hit me - yesterday was a very hot day with temps over 35.0C. The ADC result for a temperature of 35.0C is 70 and summing 1000 measurements creates the overflow.
So simple! I don't know why the answer eluded me for so long
As mentioned in my previous posting, I was investigating alternate averaging routines and the moving average routine was the one I was looking to employ in this project. For now I will just back off the number of loops in the averaging routine to make sure no overflow occurs at temps up to 50C. I will look at modifying the routine using Darrel's DT_Analog with Hysteresis routine after Christmas.
My mind is at rest and I can pack away the straight jacket (for now at least...)
Cheers
Barry
VK2XBP
Bookmarks