Skip to content

USB: Auto controller mode for units whose PC9 sticks high #170

Done

Description

@fletto2

One request

  • This request describes one feature or improvement, or changes that belong to the same feature.

Area

USB

What do you want to do?

Leave the USB controller set once and have it run only when a computer is actually there.

Today the choice is Enabled or Disabled. Enabled keeps the controller running on battery and on a
charger too, which on some units costs something: in #23 a repaired ZT703S flickered and the DMM was
unusable at 200 MHz until the controller was Disabled, and then USB is gone until you go back into
the menu. Disabled is safe but you have to remember to turn it on before plugging in a PC.

The obvious trigger, "USB power present", isn't reliable on its own. PC9 is not a proven VBUS sense:
in #104 it stayed high on battery after an unplug. So a mode that just follows PC9 would either stay
on forever on such a unit or never come back.

Proposed solution

A third choice for Settings → Files & USB → USB controller: Auto. The default stays Enabled, so
nothing changes for anyone who doesn't pick it.

With Auto:

  • The controller is on at power-on and whenever PC9 rises, and goes off 5 s after it is on the bus
    with no host (a host counts only as hostActive() sees it, from its SOFs; an attach still waiting
    for a quiet capture doesn't use up the 5 s, up to 30 s of waiting). On battery or a charger that is one
    5 s attempt.
  • While PC9 stays high with the controller off (a charger, or a stuck pin), it looks for a host again
    after 30 s, then 60 s, then every 2 min. A look that finds nobody costs one capture (the quiet
    attach window); a host found resets the delay.
  • Once a host has been seen, the controller stays on as long as PC9 is high, with no timeout, so a
    sleeping PC keeps its session. It goes off 5 s after PC9 falls.
  • USB Remote keeps the controller on while Remote runs, but doesn't count as a host seen (so leaving
    Remote on a charger doesn't latch USB on afterwards).
  • USB Remote from the menu on Auto works when the controller is on at that moment; otherwise it says
    "USB Auto: no computer found". It doesn't start a probe itself.
  • Choosing Auto, or a settings reload that changes the controller to Auto, starts from a fresh 30 s
    delay.

settings.json: usb.controller gets a third value, "auto". The field stays uint8_t, no layout
change. Older files load unchanged. One caveat: a file saved with "auto" is rejected by older
firmware (its parser only knows disabled/enabled): it archives the file and starts from the defaults
(or an older backup copy), so a downgrade resets all settings.

We've run this in our fork since our tester's build 44 on a ZT703S (it took a few review rounds to
settle the timeouts and the Remote cases). I have it on a branch against 0.21.19 as one commit,
README included, and can open it as a PR if you want it. If you'd rather solve #23/#104 another way,
for example a better VBUS sense, I'm happy to drop it.

Alternatives

Switching between Enabled and Disabled by hand, as today. Following PC9 alone, which fails on units
where it sticks (#104).

Devices

  • ZT703S
  • ZT706S

Activity

  1. bve commented on Nov 26, 2026

    @bve
    Owner

    Included in the OpenOSC 0.22.0 pre-release.

    Settings → Files & USB → USB controller now includes Auto. It probes for a host, stops the controller after a hostless attempt, and retries while the power signal stays high. On ZT703S I checked the 30 s and 60 s retries and transfer recovery when a host returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions