I calculate the average of 16 number with the following code in a attiny24A. This code works fine in a atmega328.
The input voltage is constant so the average must be constant too, but the average drops to zero and I can't find out why.
I take a new sample (from a steady voltage) everytime the interrupt is executed. Than I just put SumV1 (the average value) to a PWM output. This goes to zero.
I don't think I use anything that is not possible inside the attiny24A.
Hopefully somebody can give me a clue.