Skip to content
This repository was archived by the owner on Mar 16, 2026. It is now read-only.

Support VSELECT on HW3#1142

Merged
sanni merged 2 commits intosanni:masterfrom
masayuki0812:support-vselect-on-hw3
Dec 21, 2025
Merged

Support VSELECT on HW3#1142
sanni merged 2 commits intosanni:masterfrom
masayuki0812:support-vselect-on-hw3

Conversation

@masayuki0812
Copy link
Contributor

@masayuki0812 masayuki0812 commented Nov 11, 2025

I'd like to use VSELECT on HW3, so I'm opening this PR.

As far as I understand, VSELECT is not available on HW3 because VSELECT depends on PD7(D38) and this pin is already connected to a button on HW3.

However, on HW3, PD3(D18) is available instead because this pin is connected to ROTARY that is not used on HW3. So, if PD3 can be used for VSELECT instead of PD7, then VSELECT can work on HW3.

Then, I changed the code like:

  • Set pin PD7 to input by default, and update it if needed. (e.g. VSELECT on HW5, status LED on HW5, etc)
  • Branch based on VSELECT first, and if VSELECT is enabled, determine which pin to use. If VSELECT is not enabled, status LED should work on HW5 and set pin to work so.
  • Add HW3 to VSELECT supported HW versions.

I tested on HW5 and customized HW3 that can have VSELECT module.

  • HW5 with VSELECT
    • Voltage changes based on setVoltage function.
    • Rotary works.
    • Read FC(+5V) and GBA(+3V3) ROMs.
  • HW5 without VSELECT
    • Status LED works.
    • Read FC(+5V) and GBA(+3V3) ROMs by manual voltage setting.
  • HW3 with VSELECT
    • Voltage changes based on setVoltage function.
    • Both buttons works.
    • Read FC(+5V) and GBA(+3V3) ROMs.
  • HW3 without VSELECT
    • Read FC(+5V) and GBA(+3V3) ROMs by manual voltage setting.

Please review when possible. Thanks in advance!

@sanni
Copy link
Owner

sanni commented Nov 22, 2025

Great work. 😃

I don't have any OSCR with Vselect so I can't test it though As far as I remember it was important with Vselect that the 5V the OSCR starts with gets switched to 3.3V fast enough so that 3.3V cartridges never see the 5V.
Maybe someone that owns an oscilloscope can test if this is still the case after this code change.

@masayuki0812
Copy link
Contributor Author

Thank you very much for your comment. 😃

I just noticed the pin I used (D13) is not suitable for VSELECT because it is used by LED on Arduino as well and it changes voltage unexpectedly on boot.

Then, I'm going to change the pin to another, so let me convert this PR to draft.

@masayuki0812 masayuki0812 marked this pull request as draft November 25, 2025 07:36
@masayuki0812
Copy link
Contributor Author

I updated the code to use PD3 for VSELECT based on ENABLE_ROTARY flag. And I saw its voltage during boot by oscilloscope and it looks ok.

just turn on:
bmp_27_004.bmp

turn off/on x2:
bmp_27_005.bmp

By the way, to prevent 5V spike during boot, PD3 must be pulled up to VCC like PD7 with R1(220R) on HW5.

Without pull up, 5V spike happened like this:
bmp_27_006.bmp

This happens on HW5 as well and it's critical, so we probably should mention about this pull up clearly. Wiki or warning message on compile seem good, but where would be the best place?

@masayuki0812 masayuki0812 marked this pull request as ready for review November 26, 2025 05:55
@Ancyker
Copy link
Collaborator

Ancyker commented Nov 26, 2025

My testing didn't show a 5V spike on HW5 anymore post-fix, likely because the 470uF capacitor buffers it before it can climb to 5V. Regardless, I made a bootloader that also fixes the issue by setting 3.3V even earlier. It will be added soon with the firmware rework.

VSELECT was originally unavailable on HW3 because I didn't have one. It remained that way because it doesn't fit well. It would need a revision to HW3 to best fit it, and HW3 is no longer on the repository. Perhaps HW3 should still be on the repository since it's still popular as it's a smaller build?

@masayuki0812
Copy link
Contributor Author

Thank you for the comments.

I'm not sure how popular HW3 still is, but I believe there are still a fair number of people who built it in the past and continue to use it. VSELECT itself is a well-designed feature, and although it requires a pull-up, it can be controlled from pins other than PD7 with only minor changes. With proper external wiring, it also works reliably, so I feel it's reasonable to extend support to HW3 as well, not just HW5.

That said, I don’t think we need to integrate VSELECT directly into the HW3 PCB at this point. The layout constraints you mentioned make sense, and in my view, external support is sufficient as long as the software handles it properly.

Also, I may have made it sound like the goal was specifically to support HW3, but my intention is simply to enable VSELECT whenever there is a spare pin available (such as ROTARY or LCD). Whether it’s HW5 or not is less important—the key point is whether a controllable pin is connected to the VSNS pin of the TPS2113(A)PW(R).

@sanni sanni merged commit 991f461 into sanni:master Dec 21, 2025
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants