ttrftech / NanoVNA

Very Tiny Palmtop Vector Network Analyzer
1.06k stars 297 forks source link

first measurement point sometimes has wrong value #70

Closed qrp73 closed 4 years ago

qrp73 commented 4 years ago

There is strange bug. Sometimes the first measurement point has very high spike.

I found the following STR that allows to reproduce this spike with high probability:

1) power on 2) open CONFIG -> VERSION screen and wait 5-10 sec 3) tap on the center of screen to close version screen 4) note that first sweep has high spike at first measurement point

The same spike may happens when you use joystick to move cursor left or right.

Also it may happens during calibration, in such case calibration will be wrong for the low frequency.

edy555 commented 4 years ago

Thanks for your report on your observations. I have also realized this issue but not investigated it yet.

I wonder whether does your patch https://github.com/ttrftech/NanoVNA/commit/23dba7d9b4dce23889ec25e39c922cc9973daf82 make it better or not. Does it have any effect on this issue?

qrp73 commented 4 years ago

the patch make measurement very stable at frequency boundaries (300 MHz, 600 MHz, 900 MHz), it also make more stable first measurement point. But this issue with first measurement point still exists. There is also interesting observation - for some reason this issue affects first measurement point only.

I think something going wrong at i2s_end_callback. May be some race condition with wait_count, but I'm not sure. Needs to investigate it more deep.

qrp73 commented 4 years ago

fixed :)

edy555 commented 4 years ago

Modification that you pointed out is very helpful to fix. Thank you!