I am not quite sure that I understand what you are asking. If you visit the pyjoulescope_examples/bin directory, you will find examples using the joulescope package (which depends on pyjoulescope_driver) and using the pyjoulescope_driver package directly.
If you can explain what you want to do, perhaps I can help point out a suitable example?
I’m trying to figure out if is it possible to trigger a current capture by detecting GPI toggle from the Device Under Test. My bench is composed of a nucleo stm32wb (DUT), a host computer and a JS220. And by polling a GPO of the DUT board, I would like to start a current capture.
All of this to automate a power consumption test within python test framework. But I didn’t find any example showing this feature in script except using the UI.
Hi @Jordan - I normally recommend just recording all of the data for the entire test and then analyzing the JLS file. If something unexpected happens, you then have all the data to inspect.
You can use the pyjoulescope_driver record entry point from the command line, like this:
python -m pyjoulescope_driver record --signals i,0 out.jls
If you want to filter to only capture the data indicated by a GPI, see the trigger example with the --record option. This example uses the joulescope package which means it only supports GPI 0 and 1, and it does not support not 2, 3, and T.
In my case, I also would like to perform long term test in my test framework, so I assumed that it was better in some cases to perform capture only for specific capture windows to avoid any capacity issue.
Both approaches are useful for my usage. Thank you for your support and your advice, I will try both solutions!
If you are performing a long-term capture and do not need the full bandwidth, you can downsample. For example, provide the --frequency option to the record entry point.
For even lower data rates and longer captures, you can capture statistics. See downsample_logging for one example which customers have used to collect months of data.
Thanks to your advice I could manage what I wanted to do with the trigger.py script. (e.g. start on gpi falling edge and stop on gpi rising edge)
However, I have another question. Is there a minimum capture duration to be able to store capture into .jls file?
Because when I use a GPI to start capture and stop capture, when the duration between start condition and end condition is too short, I am not able to open the .jls file. As if it hasn’t performed the capture.
Hi @Jordan - I am not sure if there is a minimum duration. Samples arrive in chunks, if the GPI falling and rising edge are in the same chunk, it is possible that the other channels are not processed correctly. I am traveling, and I will take a closer look when I return tomorrow afternoon. In the meantime, can you share the JLS file you captured? If you would rather not post publically, you can DM me here or email support at joulescope dot com.