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

How to change the sample rate? #5

Closed luizmanke closed 2 years ago

luizmanke commented 3 years ago

Hi! Nice module!

I've been using the PPK2 and your python module to read the current from nRF52840. Now I want to change the sample rate of PPK2. How can I do it with your python module?

Here's an image of how it's done using the Power Profiler from nRF Connect v3.6.1 :

image

NejcKle commented 3 years ago

Hi @luizmanke!

I'm glad to hear you've been using this module! As far as we've discovered the sample rate cannot be changed and is set at 100k samples per second. The setting in the nRF Connect App appears to be averaging in a window for prettier data display.

We've implemented something similar here: https://github.com/IRNAS/ppk2-api-python/blob/ab39f6baaaf4d9af3c554611a14aac6d643d4602/power_profiler.py#L119-L126

wlgrd commented 3 years ago

As @NejcKle said, you cannot change the actual sample rate from the hardware, just do software averaging.

SloMusti commented 2 years ago

Closing this issue as there is nothing to fix.