Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate waveform to trigger external equipment for automated testing #195

Open
FrankZyyz opened this issue Jun 27, 2023 · 3 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@FrankZyyz
Copy link

FrankZyyz commented Jun 27, 2023

Joulescope model

JS220

UI version

1.0.22

Your idea

JS220 has OUT0 and OUT1, now it only can be set by mouse click the joulescope_ui button.
I would like OUT0 can output a waveform like HIGH for 200ms, LOW for 1000ms, repeat for 1000 times,
Above function can help to setup some automated testing with my device.(battery test or something else).

In fact, I already saw this in features_future.md.

Trigger on waveform: select a waveform. Then trigger and overlay similar.

I would like to get some hints about how to adjust joulescope_ui code and call some module to create this waveform.
(Like create a thread and set the timing, control the OUT0/OUT1 status.)
Thanks.

Does your idea concern a specific OS?

No response

@FrankZyyz FrankZyyz added enhancement New feature or request triage New issue that needs to be reviewed and prioritized labels Jun 27, 2023
@mliberty1 mliberty1 changed the title Trigger on waveform for automated testing Generate waveform to trigger external equipment for automated testing Jun 27, 2023
@mliberty1 mliberty1 removed the triage New issue that needs to be reviewed and prioritized label Jun 27, 2023
@mliberty1
Copy link
Member

mliberty1 commented Jun 27, 2023

Hi @FrankZyyz , and thank you for the feature request. I changed the title to hopefully clarify that you want to use this signal to trigger external equipment, not the JS220 itself. Did I understand correctly?

The feature to generate digital waveforms for OUT0, OUT1, and Trigger OUT is definitely on our list. We will implement this in the JS220 FPGA to give microsecond accuracy and precision. However, we have not figured out the details of the feature. What you described is a PWM waveform, which it will certainly support. We do not have a timeframe for this feature yet, unfortunately.

While you could implement this using host-side python, the precision will not be great. Getting a Windows, macOS, or Linux computer to do anything with millisecond precision is a losing battle.

In the meantime, perhaps you can use a Raspberry PI Pico to generate this waveform? Here is the quick PWM reference. You can also check out the JS220 Evaluation Kit 1 firmware. It starts with a comment about the ways to control digital signals:

MicroPython with the Raspberry PI RP2040 microcontroller has five different
ways to toggle signals over time:
1. GPIO set from REPL
2. GPIO set from for/while loop with time.sleep()
3. GPIO set from machine.Timer ISR
4. PWM
5. PIO

What do you think?

@FrankZyyz
Copy link
Author

@mliberty1 Thank you for your reply.
Your understand is correct about changed title.

And thanks for your warn about OS precision and MicroPython solution.

@mliberty1 mliberty1 moved this to Todo in Joulescope UI 1.1 Feb 28, 2024
@mliberty1 mliberty1 moved this from Todo to Done in Joulescope UI 1.1 Apr 3, 2024
@mliberty1
Copy link
Member

Partially done. 1.1.6 now has the Trigger widget, which you can use to detection conditions and take actions, such as drive a GPO. However, it does not yet have the ability to generate a PWM signal using the JS220 FPGA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants