IRNAS / ppk2-api-python

Power Profiling Kit 2 unofficial python api.
http://irnas.eu
GNU General Public License v2.0
145 stars 37 forks source link

Incorrect measurements if output voltage is not set (self.current_vdd = 0) #12

Closed Stefanhg closed 2 years ago

Stefanhg commented 2 years ago

I've been debugging some issues where the device would measure incorrect results. Conclusion was that if the output voltage was not set the self.current_vdd is 0 and then the get_adc_results would return incorrect value(I assume) as it uses that for calculating the result

I am unsure how this affect the device when in ampere mode.

There should be a exception telling the user this as it is really confusing. I've added this to my function: if not self.current_vdd and self.mode == PPK2_Modes.SOURCE_MODE: raise Exception("Output voltage not set")