mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

336K
active users

Tube❄️Time

this is a graph showing the infamous GPIO bug in the new Raspberry Pi RP2350 microcontroller. the scale is not mA, it's actually uA (phew). but you won't believe what I went through to get this data! 🧵

first, since i always seem to do stuff the hard way, i designed a board from scratch for the 2350. i call it the Rotten Pi 2350[A] mostly because i threw it together in a huge hurry two weeks ago.

(i did the layout on a Twitch stream but I forgot to turn on VoD, sorry about that.)

then, i built my own curve tracer on a breadboard. i'm driving a sawtooth waveform from my Rigol scope through a 1K sense resistor, and this chip amplifies the voltage drop and runs it into channel 2. channel 1 goes to the downstream side of the 1K resistor so the voltage is accurate.

i have a pico 2 that i loaded with the "debugprobe" app and connected it to the Rotten Pi. i need to do this to directly program the GPIO control registers.

here is the complete configuration. the curve tracer is tied to GPIO0 and, using the debugprobe, i can turn the pullup or pulldown on and off and observe the results on the scope.

when you power up the chip without loading any software, the pulldown resistor is turned on by default so you can see it sinking current here. there's a very odd peak as you cross above VDDIO + 0.3V which makes me think there is an internal diode. above that, i think the fault tolerant circuit kicks in and the current goes back down again.

if you turn on the pulldown, the whole curve shifts up a bit, which is expected. the "glitch" is still there, trying to source current, but part of that current is canceled out by the pulldown.

if you turn on the pullup resistor, it shifts the whole curve down (also expected). the flat part is the measurement limit of my quick-and-dirty curve tracer, not the chip.

well this is weird, you can turn on the pullup and pulldown at the same time! you get this strange effect where the pulldown takes effect at low voltages and the pullup takes effect at higher voltages, after the glitch. i wonder if this is related. 🤔

the glitch is affected by the Schmitt trigger setting. this tells me that whatever circuit is sourcing current out of the pin depends on the state of the input *after* the first input buffer stage.

when i turn off the IE bit (input enable), the glitch goes away completely and the pullup/pulldown modes behave correctly. when both pullup and pulldown are turned on, the pulldown takes priority.

so with VCCIO running at 1.8V, the glitch is only around 30uA. in general, the lower the VCCIO, the smaller the glitch.

anyway i did this whole experiment because i'm investigating the 5V tolerance. the little spike at VCCIO+0.3V is my current focus. note that the leakage current goes up to about 3uA on the other side of the spike.

here's the voltage sweep around the little spike and all the way up to 6.4V (!) you can see the ESD clamp kicking in at around 6V. it is a Zener-style clamp, so it doesn't depend on VCCIO.

the trick to this measurement is to set the voltmeter in high impedance mode (1GOhm) instead of the usual 10Mohm mode which would pull too much current and throw off the measurement

oh this is odd, when VCCIO=1.8V and the pullup is on, the GPIO pulls 150uA at 3.8V but then it drops again. (abs max is 3.63V so we are in uncharted waters)

I'm going to leave it this way at least overnight and see how it goes. 5V on GPIO0 with no voltage on VDDIO (which is sitting at around 150mV due to some back bias leakage)

the results? a *very slight* change in the curve trace. but it's basically identical, you could handwave this away with a temperature difference between the two sets of measurements.

somewhat more concerning is that the threshold (vih) of the pin has shifted up by about 50mV. ~1.36V -> 1.41V. EDIT: i measured it again with the curve tracer instead of directly with the voltmeter/ammeter combo, and it appears to be identical to the other GPIO pins. it's tricky to measure the threshold with the source current bug affecting the measurement.

hmm, there does seem to be an effect on the Schmitt trigger circuit. GP0 has a lower falling threshold than the other pins when Schmitt trigger mode is turned on.

@tubetime Quite interesting stuff. They removed the mention to 5V tolerance from the datasheet IIRC, so maybe they're not very convinced it will work.

@tubetime Oh you're right. They removed some references though (about that and the 10 uA DVDD sleep mode)

@tubetime shouldn't the protection diodes bring it almost all the way up?

@RueNahcMohr sometimes yes but not in this case.

@RueNahcMohr @tubetime Normal ones will charge the supply. Zener protection doesn't.

@jhaluska you better, your name is on the back.

@tubetime No, this is the "bus keeper" mode which enables pull-up when the input is high, and pull-down when it's low. It's part of the core-side logic, not part of the pad macro.

@wren6991 ahh excellent, that makes sense. btw the "glitch" reminds me a lot of a slew rate accelerator but only for rising edges, i guess.

@tubetime Maybe we can market that as a feature.

When I went to get a citation for the bus keeper mode I realised it is only mentioned (briefly) in the SDK doxygen, so I added some brief notes for the next datasheet release:

@wren6991 i was wondering why that feature didn't sound familiar when you first mentioned it.

@tubetime
I use my Flipper Zero for that, the CMSIS-DAP app does SWD and Uart at the same time, very ideal. Saves me hooking up multiple adapters.

@grishka the connector is terrible, the PCB layout tolerances are really tight, and the connector is hard to solder.

@tubetime @grishka I'm glad someone finally said it. Micro B forever

@tubetime lol at "magical misery inductor." it's such a weirdly precious part they want you to use.

@polpo i'm not using their recommended part, this is just a plain old inductor from Mouser.

@tubetime I just noticed the text, "Fake DVI - not HDMI for legal reasons". Shared it with some friends and we're all chuckling at that one!

@tubetime All the spite dripping off those stencils! :chef_kiss:

@tubetime Loving the silk screen of all your PCBs XD. I'm wondering why the "USB-C sucks" though.