Q Re:User Switch (Badger 2040, Keybow2040, etc)

On a few Pimoroni boards there is a “User Switch” that can be optionally coded for labeled USER_SW

Based on the schematics and the connection of the USER_SW (near center diagram), am I right in assuming that it’s wired as pulled up?

If I choose to use the switch in code, is there any consequence for it’s boot selection function if I swap the pull type in code, or should it always be used as wired?

Looks like its wired as pull up to me.

The code used won’t affect its boot mode function. That is hard wired, and it’s done on power up before any saved code gets run.

You may get errors in your code trying to use pull down though? I recommend using it as wired.

As long as it is likely to toast anything I’ll try it both ways and report back for completeness, thanks!

I can’t see it damaging anything?

sorry that was a bit of dry humor on my part, should have read “is not likely”

funny thing, at least in CircuitPython (using DigitalInOut) it’s either impossible to specify the user switch as a pull down (quietly ignored), or the logic is quietly inverted . I haven’t had a chance to try in microPython yet

Still have no clue why there’s such a tendency for pull up on buttons and switches whose primary function is to engage (rather than interrupt) a task. Seems contrary to both logic and fail-safe defaults. =S

I had assumed it was a typo and you actually meant “not likely”.

Changing the setting in code isn’t going to physically remove the resistor, its hard wired as pull up. It’s that way because its also the boot select button. It’s checked before any code gets run. It supersedes any code on the Pico. That’s my understanding of how it works?
The downside of that is you will have to live with it being pull up with no way to change it.