Oh noes... I broke my Picos #3239
Replies: 6 comments 8 replies
-
|
I don't think I've read of such a limit on an input on the RP2040. Input current is going to be on the order of uA by design, if that, in normal operation. The datasheet would be the reference there, section 5.5.3.4. That said, there are ESD diodes which should never engage in normal operating mode that will have current limits (i.e. if you go over Vcc or below GND on an input) before they die. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
@marcdraco1-gif I'm not sure if I've fully understood what the circuit is and what you've tried so far, but putting resistors on data lines means the rise and fall times of signals is longer, due to input capacitance. In the case of I2S (or SPI, I2C etc) that may mean you have to lower the clock speed or the data transfer / messages will get mangled. If the resistor is too big, you might not be able to get the speed you wanted. If you're aiming for level conversion, you could consider a resistive divider rather than relying on the protection diodes in the inputs. Since the input current is very low, you can ignore that and just choose resistors to give the right voltage when the divider is unloaded, e.g. if you wanted to drive a signal that shouldn't exceed 3V from a 5V, source, you could use 2k and 3k in series (2k from source, 3k to ground) giving 3/5 = 3 / (3 + 2) of the source voltage at the junction of the two resistors. The actual values you'd want would allow for the output high level of the source and the minimum input high level of the input pin, but that might be close enough. |
Beta Was this translation helpful? Give feedback.
-
|
The whole thing is running at 3,3 Andy. I'm familiar with input capacitance. Using a resistive divider for level translation is ... unreliable shall we say. A proper level translator would be required but I'm not interfacing 5V logic with 3,3 so fortunately we can file that problem as moot. 5 v logic might be running at 5,5 and still be within tolerance but the divider won't know that and there goes the neighbourhood. Level translators have a regulated output (3v3 in this case) and the inputs are 5v5 tolerant or better. For anyone lurking, let's look at what Earle and I are discussing (I do make a lot of self-deprecating jokes but that's just the way I roll). Current limiting resistors slow the level translation from high to low and vice versa. The gate capacitor takes longer to charge and when we're talking in terms of nano seconds (while not specified the inputs are supposed to be less than 400 pF) plus a few pico Farads of track capacitance, so the actual rise time can be estimated from that. The base rise time is limited by the current the driving circuit and the switch point is determined by the design of the MOSFET with a high registering at around 2,4 volts (for a 3,3 supply). Without a clear input capacitance measurement which is (at best, tricky) we can only take an educated guess. Imagine we've got an internal impedance (equivalent to the maximum current the output is capable of driving) of say 50 ohms, the 2,4 v transition from low to high occurs in about 25 nano seconds which isn't hanging around but really quite pedestrian and quite capable of running a device above 12 MHz. (When I run the numbers, it never ceases to amaze me just how fast computers and MOS tech has come since I was a nipper. Bit clock on my board measures at 3,3 MHz with the controller running at 12.288 as you might guess for I2S at a 48K sample rate. I don't need the controller clock. So we can figure out the likely max usable resistance vs. the limit required. I'm not sure based on these "beer mat" calculations that a we could provide sufficient resistance to limit the current for the protection diodes (anyone know what their rated max current is?) It always makes me chuckle to think that it's not the current that destroys the device, it's the time the current flows for. At T=0 the current is theoretically infinite but that rapidly drops to something more realistic (and we're talking less than pico seconds) because this all happens at almost light speed. The rapid heating cause by too much current for too long (again measured in pico seconds for some devices) destroys the junction. This is how a a little bit of static electricity from a fingertip can generate enough current for a long enough time to blow a hole in the semiconductor material given that it's nano meters in thickness. I recall the first time I saw a picture of the damage caused to a MOS gate caused by a static discharge blew my mind. You can literally see the hole in the layers and what looks like a molten edge. I can't find the exact picture on the net but I think there's one in AoE 2nd edition (and likely the third, I haven't looked). The human body model uses a 100 pF cap charged to 2 KV (and more up to 8 KV depending on the rating) and discharged via a 1k5 resistor into the gate. So the max current in in the 2 KV case would be 1.3 amperes dropping quite rapidly but the device is coping with an average around 1 amp for around 300 nS. It's remarkable to thing that just a simple static discharge that won't even register on our nerves can deliver more than an amp! (These are all beer mat calculations but they are accurate enough to demonstrate how incredibly tough these devices are so long as we're careful.) I've still got some unused ports on the Pico but this is very odd. I'm not sure what's going "pop" right now. I just wish I could slow the transitions down sufficient so I can see them in code more easily (using standard input/output code). Right now though I'm rummaging around for an ESP32 with usable I2S (some have one, some two) and some demo code that I can see if that works as expected. I'll have to try and power my board from the Pico because it still appeared to blow an input even when the pico was powered up first. This is most irritating and it's not a software issue. |
Beta Was this translation helpful? Give feedback.
-
|
@earlephilhower - yeah I agree - the whole thing is "weird" at best. I can't make any logical sense from this consistency in producing such specific values (384 left, 15 or 0 right). I agree - it makes ZERO sense that these values would stick there. I've got to go back to my code changes and re-check. I feel like I'm going all "FTL Neutrinos" at this stage. My electronics skills are far superior to my coding ability. Not that's necessarily saying too much. LOL. I the 50-odd years I've been fooling around with electronics, I've only ever busted a couple of ICs - and in one of those cases it was usually accidentally reversing power by not checking the JST connector factory fitted by some nice Chinese lady the wrong way around. (Can't get the staff... and I know enough to check this stuff beforehand.) Where I'm a bit stuck (and you're right that someone from Raspberry PI can help here) is what goes on internally when we direct an input to do "A. N. Thing". A basic input is a MOS gate that the system reads for a logic 1 or 0 - but that (presumably) is routed to the PIO state machines by more bus logic. This is where I'm somewhat in the dark - I come from an era where a pin was an input, output or open collector/drain and when 74LS was state of the art. (I grew up with germanium transistors like the OC71.) Having multi-function pins still makes my poor old brain itch but it also makes it much harder to infer what's going "boom". :) This has to be a case of me not seeing the wood for the trees hence why I'm changing the Pico out as a variable. I'll report back when I have something more concrete. Damnable nuisance as the I2S needs to do some very basic processing to keep the total cost of the board down. It has a two channel input but a mono output (by design). Both channels are required for the full build. |
Beta Was this translation helpful? Give feedback.
-
|
OK, so I hooked up an ESP32 DoIt Devkit 1 WROOM-32 module (one of any number of similar boards I expect). I had to use AI to fallback and generate some workable code for Arduino (as I've said, I'm not a great programmer) and AI got me in a few minutes a workable sample and here's where it gets interesting. ESP32 would normally be my first choice but the Pico has supplanted that because it's consistent and While I have no way (currently) to feed the I2S out into another device - way past time I grabbed a cheap DAC as the one I have is requires I2C programming because it's based around the SGTL5000 as Paul S. used on the Teensy. If it's good enough for Paul, it's good enough for me. But to save the faff, I'll grab a cheap board from Amazon so I can listen in. The final design does a few bits of simple math and just feeds it out again. The current test board only has parallel taps for the clocks and data - I really should have used loops so I could get the I2S out and back in again without having break tracks but I added the TPs as a stopgap, it was never really meant for testing as we're discussing. But here's the weirdness. Darn thing worked the very first time I tried it. The code is far too crude to see some data and what is there is largely just random noise from the ADC's lowest few bits. Here's the ESP32 setup code (likely nicked from someone else, doncha just love the way AI steals everything?). And here's a buffer dump (there's no input audio) just some loose noise. Also, the controller is expecting 16 bits and While I speak hex, I don't speak I2S hex, I used to speak octal too but hex is so much clearer, n'est pas? :) Anyway, no point having a DAC and making silly noises yourself, right? :) Apologies for the levity, I find if I take myself too seriously I fall into a pretty dark place, pretty fast and pretty hard. TL;DR But the whole point of this exercise was to see if my board was faulty or something is up with the Pico. Given the code is highly mature, that leaves me wondering what's going on with the hardware. This particular ESP32 is one of the first that Espressif did following the ... previous one the number of which escapes me. Earl, you've got way more experience in this area than I have so perhaps you can offer some more suggestions? Maybe I didn't jigger the Pico? I'm not holding out much hope the way it powers up, etc. but this is lashed up to the ESP32 identical to Pico, the only variable I changed was using an ESP32 with some appropriate demo code. In fact, my soldering is quite spotty since I was really just hooking it up for a single, simple test, fully expecting it to fail. The recorded audio (recorded over USB at 16-bit) is very good indeed and a testament to the quality of contemporary hardware - even stuff that costs less than a buck a chip! |
Beta Was this translation helpful? Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
-
I've found a probable fix for my latest "whoopsie" - but perhaps someone else has experienced this?
To be clear, the following discussion describes some electronics which are all running at 3v3 (there are 5V parts in there but they are all behind the 3v3 regulator).
I had the Pico configured to receive I2S from an external board which doesn't use any current limit but now (after another day of failures) I've just read that the input current on Pico PIOs is limited. Easy fix, naturally - just a small resistor and better I find this now before I finalise the board! :)
I wonder if any one else has run into this. I'm familiar with not trying to source too much current from a pin but never experienced it pulling too much current. I was assuming I was driving the MOSFET's gate which is essentially a small capacitor, but you know what "assume" did. Looks like I'd better get stuck back into the RP2040 datasheet before I jigger another one.
Something new for the book. Better I make mistakes now than have someone else chase me with a big stick later.
I don't have a differential scope probe to measure the current during high-speed transitions so I'll try put some series resistors in there and see what happens.
This is probably in the datasheet somewhere - maybe someone else knows if there's schematic for the inputs? Man do I feel like a doofus - again.
I guess this the cost of a configurable device where the same "pin" can be an output or an input.
Beta Was this translation helpful? Give feedback.
All reactions