I wrote code in C for communication between AD5933 and AVR Atmega 128 (please see attachemt).
After mcu and lcd initialization, calibrating is performing with known impedance of 22 kOhms as Z while Rfb is 20 kOhms. With that parameters the Gain factor is calculated and in next steps I am performing only measuring with GF correction. After calibrating I kept 22 kOhms in Z holder and measuring is correct (approximately 22000.65 Ohms) but after that if I change Z (in range 15-50 kOhms) all results are very close to 22 kOhms. If I completely remove Z (open circuit), the measuring is ok with results in order of MOhms. Do you have any suggestion what is wrong with my code? All functions, except for LCD are written in ANSI C so I believe that there is no problem with syntax because I used micro C compiler.
I downloaded “AD5933 theoretical” and ADC is not saturated and impedance range is ok.