-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RP2350: hardware issue: stuck inputs #9541
Comments
That code may pre-date the pico-sdk having an API for it. :-) There is an errata around pull downs and input too. That will likely impact this too. |
I was just going to mentioned errata E9, which I first saw mentioned here: https://github.com/orgs/micropython/discussions/15621#discussioncomment-10423602 |
I think that API might not have been present in early versions of pico-sdk. I'm preparing a PR for this and will include that change. |
I am not sure that the erratum RP2350-E9 is the cause of this after all, even though we are seeing the 2.1V "stuck" value. On RP2350: [attach jumper between A0 and 3.3V]
>>> import digitalio, board
>>> a0 = digitalio.DigitalInOut(board.A0)
>>> a0.value
True
[remove jumper]
>>> a0.value
True RP2040 does not show this. There is a fundamental difference between RP2040 and RP2350: The RP2040 datasheet says:
The RP2350 datasheet says (for BANK0):
EDIT: WRONG. I already wrote code to address E9, which I wrote first, but didn't fix the |
I was wrong above: |
just peeping at the datasheet there's also the new "pad isolation" bit for each GPIO (but this bit should also be correctly set by |
I am seeing this 2.2V latchup (actually 2.4V here) with the pulls not set at all, ever, and even with a 1M pull-down on the pin. I am testing with Example: One other thing: the power-on reset state of the pins sets a pull-down. See 14.8.2.2, page 1319, in the RP2350 datasheet and 5.5.2.2, page 615 in the RP2040 datasheet. We never clear this explicitly that I see (we should have). I changed our code so we clear both pulls immediately on |
I am going to try to reproduce these problems with some simple pico-sdk programs. |
I filed an issue with raspberry-pi: raspberrypi/pico-feedback#401 |
touchio
does not worktouchio
does not work + other problems
touchio
does not work + other problems
@todbot Addressing the original issue: I was able to implement However, this method doesn't yet work on RP2350 because of the latch-up. I need to implement something like the workaround described in RP2350-E9: enabling and disabling the input using Anyway, maybe we have a path forward on |
@dhalbert, agreed, this is what I found when I was hacking too. I didn't consider it a viable alternative since it changed the API of |
The API is the same: it's just that you use an external pullup instead of a pulldown. The code difference is very slight, and can be determined at compile-time. See main...dhalbert:circuitpython:rp2350-touch. Also, SAMD21 doesn't use the generic |
Apologies, I wasn't very clear. I was assuming the |
The RP2350 datasheet has been updated: the RP2350-E9 erratum has been rewritten and includes a lot more information. I'll study it to see what we need to do in |
@todbot The plan I had in mind was to switch at compile-time, for RP2350 only, to supporting a weak pull-up rather than a weak pull-down. That would be documented, so any RP2350 hardware would need to use it that way. It would not be an option to switch at run-time between the two methods. I just was testing it on RP2040 to see if the idea worked. We might support an informational It's true that any existing external boards that added external pull-downs wouldn't work with RP2350, but that's already the case, and we couldn't fix that. The boards would need a redesign, to allow the pull direction to be set by a jumper. Which board(s) of yours are affected by the RP2350 issue? |
All of these I've sold, currently sell, or are planning to sell. As Raspberry Pi has advertised the Pico2 as a drop-in replacement for Pico, I now have to make sure my customers don't inadvertently solder down a part that can never work. |
That's a lot of boards to respin. I don't see any way around it |
If |
On Monday we discussed internally what to do about the E9 workaround for CircuitPython. Without adding additional API specifically to support the RP2350, there is no way to inform CircuitPython in various use cases, "well, yes, this is a weak input signal, so do the workaround". The only hint would be if you enabled the internal pulldown, but there are other cases as well. We do not right now want to make a special-case API for the RP2350. So our conclusion is to not implement the workaround, at least for now, but simply to document the restrictions that make it unnecessary: don't expect the internal pulldown to work, use an external pulldown 8.2k or lower if you need a pulldown, or make sure your input signal can sink enough current to override the leakage current. This is defining the problem away. So this now becomes an issue to address via documentation. In addition, we will disable |
CircuitPython version
Code/REPL
Behavior
Pin GP2 has a 1M resistor going to GND.
Description
The standard touchio technique doesn't seem to work.
Happens for at least these pins:
board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5, board.GP6, board.GP7 ,board.GP8, board.GP9, board.GP10, board.GP11, board.GP12, board.GP13, board.GP14, board.GP15
on a known-good board that works with Pico RP2040.Additional information
The three functions
touchio
uses:common_hal_digitalio_digitalinout_switch_to_output(self->digitalinout, true, DRIVE_MODE_PUSH_PULL)
common_hal_digitalio_digitalinout_switch_to_input(self->digitalinout, PULL_NONE)
common_hal_digitalio_digitalinout_get_value(self->digitalinout)
Haven't had any changes for RP2350 except for one-line to select pin drive strength. Since other normal
digitalio
uses seem to work, I'm at a loss .But for that drive-strength setting in DigitalInOut.c, why is it this:
and not:
as described in the Pico-SDK docs?
The text was updated successfully, but these errors were encountered: