I would be very grateful if you could give some idea where you think the issue is with the K-firmware that I see.
Am I on the right path with trying to adjust "FAKTOR_ESR" or was there some other much more imprtant thing you had to change?
"FAKTOR_ESR" Only works for 20nF - 200nF capacitors. For electrolytic capacitors, I changed a few places. But I consider myself understanding enough in Assembler to lecture Karl-Heinz. Who does not fit my firmware, do not use. I can't help anymore.
I can understand that you are tired of me Yuriy_K but I really like your dedication!
I used the latest GIT version with only this code replacing
line 832:
#if (PROCESSOR_TYP == 644) || (PROCESSOR_TYP == 1280)
#define FULL_PULSE_LENGTH_TICS ((HALF_PULSE_LENGTH_TICS*2) - 1)
#else
#define FULL_PULSE_LENGTH_TICS ((HALF_PULSE_LENGTH_TICS*2)+(MHZ_CPU/14))
#endif
With this change I have the following result:
GM328R 20MHz: Hiland644-1*: Hiland644-2*: Hiland644-3*: Hiland644-4*
20mΩ resistor: 0.01Ω 0.00Ω 0.15Ω 0.01Ω 0.03Ω
50mΩ resistor: 0.04Ω 0.03Ω 0.19Ω 0.05Ω 0.06Ω
47nF film cap: 46nF 0.50Ω 46.0nF 0.00Ω 46.1nF 1.10Ω 46.1nF 0.23Ω 47.1nF 12.0Ω
330nF film cap: 319.2nF 0.10Ω 316.7nF 0.00Ω 317.4nF 0.23Ω 316.3nF 0.12Ω 324.7nF 1.74Ω
2200µF lytic (KMG): 2326µF 0.10Ω 2327µF 0.07Ω 2229µF 0.28Ω 2470µF 0.08Ω 2294 0.11Ω
1000µF polymer (PSG): 980µF 0.02Ω 980µF 0.04Ω 942µF 0.13Ω 1044µF 0.05Ω 960µF 0.01Ω
Hiland644-1*= Latest GIT release, no changes (
unable to read ESR of small caps).
Hiland644-2*= Latest GIT release, changed GetESR.S according to code above. (
reads small caps but with a bit high ESR, same for resistors)
Hiland644-3*= Latest GIT release, same as Hiland644-2 but also changed FAKTOR_ESR on line
578 to: 550000
(reads pretty good!).
Hiland644-4*= M-firmware 1.48m-beta (added by edit later for comparison).
But I don't understand the purpose of the original code:
#define FULL_PULSE_LENGTH_TICS ((HALF_PULSE_LENGTH_TICS*2)+(MHZ_CPU/14))
I checked the source and "MHZ_CPU" is defined as the frequency in Hz divided by a million, so it is for example "8" with 8MHz CPU.
"HALF_PULSE_LENGTH_TICS" is defined a very similar way.
What I don't get is why it is then divided by the frequency of the CPU by the number 14?
And in your changed version in my example code above this is instead "-1" if the CPU is Atmega644, but why?