I really like the trigger feature in the UI! A use case we currently have is trying to log how long a DUT takes to go into a higher-than-desired current draw state. I can see that I would use the trigger start condition to be Type=duration, Signal=current, Condition: > n mA, Duration = t seconds. What I would like is to run that in continuous mode.
The part I don’t currently see a way to do is:
- Log somewhere (.csv?) how long since the trigger entered searching mode.
- Cycle the power supply to the DUT (possibly a user-defined number of seconds turned off, in case internal charges need to dissipate to a certain level).
- Bonus if it can set the timestamp for the entry to searching mode as the time when power is reapplied.
The application I would like to use this for is when we have a device which is getting stuck in a high power mode (or could be used to capture something not waking from sleep with a < condition) and whether that is linked to runtime (perhaps an overflow or out-of-bounds value for a variable which increments). With this ability, the DUT can be left under the watchful ADCs of Joulescope without the need for monitoring and as these events can be slow to acquire, it would save effort of monitoring the GP output pin etc. Because the power cycle would be automated, potentially several more tests can be run outside office hours.
I realise this can probably be done through the python API. My python-fu is weak but I would be happy to try my first Joulescope python script if I can get some hints how to go about achieving the first two points above.
Hi @simonmerrett - I am not sure that the UI is up to this, at least without some modifications. You may be able to hack it. The UTC times can show up in the Statistics recordings. You can also toggle a JS220 GPIO. However, you would likely need external hardware to interpret an edge as “cycle power” since the Joulescope UI can only set the value (not toggle or perfom arbitrary patterns) on trigger Start and Stop.
To get the UTC time in the Trigger widget, select Record statistics under Start Actions. Then press Config and change Time Format to UTC. The first entry will be when the trigger happened, and the last entry will be when the trigger starts waiting for the next event. You can subtract the UTC time for the first entry from the previous CSV file’s last entry to know how long it was in trigger search mode. Did I mention that this is a hack
You can certainly do this in Python. See the trigger_host_pyjoulescope_driver example, which is pretty close to what you want. You can modify lines 130 - 145 to take whatever actions you want on the trigger detection which includes printing / logging UTC time and cycling the power supply. What do you think?
1 Like
Thanks - I have had a peek at the example and others. While I need to yet try using python control of Joulescope, the low_voltage_shutoff.py
and logging examples all look like they have some building blocks I can use.
Hi @simonmerrett - With Joulescopes and Python, we do have two layers. The joulescope
package is the original Joulescope user-space driver written in Python. The pyjoulescope_driver
package is the Python bindings to the newer joulescope_driver
user-space driver written in C. The pyjoulescope_driver
is lower level and provides full access to all the JS220 features using a publish-subscribe API. The joulescope
package uses the pyjoulescope_driver
package to implement a procedural API.
1 Like